nix/nvim: add treesitter configs

This commit is contained in:
Dmitriy Pleshevskiy 2022-06-23 16:11:19 +03:00
parent d1a8d82405
commit 5a504d3aa8
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
4 changed files with 72 additions and 0 deletions

16
nix/progs/nvim/config.lua Normal file
View 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,
},
}

View file

@ -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

View file

@ -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 = {

View file

@ -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