Compare commits
No commits in common. "8e8126e282145cc0a50375915a7e33a48719dbd2" and "b1e484474f0c72220f0fe3e9421649501f66c611" have entirely different histories.
8e8126e282
...
b1e484474f
15
modules/home/vim/after/plugin/mappings/telescope.lua
Normal file
15
modules/home/vim/after/plugin/mappings/telescope.lua
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
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>" })
|
|
@ -0,0 +1,30 @@
|
||||||
|
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" })
|
|
@ -1,6 +1,4 @@
|
||||||
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 = {
|
||||||
|
@ -24,16 +22,3 @@ 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>" })
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
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,
|
||||||
|
@ -15,16 +14,16 @@ ts_config.setup({
|
||||||
-- Jump to matching text objects
|
-- Jump to matching text objects
|
||||||
lookahead = true,
|
lookahead = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
["aa"] = { query = "@parameter.outer", desc = "a parameter" },
|
["aa"] = "@parameter.outer",
|
||||||
["ia"] = { query = "@parameter.inner", desc = "inner parameter" },
|
["ia"] = "@parameter.inner",
|
||||||
["ab"] = { query = "@block.outer", desc = "a block" },
|
["ab"] = "@block.outer",
|
||||||
["ib"] = { query = "@block.inner", desc = "inner block" },
|
["ib"] = "@block.inner",
|
||||||
["ac"] = { query = "@class.outer", desc = "a class" },
|
["ac"] = "@class.outer",
|
||||||
["ic"] = { query = "@class.inner", desc = "inner class" },
|
["ic"] = "@class.inner",
|
||||||
["af"] = { query = "@function.outer", desc = "a function" },
|
["af"] = "@function.outer",
|
||||||
["if"] = { query = "@function.inner", desc = "inner function" },
|
["if"] = "@function.inner",
|
||||||
["ak"] = { query = "@comment.outer", desc = "a comment" },
|
["ak"] = "@comment.outer",
|
||||||
["aS"] = { query = "@statement.outer", desc = "a statement" },
|
["aS"] = "@statement.outer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
move = {
|
move = {
|
||||||
|
@ -32,22 +31,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"] = { query = "@function.outer", desc = "Next method start" },
|
["]m"] = "@function.outer",
|
||||||
["]S"] = { query = "@statement.outer", desc = "Next statement start" },
|
["]S"] = "@statement.outer",
|
||||||
["]]"] = { query = "@class.outer", desc = "Next class start" },
|
["]]"] = "@class.outer",
|
||||||
},
|
},
|
||||||
goto_next_end = {
|
goto_next_end = {
|
||||||
["]M"] = { query = "@function.outer", desc = "Next method end" },
|
["]M"] = "@function.outer",
|
||||||
["]["] = { query = "@class.outer", desc = "Next class end" },
|
["]["] = "@class.outer",
|
||||||
},
|
},
|
||||||
goto_previous_start = {
|
goto_previous_start = {
|
||||||
["[m"] = { query = "@function.outer", desc = "Previous method start" },
|
["[m"] = "@function.outer",
|
||||||
["[S"] = { query = "@statement.outer", desc = "Previous statement start" },
|
["[S"] = "@statement.outer",
|
||||||
["[["] = { query = "@class.outer", desc = "Previous class start" },
|
["[["] = "@class.outer",
|
||||||
},
|
},
|
||||||
goto_previous_end = {
|
goto_previous_end = {
|
||||||
["[M"] = { query = "@function.outer", desc = "Previous method end" },
|
["[M"] = "@function.outer",
|
||||||
["[]"] = { query = "@class.outer", desc = "Previous class end" },
|
["[]"] = "@class.outer",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue