diff --git a/.github/README.md b/.github/README.md index a0d8dd4..c81a214 100644 --- a/.github/README.md +++ b/.github/README.md @@ -36,8 +36,14 @@ Nix code. +
- +> [!WARNING] +> Main branch is only updated for small, non-breaking changes. For the latest version of neovim-flake, please see +> [the list of branches](https://github.com/NotAShelf/neovim-flake/branches) or +> [open pull requests](https://github.com/NotAShelf/neovim-flake/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc). +> neovim-flake, at the time, is still being actively developed - and will continue to be so for the foreseeable +> future. --- @@ -177,3 +183,7 @@ Following the [original neovim-flake](https://github.com/jordanisaacs/neovim-fla are published under the [CC BY License]. --- + +
+ Back to the Top +
diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 7463585..855ee9c 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -36,7 +36,7 @@ jobs: cp -r result/share/doc/neovim-flake public - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public diff --git a/modules/plugins/languages/css.nix b/modules/plugins/languages/css.nix index 9646e02..3fcf5cf 100644 --- a/modules/plugins/languages/css.nix +++ b/modules/plugins/languages/css.nix @@ -37,6 +37,33 @@ ''; }; }; + + defaultFormat = "prettier"; + formats = { + prettier = { + package = pkgs.nodePackages.prettier; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.prettier.with({ + command = "${cfg.format.package}/bin/prettier", + }) + ) + ''; + }; + + prettierd = { + package = pkgs.prettierd; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.prettier.with({ + command = "${cfg.format.package}/bin/prettierd", + }) + ) + ''; + }; + }; in { options.vim.languages.css = { enable = mkEnableOption "CSS language support"; @@ -63,6 +90,22 @@ in { default = servers.${cfg.lsp.server}.package; }; }; + + format = { + enable = mkEnableOption "CSS formatting" // {default = config.vim.languages.enableFormat;}; + + type = mkOption { + description = "CSS formatter to use"; + type = with types; enum (attrNames formats); + default = defaultFormat; + }; + + package = mkOption { + description = "CSS formatter package"; + type = types.package; + default = formats.${cfg.format.type}.package; + }; + }; }; config = mkIf cfg.enable (mkMerge [ @@ -73,7 +116,12 @@ in { (mkIf cfg.lsp.enable { vim.lsp.lspconfig.enable = true; - vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig; + vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig; + }) + + (mkIf cfg.format.enable { + vim.lsp.null-ls.enable = true; + vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig; }) ]); } diff --git a/modules/plugins/languages/tailwind.nix b/modules/plugins/languages/tailwind.nix index d641b7e..594f6d9 100644 --- a/modules/plugins/languages/tailwind.nix +++ b/modules/plugins/languages/tailwind.nix @@ -55,7 +55,7 @@ in { config = mkIf cfg.enable (mkMerge [ (mkIf cfg.lsp.enable { vim.lsp.lspconfig.enable = true; - vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig; + vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig; }) ]); } diff --git a/modules/utility/telescope/telescope.nix b/modules/utility/telescope/telescope.nix new file mode 100644 index 0000000..13d67cb --- /dev/null +++ b/modules/utility/telescope/telescope.nix @@ -0,0 +1,54 @@ +{ + pkgs, + lib, + ... +}: let + inherit (lib) mkMappingOption mkEnableOption mkOption types; +in { + options.vim.telescope = { + mappings = { + findProjects = mkMappingOption "Find files [Telescope]" "fp"; + + findFiles = mkMappingOption "Find files [Telescope]" "ff"; + liveGrep = mkMappingOption "Live grep [Telescope]" "fg"; + buffers = mkMappingOption "Buffers [Telescope]" "fb"; + helpTags = mkMappingOption "Help tags [Telescope]" "fh"; + open = mkMappingOption "Open [Telescope]" "ft"; + + gitCommits = mkMappingOption "Git commits [Telescope]" "fvcw"; + gitBufferCommits = mkMappingOption "Git buffer commits [Telescope]" "fvcb"; + gitBranches = mkMappingOption "Git branches [Telescope]" "fvb"; + gitStatus = mkMappingOption "Git status [Telescope]" "fvs"; + gitStash = mkMappingOption "Git stash [Telescope]" "fvx"; + + lspDocumentSymbols = mkMappingOption "LSP Document Symbols [Telescope]" "flsb"; + lspWorkspaceSymbols = mkMappingOption "LSP Workspace Symbols [Telescope]" "flsw"; + lspReferences = mkMappingOption "LSP References [Telescope]" "flr"; + lspImplementations = mkMappingOption "LSP Implementations [Telescope]" "fli"; + lspDefinitions = mkMappingOption "LSP Definitions [Telescope]" "flD"; + lspTypeDefinitions = mkMappingOption "LSP Type Definitions [Telescope]" "flt"; + diagnostics = mkMappingOption "Diagnostics [Telescope]" "fld"; + + treesitter = mkMappingOption "Treesitter [Telescope]" "fs"; + }; + + enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility"; + + vimgrep_arguments = mkOption { + description = "Arguments to use for the grep command"; + type = types.listOf types.str; + default = [ + "${pkgs.ripgrep}/bin/rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + "--hidden" + "--no-ignore" + ]; + }; + }; +} +