Skip to content

Commit 9a3a1e6

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

2 files changed

Lines changed: 19 additions & 6 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: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@ local function config()
66
-- Install parsers synchronously (only applied to `ensure_installed`)
77
sync_install = false,
88
-- Automatically install missing parsers when entering buffer
9-
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
9+
-- Recommendation: set to false if you don't have `treesitter` CLI installed locally
1010
auto_install = true,
11-
highlight = { enable = true },
11+
highlight = {
12+
enable = true,
13+
additional_vim_regex_highlighting = false,
14+
},
1215
indent = { enable = true },
16+
incremental_selection = {
17+
enable = true,
18+
keymaps = {
19+
init_selection = "<C-n>",
20+
node_incremental = "<C-n>",
21+
scope_incremental = "<C-s>",
22+
node_decremental = "<C-m>",
23+
}
24+
},
1325
})
1426
end
1527

0 commit comments

Comments
 (0)