Skip to content

Commit 8e65d36

Browse files
committed
feat(neovim): add 'nvim-treesitter' plugin.
1 parent 99ec744 commit 8e65d36

File tree

2 files changed

+88
-0
lines changed

2 files changed

+88
-0
lines changed

module/neovim/default.nix

+4
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@
5050
source = config.lib.file.mkOutOfStoreSymlink "${unvX.directory.module}/neovim/lua/plugins/specs/lualine.lua";
5151
target = ".config/nvim/lua/plugins/specs/lualine.lua";
5252
};
53+
"neovim/lua/plugins/specs/nvim-treesitter.lua" = {
54+
source = config.lib.file.mkOutOfStoreSymlink "${unvX.directory.module}/neovim/lua/plugins/specs/nvim-treesitter.lua";
55+
target = ".config/nvim/lua/plugins/specs/nvim-treesitter.lua";
56+
};
5357
"neovim/lua/plugins/specs/nvim-tree.lua" = {
5458
source = config.lib.file.mkOutOfStoreSymlink "${unvX.directory.module}/neovim/lua/plugins/specs/nvim-tree.lua";
5559
target = ".config/nvim/lua/plugins/specs/nvim-tree.lua";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
return {
2+
"nvim-treesitter/nvim-treesitter",
3+
event = { "BufReadPre", "BufNewFile" },
4+
build = ":TSUpdate",
5+
dependencies = {
6+
"windwp/nvim-ts-autotag",
7+
},
8+
config = function()
9+
local treesitter = require("nvim-treesitter.configs")
10+
11+
-------------------------------------------------------------------------------
12+
-- Key bindings
13+
-------------------------------------------------------------------------------
14+
15+
local keymaps = {
16+
init_selection = "<C-space>",
17+
node_incremental = "<C-space>",
18+
scope_incremental = false,
19+
node_decremental = "<bs>",
20+
}
21+
22+
-------------------------------------------------------------------------------
23+
-- Options
24+
-------------------------------------------------------------------------------
25+
26+
treesitter.setup({
27+
highlight = {
28+
enable = true,
29+
},
30+
-- enable indentation
31+
indent = { enable = true },
32+
-- enable autotagging with nvim-ts-autotag plugin
33+
autotag = {
34+
enable = true,
35+
},
36+
-- ensure these language parsers are installed
37+
ensure_installed = {
38+
"angular",
39+
"bash",
40+
"c",
41+
"cmake",
42+
"comment",
43+
"css",
44+
"dart",
45+
"diff",
46+
"dockerfile",
47+
"git_config",
48+
"git_rebase",
49+
"gitattributes",
50+
"gitcommit",
51+
"gitignore",
52+
"go",
53+
"graphql",
54+
"html",
55+
"javascript",
56+
"json",
57+
"lua",
58+
"make",
59+
"markdown",
60+
"nix",
61+
"php",
62+
"query",
63+
"ruby",
64+
"scss",
65+
"sql",
66+
"svelte",
67+
"terraform",
68+
"tmux",
69+
"toml",
70+
"tsx",
71+
"typescript",
72+
"vim",
73+
"vimdoc",
74+
"vue",
75+
"xml",
76+
"yaml",
77+
},
78+
incremental_selection = {
79+
enable = true,
80+
keymaps = keymaps,
81+
},
82+
})
83+
end,
84+
}

0 commit comments

Comments
 (0)