added nvim-treesitter-textobjects

This commit is contained in:
Oliver Hartmann 2022-02-04 09:10:20 +01:00
parent bec752c6b7
commit 4dd3918382
2 changed files with 29 additions and 1 deletions

View File

@ -112,7 +112,31 @@ require'nvim-treesitter.configs'.setup {
max_file_lines = nil, -- Do not enable for files with more than n lines, int
-- colors = {}, -- table of hex strings
-- termcolors = {} -- table of colour name strings
}
},
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",
},
},
lsp_interop = {
enable = true,
border = 'none',
peek_definition_code = {
["<leader>df"] = "@function.outer",
["<leader>dF"] = "@class.outer",
},
},
},
}
-------------------- LUASNIP -------------------------------
require("luasnip.loaders.from_vscode").load()

View File

@ -58,4 +58,8 @@ return require('packer').startup(function()
requires = "nvim-treesitter/nvim-treesitter"
}
use {'abecodes/tabout.nvim'}
use {
'nvim-treesitter/nvim-treesitter-textobjects',
requires = "nvim-treesitter/nvim-treesitter"
}
end)