neovim: Add tree sitter
This commit is contained in:
parent
9bc8933f55
commit
fe2a821cfd
|
@ -95,7 +95,6 @@ in
|
||||||
vim-nix
|
vim-nix
|
||||||
vim-openscad
|
vim-openscad
|
||||||
vim-snippets
|
vim-snippets
|
||||||
vim-toml
|
|
||||||
vimtex
|
vimtex
|
||||||
which-key-nvim
|
which-key-nvim
|
||||||
];
|
];
|
||||||
|
@ -104,7 +103,29 @@ in
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"nvim/lua/init.lua".source = ./init.lua;
|
"nvim/lua/init.lua".source = ./init.lua;
|
||||||
"nvim/lua/snippets.lua".source = pkgs.callPackage ./snippets.nix { };
|
"nvim/lua/snippets.lua".source = pkgs.callPackage ./snippets.nix { };
|
||||||
};
|
} // (lib.mapAttrs'
|
||||||
|
(name: path: lib.nameValuePair "nvim/parser/${lib.removePrefix "tree-sitter-" name}.so" { source = "${path}/parser"; })
|
||||||
|
({
|
||||||
|
inherit (pkgs.tree-sitter.builtGrammars)
|
||||||
|
tree-sitter-bash
|
||||||
|
tree-sitter-c
|
||||||
|
tree-sitter-cpp
|
||||||
|
tree-sitter-css
|
||||||
|
tree-sitter-dot
|
||||||
|
tree-sitter-go
|
||||||
|
tree-sitter-haskell
|
||||||
|
tree-sitter-html
|
||||||
|
tree-sitter-json
|
||||||
|
#tree-sitter-latex # incompatible with VimTeX
|
||||||
|
tree-sitter-lua
|
||||||
|
tree-sitter-nix
|
||||||
|
tree-sitter-perl
|
||||||
|
tree-sitter-python
|
||||||
|
tree-sitter-rust
|
||||||
|
tree-sitter-scss
|
||||||
|
tree-sitter-toml
|
||||||
|
tree-sitter-yaml;
|
||||||
|
}));
|
||||||
|
|
||||||
home.sessionVariables.EDITOR = "nvim";
|
home.sessionVariables.EDITOR = "nvim";
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,6 +305,17 @@ lsp.rust_analyzer.setup {
|
||||||
|
|
||||||
require('trouble').setup {}
|
require('trouble').setup {}
|
||||||
|
|
||||||
|
-- Tree Sitter
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
-- VimTeX
|
-- VimTeX
|
||||||
g.tex_flavor = 'latex'
|
g.tex_flavor = 'latex'
|
||||||
g.vimtex_view_method = 'zathura'
|
g.vimtex_view_method = 'zathura'
|
||||||
|
|
Loading…
Reference in a new issue