Add lots of languagu parsers, add textobjects, and add incremental selection
This commit is contained in:
parent
d1b9cfa362
commit
c09b607b8d
3 changed files with 52 additions and 17 deletions
|
|
@ -2,7 +2,7 @@ return {
|
|||
"LarssonMartin1998/lspsaga.nvim",
|
||||
branch = "improved_winbar",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
|
|
|
|||
|
|
@ -1,18 +1,56 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"lua"
|
||||
"bash",
|
||||
"lua",
|
||||
"c",
|
||||
"cpp",
|
||||
"rust",
|
||||
"cmake",
|
||||
"make",
|
||||
"yaml",
|
||||
"ninja",
|
||||
"gitignore",
|
||||
},
|
||||
sync_install = false,
|
||||
-- This can be updated to a list of languages instead of defaulting to true
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-cr>",
|
||||
node_incremental = "<C-cr>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<C-bs>",
|
||||
},
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-context"
|
||||
}
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
["ic"] = { query = "@class.inner" },
|
||||
["ac"] = { query = "@class.outer" },
|
||||
["ii"] = { query = "@conditional.inner" },
|
||||
["ai"] = { query = "@conditional.outer" },
|
||||
["if"] = { query = "@function.inner" },
|
||||
["af"] = { query = "@function.outer" },
|
||||
["il"] = { query = "@loop.inner" },
|
||||
["al"] = { query = "@loop.outer" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter-context"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue