Compare commits

...

3 commits

Author SHA1 Message Date
Bruno BELANYI 8e8126e282 home: vime: tree-sitter: remove 'which-key'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
The plug-in now has support for setting mapping descriptions by itself.
2024-07-19 11:32:10 +00:00
Bruno BELANYI 5519bbc49b home: vim: tree-sitter: move mappings from 'after' 2024-07-19 11:13:11 +00:00
Bruno BELANYI b107ee04f0 home: vim: telescope: move mappings from 'after' 2024-07-19 11:12:19 +00:00
4 changed files with 36 additions and 65 deletions

View file

@ -1,15 +0,0 @@
local wk = require("which-key")
local telescope_builtin = require("telescope.builtin")
local keys = {
f = {
name = "Fuzzy finder",
b = { telescope_builtin.buffers, "Open buffers" },
f = { telescope_builtin.git_files, "Git tracked files" },
F = { telescope_builtin.find_files, "Files" },
g = { telescope_builtin.live_grep, "Grep string" },
G = { telescope_builtin.grep_string, "Grep string under cursor" },
},
}
wk.register(keys, { prefix = "<leader>" })

View file

@ -1,30 +0,0 @@
local wk = require("which-key")
local motions = {
["]m"] = "Next method start",
["]M"] = "Next method end",
["]S"] = "Next statement start",
["]]"] = "Next class start",
["]["] = "Next class end",
["[m"] = "Previous method start",
["[M"] = "Previous method end",
["[S"] = "Previous statement start",
["[["] = "Previous class start",
["[]"] = "Previous class end",
}
local objects = {
["aa"] = "a parameter",
["ia"] = "inner parameter",
["ab"] = "a block",
["ib"] = "inner block",
["ac"] = "a class",
["ic"] = "inner class",
["af"] = "a function",
["if"] = "inner function",
["ak"] = "a comment",
["aS"] = "a statement",
}
wk.register(motions, { mode = "n" })
wk.register(objects, { mode = "o" })

View file

@ -1,4 +1,6 @@
local telescope = require("telescope") local telescope = require("telescope")
local telescope_builtin = require("telescope.builtin")
local wk = require("which-key")
telescope.setup({ telescope.setup({
defaults = { defaults = {
@ -22,3 +24,16 @@ telescope.setup({
telescope.load_extension("fzf") telescope.load_extension("fzf")
telescope.load_extension("lsp_handlers") telescope.load_extension("lsp_handlers")
local keys = {
f = {
name = "Fuzzy finder",
b = { telescope_builtin.buffers, "Open buffers" },
f = { telescope_builtin.git_files, "Git tracked files" },
F = { telescope_builtin.find_files, "Files" },
g = { telescope_builtin.live_grep, "Grep string" },
G = { telescope_builtin.grep_string, "Grep string under cursor" },
},
}
wk.register(keys, { prefix = "<leader>" })

View file

@ -1,4 +1,5 @@
local ts_config = require("nvim-treesitter.configs") local ts_config = require("nvim-treesitter.configs")
ts_config.setup({ ts_config.setup({
highlight = { highlight = {
enable = true, enable = true,
@ -14,16 +15,16 @@ ts_config.setup({
-- Jump to matching text objects -- Jump to matching text objects
lookahead = true, lookahead = true,
keymaps = { keymaps = {
["aa"] = "@parameter.outer", ["aa"] = { query = "@parameter.outer", desc = "a parameter" },
["ia"] = "@parameter.inner", ["ia"] = { query = "@parameter.inner", desc = "inner parameter" },
["ab"] = "@block.outer", ["ab"] = { query = "@block.outer", desc = "a block" },
["ib"] = "@block.inner", ["ib"] = { query = "@block.inner", desc = "inner block" },
["ac"] = "@class.outer", ["ac"] = { query = "@class.outer", desc = "a class" },
["ic"] = "@class.inner", ["ic"] = { query = "@class.inner", desc = "inner class" },
["af"] = "@function.outer", ["af"] = { query = "@function.outer", desc = "a function" },
["if"] = "@function.inner", ["if"] = { query = "@function.inner", desc = "inner function" },
["ak"] = "@comment.outer", ["ak"] = { query = "@comment.outer", desc = "a comment" },
["aS"] = "@statement.outer", ["aS"] = { query = "@statement.outer", desc = "a statement" },
}, },
}, },
move = { move = {
@ -31,22 +32,22 @@ ts_config.setup({
-- Add to jump list -- Add to jump list
set_jumps = true, set_jumps = true,
goto_next_start = { goto_next_start = {
["]m"] = "@function.outer", ["]m"] = { query = "@function.outer", desc = "Next method start" },
["]S"] = "@statement.outer", ["]S"] = { query = "@statement.outer", desc = "Next statement start" },
["]]"] = "@class.outer", ["]]"] = { query = "@class.outer", desc = "Next class start" },
}, },
goto_next_end = { goto_next_end = {
["]M"] = "@function.outer", ["]M"] = { query = "@function.outer", desc = "Next method end" },
["]["] = "@class.outer", ["]["] = { query = "@class.outer", desc = "Next class end" },
}, },
goto_previous_start = { goto_previous_start = {
["[m"] = "@function.outer", ["[m"] = { query = "@function.outer", desc = "Previous method start" },
["[S"] = "@statement.outer", ["[S"] = { query = "@statement.outer", desc = "Previous statement start" },
["[["] = "@class.outer", ["[["] = { query = "@class.outer", desc = "Previous class start" },
}, },
goto_previous_end = { goto_previous_end = {
["[M"] = "@function.outer", ["[M"] = { query = "@function.outer", desc = "Previous method end" },
["[]"] = "@class.outer", ["[]"] = { query = "@class.outer", desc = "Previous class end" },
}, },
}, },
}, },