feat(nvim): improve/add keybindings

nixos
Moritz Böhme 2023-04-10 15:14:04 +02:00
parent 5fc963c537
commit 2af3432410
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
4 changed files with 24 additions and 14 deletions

View File

@ -145,7 +145,6 @@ local on_attach_def = function(_, bufnr)
K = { "<cmd>Lspsaga hover_doc ++quiet<cr>", "show info" },
["<leader>"] = {
l = {
name = "lsp",
d = { "<cmd>Lspsaga show_cursor_diagnostics<cr>", "open diagnostic window" },
c = { "<cmd>Lspsaga code_action<cr>", "code action" },
r = { "<cmd>Lspsaga rename<cr>", "rename" },
@ -159,12 +158,10 @@ local on_attach_def = function(_, bufnr)
},
},
t = {
name = "toggle",
l = { lsp_lines.toggle, "lsp lines" },
},
},
g = {
name = "goto",
d = { "<cmd>Lspsaga peek_definition<cr>", "Goto definition" },
t = { "<cmd>Lspsaga peek_type_definition<cr>", "Goto type defininition" },
h = { "<cmd>Lspsaga lsp_finder<CR>", "Lsp finder" },

View File

@ -4,8 +4,6 @@ require("which-key").register({
name = "buffer",
b = { "<cmd>Telescope buffers<cr>", "List buffers" },
d = { "<cmd>bd<cr>", "Delete buffer" },
n = { "<cmd>bnext<cr>", "Next buffer" },
p = { "<cmd>bprevious<cr>", "Previous buffer" },
},
})
@ -19,6 +17,14 @@ require("which-key").register({
d = { "<C-w>c", "Delete window" },
},
}, { prefix = "<leader>" })
require("which-key").register({
["["] = {
b = { "<cmd>bprevious<cr>", "Previous buffer" },
},
["]"] = {
b = { "<cmd>bnext<cr>", "Next buffer" },
},
})
-- fast window move
require("which-key").register({
@ -49,10 +55,18 @@ require("which-key").register({
-- better descriptions for navigation
require("which-key").register({
["<leader>"] = {
f = { name = "file/find" },
g = { name = "git" },
l = { name = "lsp" },
o = { name = "org" },
s = { name = "search" },
t = { name = "toggle" },
x = { name = "diagnostics/quickfix" },
},
["["] = { name = "prev" },
["]"] = { name = "next" },
o = { name = "org" },
x = { name = "diagnostics/quickfix" },
g = { name = "goto" },
})
-- Clear search with <esc>

View File

@ -1,12 +1,10 @@
require("which-key").register({
f = {
name = "file/find",
f = { "<cmd>Telescope find_files<cr>", "Find files" },
b = { "<cmd>Telescope buffers<cr>", "Find buffers" },
r = { "<cmd>Telescope oldfiles<cr>", "Find recent files" },
},
s = {
name = "search",
l = { "<cmd>Telescope current_buffer_fuzzy_find<cr>", "Search lines" },
g = { "<cmd>Telescope live_grep<cr>", "Live grep" },
c = { "<cmd>Telescope command_history<cr>", "Command history" },
@ -17,4 +15,8 @@ require("which-key").register({
s = { "<cmd>Telescope lsp_document_symbols<cr>", "Symbols (Document)" },
S = { "<cmd>Telescope lsp_workspace_symbols<cr>", "Symbols (Workspace)" },
},
g = {
c = { "<cmd>Telescope git_commits<cr>", "Commits" },
s = { "<cmd>Telescope git_status<cr>", "Status" },
},
}, { prefix = "<leader>" })

View File

@ -1,7 +1,4 @@
require("telescope").load_extension("zoxide")
require("which-key").register({
f = {
name = "file/find",
z = { "<cmd>Telescope zoxide list<cr>", "Find location (Zoxide)" },
},
}, { prefix = "<leader>" })
z = { "<cmd>Telescope zoxide list<cr>", "Find location (Zoxide)" },
}, { prefix = "<leader>f" })