From d29da3cfd80e2579110b123feb030fd65d66e6bd Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Mon, 27 Mar 2023 20:52:26 +0200 Subject: [PATCH] nvim: Install tree-sitter parsers from nixpkgs; use custom plugin source --- home/programs/nvim/default.nix | 94 ++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/home/programs/nvim/default.nix b/home/programs/nvim/default.nix index d53a475..401b9e3 100644 --- a/home/programs/nvim/default.nix +++ b/home/programs/nvim/default.nix @@ -50,18 +50,56 @@ in yamllint ]; + extraLuaConfig = + let + treesitter-parsers = pkgs.symlinkJoin { + name = "treesitter-parsers"; + paths = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [ + p.bash + p.comment + p.css + p.dockerfile + p.elixir + p.erlang + p.fennel + p.fish + p.heex + p.html + p.http + p.java + p.javascript + p.jsdoc + p.json + p.lua + p.make + p.markdown + p.markdown-inline + p.nix + p.query + p.regex + p.ruby + p.scss + p.sql + p.svelte + p.toml + p.tsx + p.typescript + p.vim + p.yaml + ])).dependencies; + }; + in + '' + vim.opt.runtimepath:append("${treesitter-parsers}") + + require('nifoc.nix') + require('impatient') + require('configuration.init') + ''; + plugins = (with customPlugins; [ # Fixes - { - plugin = impatient-nvim; - config = '' - -- Nix init.lua workaround - require('nifoc.nix') - require('impatient') - require('configuration.init') - ''; - type = "lua"; - } + impatient-nvim # Utils popup-nvim @@ -107,41 +145,7 @@ in # Syntax { - plugin = nvim-treesitter.withPlugins ( - plugins: with plugins; [ - tree-sitter-bash - tree-sitter-comment - tree-sitter-css - tree-sitter-dockerfile - tree-sitter-elixir - tree-sitter-erlang - tree-sitter-fennel - tree-sitter-fish - tree-sitter-heex - tree-sitter-html - tree-sitter-http - tree-sitter-java - tree-sitter-javascript - tree-sitter-jsdoc - tree-sitter-json - tree-sitter-lua - tree-sitter-make - tree-sitter-markdown - tree-sitter-markdown-inline - tree-sitter-nix - tree-sitter-query - tree-sitter-regex - tree-sitter-ruby - tree-sitter-scss - tree-sitter-sql - tree-sitter-svelte - tree-sitter-toml - tree-sitter-tsx - tree-sitter-typescript - tree-sitter-vim - tree-sitter-yaml - ] - ); + plugin = nvim-treesitter; config = builtins.readFile ../../config/nvim/plugins/treesitter.fnl; type = "fennel"; }