mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
Re-arrange neovim config
This commit is contained in:
75
nvim/m-housh/lua/user/plugin-config/treesitter.lua
Normal file
75
nvim/m-housh/lua/user/plugin-config/treesitter.lua
Normal file
@@ -0,0 +1,75 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
},
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"go",
|
||||
"hcl",
|
||||
"html",
|
||||
"java",
|
||||
"javascript",
|
||||
"json",
|
||||
"latex",
|
||||
"ledger",
|
||||
"llvm",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"python",
|
||||
"swift",
|
||||
"toml",
|
||||
"xml",
|
||||
"yaml"
|
||||
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = {} -- list of language that will be disabled
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
scope_incremental = "<CR>",
|
||||
node_incremental = "<TAB>",
|
||||
node_decremental = "<S-TAB>"
|
||||
}
|
||||
},
|
||||
indent = {enable = true},
|
||||
autopairs = {{enable = true}},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ir"] = "@parameter.inner",
|
||||
["ar"] = "@parameter.outer"
|
||||
}
|
||||
}
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
||||
max_file_lines = 2000 -- Do not enable for files with more than specified lines
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user