From 5b2d3652ba1519baeda75070924aba0fc6fc45a0 Mon Sep 17 00:00:00 2001 From: Lucas Barbieri Date: Wed, 2 Aug 2023 15:18:04 -0300 Subject: [PATCH] add some descriptions for keybindings --- lua/jabuxas/remap.lua | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/lua/jabuxas/remap.lua b/lua/jabuxas/remap.lua index 8b0e1e9..cdefd62 100644 --- a/lua/jabuxas/remap.lua +++ b/lua/jabuxas/remap.lua @@ -1,7 +1,7 @@ local keymap = vim.keymap -keymap.set("n", "pv", vim.cmd.Ex) -keymap.set("n", "sf", vim.cmd.Ex) +keymap.set("n", "pv", vim.cmd.Ex, { desc = "Start netrw" }) +keymap.set("n", "sf", vim.cmd.Ex, { desc = "Start netrw" }) keymap.set("v", "J", ":m '>+1gv=gv") keymap.set("v", "K", ":m '<-2gv=gv") @@ -13,42 +13,36 @@ keymap.set("n", "n", "nzzzv") keymap.set("n", "N", "Nzzzv") keymap.set("x", "p", [["_dP]]) -keymap.set({ "n", "v" }, "yy", [["+y]]) +keymap.set({ "n", "v" }, "yy", [["+y]], { desc = "copy to clipboard" }) keymap.set("n", "Y", [["+Y]]) -keymap.set({ "n", "v" }, "dd", [["_d]]) +keymap.set({ "n", "v" }, "dd", [["_d]], { desc = "delete" }) keymap.set("i", "", "") keymap.set("n", "Q", "") keymap.set("n", "", "silent !tmux neww tmux-sessionizer") -keymap.set("n", "f", vim.lsp.buf.format) +keymap.set("n", "f", vim.lsp.buf.format, { desc = "format current buffer" }) keymap.set("n", "", "cnextzz") keymap.set("n", "", "cprevzz") keymap.set("n", "k", "lnextzz") keymap.set("n", "j", "lprevzz") -keymap.set("n", "rr", [[:%s/\<\>//gI]]) -keymap.set("n", "x", "!chmod +x %", { silent = true }) +keymap.set("n", "rr", [[:%s/\<\>//gI]], { desc = "replace current word" }) +keymap.set("n", "x", "!chmod +x %", { silent = true, desc = "chmod +x current file" }) -keymap.set("t", "", [[]]) +keymap.set("t", "", [[]], { desc = "exit insert mode on builtin terminal" }) -keymap.set("n", "Sv", "v") -keymap.set("n", "Sh", "s") -keymap.set("n", "Se", "=") -keymap.set("n", "Sx", ":close") -keymap.set("n", "S=", "+") -keymap.set("n", "S-", "-") +keymap.set("n", "Sv", "v", { desc = "create split vertically" }) +keymap.set("n", "Sh", "s", { desc = "create split horizontally" }) +keymap.set("n", "Se", "=", { desc = "even out buffers" }) +keymap.set("n", "Sx", ":close", { desc = "close current split" }) --- keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateLeft) --- keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateDown) --- keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateUp) --- keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateRight) --- keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateLastActive) --- keymap.set("n", "", nvim_tmux_nav.NvimTmuxNavigateNext) -keymap.set("n", "sm", "lua require('maximize').toggle()") +keymap.set("n", "sm", "lua require('maximize').toggle()", { desc = "maximize current buffer" }) -keymap.set("n", "+", "") -keymap.set("n", "-", "") +keymap.set("n", "+", "", { desc = "increment number on cursor" }) +keymap.set("n", "-", "", { desc = "decrease number on cursor" }) + +-- move splits around keymap.set("n", "", "<") keymap.set("n", "", ">") keymap.set("n", "", "+")