60 lines
1.6 KiB
Lua
60 lines
1.6 KiB
Lua
vim.diagnostic.config({
|
|
virtual_text = true,
|
|
signs = true,
|
|
update_in_insert = false,
|
|
underline = true,
|
|
severity_sort = false,
|
|
float = true,
|
|
})
|
|
|
|
|
|
|
|
|
|
--"'''''''''''''''''''Tree sitter highlight''''''''''''''''''''''''''''''
|
|
require'nvim-treesitter.configs'.setup {
|
|
-- A list of parser names, or "all"
|
|
ensure_installed = { "c", "lua","bash","python"},
|
|
sync_install = false,
|
|
indent = {
|
|
enable = true,
|
|
disable = function(lang, bufnr)
|
|
local enabled_langs = { "html", "javascript", "tsx" } -- Enable auto indent only for these languages
|
|
return not vim.tbl_contains(enabled_langs, lang)
|
|
end,
|
|
},
|
|
auto_install = true,
|
|
highlight = {
|
|
enable = true,
|
|
additional_vim_regex_highlighting = false,
|
|
},
|
|
textobjects = {
|
|
select = {
|
|
enable = true,
|
|
lookahead = true,
|
|
keymaps = {
|
|
["af"] = "@function.outer",
|
|
["if"] = "@function.inner",
|
|
["ac"] = "@class.outer",
|
|
["ic"] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
|
["as"] = { query = "@local.scope", query_group = "locals", desc = "Select language scope" },
|
|
},
|
|
selection_modes = {
|
|
['@parameter.outer'] = 'v', -- charwise
|
|
['@function.outer'] = 'V', -- linewise
|
|
['@class.outer'] = '<c-v>', -- blockwise
|
|
},
|
|
include_surrounding_whitespace = true,
|
|
},
|
|
move = {
|
|
enable = true,
|
|
set_jumps = true,
|
|
goto_next_start = {
|
|
["<C-f>"] = "@function.outer", -- jump to next function
|
|
},
|
|
goto_previous_start = {
|
|
["<A-f>"] = "@function.outer", -- jump to previous function
|
|
},
|
|
},
|
|
},
|
|
}
|