nvim: nvim-treesitter-text-objects plugin added

This commit is contained in:
dogeystamp 2024-04-04 22:17:16 -04:00
parent 3946138b96
commit db835d9628
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 28 additions and 4 deletions

4
.gitmodules vendored
View File

@ -48,6 +48,10 @@
[submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter"]
path = src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter
url = https://github.com/nvim-treesitter/nvim-treesitter.git
# intelligent motions based on treesitter
[submodule "src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter-textobjects"]
path = src/.local/share/nvim/site/pack/3pp/start/nvim-treesitter-textobjects
url = https://github.com/nvim-treesitter/nvim-treesitter-textobjects
# error/warning/info box
# coding.lua

View File

@ -33,7 +33,7 @@ vim.api.nvim_create_autocmd(
-- plug: nvim-treesitter
------
require 'nvim-treesitter.configs'.setup {
ensure_installed = { "c", "cpp", "javascript", "typescript", "python", "vim", "fish", "bash" },
ensure_installed = { "c", "cpp", "javascript", "typescript", "python", "vim", "fish", "bash", "lua", "rust" },
sync_install = false,
auto_install = false,
highlight = {
@ -49,6 +49,25 @@ require 'nvim-treesitter.configs'.setup {
},
}
------
-- treesitter (language intelligent) motions
-- plug: nvim-treesitter-textobjects
------
require("nvim-treesitter.configs").setup {
textobjects = {
select = {
enable = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
}
}
}
------
-- diagnostics box
@ -56,8 +75,8 @@ require 'nvim-treesitter.configs'.setup {
------
require('trouble').setup({
icons = false,
fold_open = "v", -- icon used for open folds
fold_closed = ">", -- icon used for closed folds
fold_open = "v", -- icon used for open folds
fold_closed = ">", -- icon used for closed folds
indent_lines = false, -- add an indent guide below the fold icons
signs = {
-- icons / text used for a diagnostic
@ -140,7 +159,7 @@ local servers = {
},
diagnostics = {
-- get it to stop complaining about luasnip
globals = {'s', 'f', 't', "fmt", "c", "sn", "i", "rep", "d", "k", "events"},
globals = { 's', 'f', 't', "fmt", "c", "sn", "i", "rep", "d", "k", "events" },
},
}
}

@ -0,0 +1 @@
Subproject commit f5183cea0fda26126e22e789382c208e7b1120f4