From ce6c3a1d49f8371656870f9af4fb06ff38e57d85 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Thu, 15 Feb 2024 18:20:47 +0100 Subject: [PATCH] nvim: do not install tree-sitter parsers via nix anymore --- home/config/nvim/plugins/treesitter.fnl | 43 +++++++++++++++++- home/programs/nvim/default.nix | 58 +++---------------------- 2 files changed, 48 insertions(+), 53 deletions(-) diff --git a/home/config/nvim/plugins/treesitter.fnl b/home/config/nvim/plugins/treesitter.fnl index bafc1c4..49c75a4 100644 --- a/home/config/nvim/plugins/treesitter.fnl +++ b/home/config/nvim/plugins/treesitter.fnl @@ -2,8 +2,47 @@ nifoc-treesitter (require :nifoc.treesitter) disable-parsers []] (nifoc-treesitter.setup) - (treesitter-config.setup {:ensure_installed [] - :sync_install true + (treesitter-config.setup {:parser_install_dir _G.nvim_treesitter_parser_directory + :ensure_installed [:angular + :bash + :css + :diff + :dockerfile + :eex + :elixir + :erlang + :fennel + :fish + :git_config + :git_rebase + :gitattributes + :gitcommit + :gitignore + :graphql + :heex + :html + :http + :java + :javascript + :jsdoc + :json + :lua + :make + :markdown + :markdown_inline + :nix + :python + :query + :regex + :ruby + :scss + :sql + :svelte + :toml + :tsx + :typescript + :vim] + :sync_install false :auto_install false :highlight {:enable true :disable disable-parsers} :indent {:enable true :disable disable-parsers} diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index f6c3e02..1f37500 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -51,58 +51,14 @@ in xcbuild ]; - extraLuaConfig = - let - treesitter-parsers = pkgs.symlinkJoin { - name = "treesitter-parsers"; - paths = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ - p.angular - p.bash - #p.comment # slow - p.css - p.diff - p.dockerfile - p.eex - p.elixir - p.erlang - p.fennel - p.fish - p.graphql - p.heex - p.html - p.http - p.java - p.javascript - p.jsdoc - p.json - p.kotlin - p.lua - p.make - p.markdown - p.markdown_inline - p.nix - p.python - p.query - p.regex - p.ruby - p.scss - p.sql - p.svelte - p.toml - p.tsx - p.typescript - p.vim - p.yaml - ])).dependencies; - }; - in - /* lua */ '' - vim.loader.enable() - vim.opt.runtimepath:prepend("${treesitter-parsers}") + extraLuaConfig = /* lua */ '' + vim.loader.enable() + _G.nvim_treesitter_parser_directory = os.getenv("HOME") .. "/.local/share/nvim/nvim-treesitter_parser" + vim.opt.runtimepath:prepend(_G.nvim_treesitter_parser_directory) - require('nifoc.nix') - require('configuration.init') - ''; + require('nifoc.nix') + require('configuration.init') + ''; plugins = let