nix/nvim: add treesitter configs
This commit is contained in:
parent
d1a8d82405
commit
5a504d3aa8
4 changed files with 72 additions and 0 deletions
16
nix/progs/nvim/config.lua
Normal file
16
nix/progs/nvim/config.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
-- TreeSitter
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
-- ensure_installed = { "nix", "typescript", "tsx" },
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
-- sync_install = false,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
|
@ -126,3 +126,29 @@ nnoremap <leader>sv :source $MYVIMRC<CR>
|
|||
cabbrev bsp belowright split
|
||||
cabbrev rvsp belowright vsplit
|
||||
|
||||
" TreeSitter
|
||||
lua << EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"nix",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"rust",
|
||||
"haskell",
|
||||
"json",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
EOF
|
||||
|
|
|
@ -39,6 +39,10 @@ let
|
|||
cocSettings = builtins.toJSON (import ./coc_settings.nix);
|
||||
|
||||
vimConfig = baseConfig + pluginsConfig + cocConfig;
|
||||
|
||||
# I get an error if I try copying lua script to lua folder
|
||||
# TODO: think about this solution
|
||||
luaConfig = builtins.readFile ./config.lua;
|
||||
in
|
||||
{
|
||||
options.progs.nvim = {
|
||||
|
|
|
@ -38,3 +38,29 @@ let g:gitgutter_map_keys = 0
|
|||
|
||||
nnoremap <leader>ghp :GitGutterPreviewHunk<CR>
|
||||
|
||||
" TreeSitter
|
||||
lua << EOF
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all"
|
||||
ensure_installed = {
|
||||
"nix",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"rust",
|
||||
"haskell",
|
||||
"json",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
EOF
|
||||
|
|
Loading…
Reference in a new issue