mirror of
https://github.com/prurigro/darkcloud-nvimconfig.git
synced 2024-11-21 11:22:34 -05:00
Improve treesitter keybindings and add bindings for parameters
This commit is contained in:
parent
747254e330
commit
5f5b492cfe
1 changed files with 18 additions and 12 deletions
|
@ -27,6 +27,8 @@ if (vim.g.enabletreesitter == 1) then
|
||||||
lookahead = true, -- Automatically jump forward to textobj
|
lookahead = true, -- Automatically jump forward to textobj
|
||||||
|
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
[ "ap" ] = { query = "@parameter.outer", desc = "Select outer part of a parameter region" },
|
||||||
|
[ "ip" ] = { query = "@parameter.inner", desc = "Select inner part of a parameter region" },
|
||||||
[ "ac" ] = { query = "@class.outer", desc = "Select outer part of a class region" },
|
[ "ac" ] = { query = "@class.outer", desc = "Select outer part of a class region" },
|
||||||
[ "ic" ] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
[ "ic" ] = { query = "@class.inner", desc = "Select inner part of a class region" },
|
||||||
[ "af" ] = { query = "@function.outer", desc = "Select outer part of a function region" },
|
[ "af" ] = { query = "@function.outer", desc = "Select outer part of a function region" },
|
||||||
|
@ -37,10 +39,10 @@ if (vim.g.enabletreesitter == 1) then
|
||||||
selection_modes = {
|
selection_modes = {
|
||||||
[ "@parameter.outer" ] = "v",
|
[ "@parameter.outer" ] = "v",
|
||||||
[ "@parameter.inner" ] = "v",
|
[ "@parameter.inner" ] = "v",
|
||||||
[ "@class.inner" ] = "V",
|
[ "@class.inner" ] = "v",
|
||||||
[ "@class.outer" ] = "V",
|
[ "@class.outer" ] = "v",
|
||||||
[ "@function.outer" ] = "V",
|
[ "@function.outer" ] = "v",
|
||||||
[ "@function.inner" ] = "V",
|
[ "@function.inner" ] = "v",
|
||||||
},
|
},
|
||||||
|
|
||||||
include_surrounding_whitespace = false,
|
include_surrounding_whitespace = false,
|
||||||
|
@ -51,23 +53,27 @@ if (vim.g.enabletreesitter == 1) then
|
||||||
set_jumps = true, -- whether to set jumps in the jumplist
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
|
|
||||||
goto_next_start = {
|
goto_next_start = {
|
||||||
|
[ "]p" ] = { query = "@parameter.outer", desc = "Next parameter start" },
|
||||||
[ "]c" ] = { query = "@class.outer", desc = "Next class start" },
|
[ "]c" ] = { query = "@class.outer", desc = "Next class start" },
|
||||||
[ "]f" ] = { query = "@function.outer", desc = "Next function start" },
|
[ "]f" ] = { query = "@function.outer", desc = "Next function start" },
|
||||||
},
|
},
|
||||||
|
|
||||||
goto_next_end = {
|
|
||||||
[ "]C" ] = { query = "@class.outer", desc = "Next class end" },
|
|
||||||
[ "]F" ] = { query = "@function.outer", desc = "Next function end" },
|
|
||||||
},
|
|
||||||
|
|
||||||
goto_previous_start = {
|
goto_previous_start = {
|
||||||
[ "[c" ] = { query = "@class.outer", desc = "Prevoius class start" },
|
[ "[p" ] = { query = "@parameter.outer", desc = "Previous parameter start" },
|
||||||
|
[ "[c" ] = { query = "@class.outer", desc = "Previous class start" },
|
||||||
[ "[f" ] = { query = "@function.outer", desc = "Previous function start" },
|
[ "[f" ] = { query = "@function.outer", desc = "Previous function start" },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
goto_next_end = {
|
||||||
|
[ "}P" ] = { query = "@parameter.outer", desc = "Next parameter end" },
|
||||||
|
[ "}C" ] = { query = "@class.outer", desc = "Next class end" },
|
||||||
|
[ "}F" ] = { query = "@function.outer", desc = "Next function end" },
|
||||||
|
},
|
||||||
|
|
||||||
goto_previous_end = {
|
goto_previous_end = {
|
||||||
[ "[C" ] = { query = "@class.outer", desc = "Previous class end" },
|
[ "{P" ] = { query = "@parameter.outer", desc = "Previous parameter end" },
|
||||||
[ "[F" ] = { query = "@function.outer", desc = "Previous function end" },
|
[ "{C" ] = { query = "@class.outer", desc = "Previous class end" },
|
||||||
|
[ "{F" ] = { query = "@function.outer", desc = "Previous function end" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue