From e8197651d9ff7ad784210c190124c572bb4a05a9 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 22 Dec 2023 21:50:58 -0500 Subject: [PATCH] refactor(neovim): use only needed grammars --- common/home/neovim/default.nix | 235 +++++++++++++++++++++------------ flake.lock | 54 ++++---- 2 files changed, 181 insertions(+), 108 deletions(-) diff --git a/common/home/neovim/default.nix b/common/home/neovim/default.nix index a3734d9a..5239accd 100644 --- a/common/home/neovim/default.nix +++ b/common/home/neovim/default.nix @@ -150,94 +150,167 @@ in { extraConfig = fileContents ./base.vim; extraLuaConfig = fileContents ./base.lua; - plugins = with pkgs.vimPlugins; ([ - fzfWrapper - fzf-vim - fugitive + plugins = with pkgs.vimPlugins; + ([ + fzfWrapper + fzf-vim + fugitive - { - plugin = dracula-nvim; - type = "viml"; - config = fileContents ./plugins/dracula.vim; - } - { - plugin = lualine-nvim; - type = "lua"; - config = fileContents ./plugins/lualine.lua; - } - { - plugin = todo-comments-nvim; - type = "lua"; - config = "require('todo-comments').setup()"; - } - { - plugin = gitsigns-nvim; - type = "lua"; - config = fileContents ./plugins/gitsigns.lua; - } - { - plugin = nvim-autopairs; - type = "lua"; - config = fileContents ./plugins/autopairs.lua; - } + { + plugin = dracula-nvim; + type = "viml"; + config = fileContents ./plugins/dracula.vim; + } + { + plugin = lualine-nvim; + type = "lua"; + config = fileContents ./plugins/lualine.lua; + } + { + plugin = todo-comments-nvim; + type = "lua"; + config = "require('todo-comments').setup()"; + } + { + plugin = gitsigns-nvim; + type = "lua"; + config = fileContents ./plugins/gitsigns.lua; + } + { + plugin = nvim-autopairs; + type = "lua"; + config = fileContents ./plugins/autopairs.lua; + } + { + plugin = indent-blankline-nvim; + type = "lua"; + config = fileContents ./plugins/indent.lua; + } + { + plugin = mini-nvim; + type = "lua"; + config = fileContents ./plugins/mini.lua; + } + ] + ++ optionals nvimIde [ + # Coc configured + coc-css + coc-eslint + coc-java + coc-sh + coc-stylelintplus + { + plugin = coc-snippets; + type = "viml"; + config = fileContents ./plugins/snippets.vim; + } + + ## Lua + coc-sumneko-lua + neodev-nvim + + ## Fzf + coc-fzf + + coc-highlight + coc-json + coc-pyright + coc-vimlsp + coc-yaml + coc-toml + coc-markdownlint + coc-tsserver + + { + plugin = neo-tree-nvim; + type = "viml"; + config = '' + ${fileContents ./plugins/neotree.vim} + + lua << EOF + ${fileContents ./plugins/neotree.lua} + EOF + ''; + } + ]) + + # Treesitter + ++ (with pkgs.vimPlugins; [ nvim-treesitter-context nvim-treesitter-textobjects nvim-treesitter-hypr { - plugin = nvim-treesitter.withAllGrammars; type = "viml"; config = fileContents ./plugins/treesitter.vim; - } - { - plugin = indent-blankline-nvim; - type = "lua"; - config = fileContents ./plugins/indent.lua; - } - { - plugin = mini-nvim; - type = "lua"; - config = fileContents ./plugins/mini.lua; - } - ] - ++ optionals nvimIde [ - # Coc configured - coc-css - coc-eslint - coc-java - coc-sh - coc-stylelintplus - { - plugin = coc-snippets; - type = "viml"; - config = fileContents ./plugins/snippets.vim; - } - - ## Lua - coc-sumneko-lua - neodev-nvim - - ## Fzf - coc-fzf - - coc-highlight - coc-json - coc-pyright - coc-vimlsp - coc-yaml - coc-toml - coc-markdownlint - coc-tsserver - - { - plugin = neo-tree-nvim; - type = "viml"; - config = '' - ${fileContents ./plugins/neotree.vim} - - lua << EOF - ${fileContents ./plugins/neotree.lua} - EOF - ''; + plugin = nvim-treesitter.withPlugins (p: [ + p.awk + p.bash + p.c + p.c_sharp + p.cairo + p.cmake + p.comment + p.cpp + p.css + p.csv + p.cuda + p.diff + p.dockerfile + p.dot + p.git_config + p.git_rebase + p.gitattributes + p.gitcommit + p.gitignore + p.go + p.gomod + p.gosum + p.groovy + p.haskell + p.haskell_persistent + p.html + p.ini + p.java + p.javascript + p.jq + p.jsdoc + p.json + p.json5 + p.jsonc + p.jsonnet + p.kotlin + p.latex + p.lua + p.luadoc + p.make + p.markdown + p.meson + p.ninja + p.nix + p.passwd + p.perl + p.php + p.phpdoc + p.properties + p.python + p.rasi + p.regex + p.requirements + p.ruby + p.rust + p.scss + p.sql + p.ssh_config + p.toml + p.todotxt + p.typescript + p.udev + p.vim + p.vimdoc + p.vue + p.xml + p.yaml + ]); } ]); }; diff --git a/flake.lock b/flake.lock index bc377599..0610742b 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1703084405, - "narHash": "sha256-kmpns3mc7IzDYRIvyK+ZubaUJKqp869siRlsc1bMrGg=", + "lastModified": 1703290233, + "narHash": "sha256-QQjBp7VVDQzydlelmAjnnuA/3gyPlo0fObzGFytLEE4=", "owner": "Aylur", "repo": "ags", - "rev": "f6dd934744f496731c2d857b03a7e1c7456e2757", + "rev": "d1835cad79868cab3154d673e6d37b6b46624611", "type": "github" }, "original": { @@ -215,11 +215,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -314,11 +314,11 @@ ] }, "locked": { - "lastModified": 1703178811, - "narHash": "sha256-Orbqa8DvszYZ38XGWAs43hVs++czt2N6/Y0sFRLhJms=", + "lastModified": 1703265279, + "narHash": "sha256-5jVtOwyMH1FzclxHrsFWzBdB+VyjUUSu1wyZhZlR6WU=", "owner": "nix-community", "repo": "home-manager", - "rev": "fb5ac0c870a1b3ffea70e02ab1720d991ce812ae", + "rev": "07c322a7cff03267fd881adae1afe63367c5d608", "type": "github" }, "original": { @@ -358,11 +358,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1703194032, - "narHash": "sha256-ynsyO+BacfysxWm3R9owGPZfsClLXWEXNEfqMD6mBic=", + "lastModified": 1703287262, + "narHash": "sha256-gvSACF7FRNkSZ2s1pXlqeK/qw6QF7gn1gHTt6I1dwA4=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "bd952dcef2ead3b0b7e2d730930a3fc528813ee0", + "rev": "6c8e0f9863d86755d7931a9d6ad920b2049cf6a6", "type": "github" }, "original": { @@ -426,11 +426,11 @@ ] }, "locked": { - "lastModified": 1703117360, - "narHash": "sha256-hny5sw/gmO3Rl1I+8sCIgKY1hRLg/L68cVCZVndug24=", + "lastModified": 1703290449, + "narHash": "sha256-Pmi8rLEUZfbBT/vsRq86PqEbZp/OKqoA7kG2prMWMpA=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "5c08a5966b296b2f208a4050fbe22509d56ce669", + "rev": "12691c4ab966caf6b1c28bcd540104f5478d7829", "type": "github" }, "original": { @@ -449,11 +449,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1703098322, - "narHash": "sha256-atHwBC/dzCWR7tc5B0mpmiKEkGNJhp39eteQlfzerTg=", + "lastModified": 1703289024, + "narHash": "sha256-8lhYdgoytyJbX7q0eQvNwfkoLnvG8t4E1dNml4rv7OI=", "owner": "neovim", "repo": "neovim", - "rev": "0c120307ca1ab613e63865c634d7e10ad67fb0ba", + "rev": "0c3d2a7fd99d6171fad81cc8b010281b1cd1c3e0", "type": "github" }, "original": { @@ -531,11 +531,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1703121193, - "narHash": "sha256-ZxiqYr9+KSeRUpdXSY+kN4Jep4rKJSW85aakdGNapC0=", + "lastModified": 1703293829, + "narHash": "sha256-WoKwe5AeiuhxLFn5dM/ddC7dC6rnEgZWfpLSeWNmOCg=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "df28ff973371ca1f0b296adaadf0714af6f4f226", + "rev": "97060d449346cc39bd5da8e190be0528c5bb3251", "type": "github" }, "original": { @@ -719,11 +719,11 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1703193381, - "narHash": "sha256-ene7BogLot9jn/xTAP2W1hm8HxPAmW1j0LsSbsraTdI=", + "lastModified": 1703269123, + "narHash": "sha256-GWIDaBkJXN3i+LZL5rN1lKib3Ie4RZDQnTgz0zwh/Wk=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "8e05204779246147cdcf501ac97e63ee19d6eba7", + "rev": "465aa369972263f144d72e42b254e3299eb9fdea", "type": "github" }, "original": { @@ -878,11 +878,11 @@ }, "nur": { "locked": { - "lastModified": 1703187919, - "narHash": "sha256-r28tTx9xuc2h3tCA1zmotrLnJDffaFHMMSy5hDpkegU=", + "lastModified": 1703293508, + "narHash": "sha256-UOqBwltrbt7N4NTt+jhXnSRctnKMfaaMCwZKbKHOw/4=", "owner": "nix-community", "repo": "NUR", - "rev": "aa77c3b4f6b8dba86c5e75269b1f6a123168d4df", + "rev": "d0b69ff035bd06125e018c4f78c4964a9479ffcd", "type": "github" }, "original": {