Skip to content

Commit 6b30753

Browse files
nvim: better language parsing support / action upon it
1 parent bbdbe8e commit 6b30753

2 files changed

Lines changed: 36 additions & 8 deletions

File tree

.config/cvim/settings/nvim_lspconfig.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
-- src: https://github.com/neovim/nvim-lspconfig
2-
local function mapping_diagnostics()
2+
local function setup_keybinding_diagnostic()
33
-- Global mappings.
44
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
55
-- Show diagnostics in a floating window
6-
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
6+
--vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
7+
-- Show diagnostics in a bottom window
8+
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
79
-- Move to the previous diagnostic
810
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
911
-- Move to the next diagnostic
1012
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
11-
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
1213
end
1314

1415
-- src: https://github.com/neovim/nvim-lspconfig
@@ -241,7 +242,7 @@ local function config()
241242
{}
242243
)
243244

244-
mapping_diagnostics()
245+
setup_keybinding_diagnostic()
245246
setup_keybinding_when_lspserver_attach_to_buffer()
246247
end
247248

.config/cvim/settings/nvim_treesitter.lua

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,41 @@ local function config()
22
local configs = require("nvim-treesitter.configs")
33

44
configs.setup({
5-
ensure_installed = { "lua", "vim", "vimdoc" },
5+
ensure_installed = {
6+
"lua",
7+
"vim",
8+
"vimdoc",
9+
"typescript",
10+
"markdown",
11+
"markdown_inline",
12+
"python",
13+
"css",
14+
"html",
15+
"gitignore",
16+
"yaml",
17+
"latex"
18+
},
619
-- Install parsers synchronously (only applied to `ensure_installed`)
720
sync_install = false,
821
-- Automatically install missing parsers when entering buffer
9-
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
22+
-- Recommendation: set to false if you don't have `treesitter` CLI installed locally
1023
auto_install = true,
11-
highlight = { enable = true },
12-
indent = { enable = true },
24+
highlight = {
25+
enable = true,
26+
additional_vim_regex_highlighting = false,
27+
},
28+
indent = {
29+
enable = true
30+
},
31+
incremental_selection = {
32+
enable = true,
33+
keymaps = {
34+
init_selection = "<C-n>",
35+
node_incremental = "<C-n>",
36+
scope_incremental = "<C-s>",
37+
node_decremental = "<C-m>",
38+
}
39+
},
1340
})
1441
end
1542

0 commit comments

Comments
 (0)