From 08d5556ab2f104cc2daff59c078c12816b8c9acc Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Mon, 10 Apr 2023 10:18:01 +0200 Subject: feat(general): update keymaps --- lua/alpha/lsp/attach.lua | 20 +++++++------- lua/alpha/lsp/null-ls.lua | 6 ++-- lua/alpha/php/gateway.lua | 4 +-- lua/alpha/snips/ft/go.lua | 7 +---- lua/alpha/telescope/actions.lua | 13 +++++---- lua/alpha/telescope/init.lua | 6 ++-- lua/alpha/telescope/mappings.lua | 60 ++++++++++++++++++++++------------------ lua/alpha/utils.lua | 24 ++++++++-------- lua/config/keymaps.lua | 44 +++++++++++++++-------------- lua/plugins/color-picker.lua | 2 +- lua/plugins/comment.lua | 2 +- lua/plugins/dap.lua | 2 +- lua/plugins/database.lua | 2 +- lua/plugins/easy-align.lua | 2 +- lua/plugins/fugitive.lua | 8 +++--- lua/plugins/harpoon.lua | 13 ++++++--- lua/plugins/icon-picker.lua | 6 ++-- lua/plugins/laravel.lua | 4 +-- lua/plugins/neogen.lua | 2 +- lua/plugins/overseer.lua | 2 +- lua/plugins/refactoring.lua | 1 + lua/plugins/rest.lua | 18 +++++++++--- lua/plugins/smart-splits.lua | 4 +++ lua/plugins/smooth-cursor.lua | 2 +- lua/plugins/snippets.lua | 2 +- lua/plugins/spectre.lua | 2 +- lua/plugins/test.lua | 2 +- lua/plugins/todo-comments.lua | 2 ++ lua/plugins/trouble.lua | 2 +- lua/plugins/worktree.lua | 2 ++ 30 files changed, 147 insertions(+), 119 deletions(-) (limited to 'lua') diff --git a/lua/alpha/lsp/attach.lua b/lua/alpha/lsp/attach.lua index d9f32bf..45ce904 100644 --- a/lua/alpha/lsp/attach.lua +++ b/lua/alpha/lsp/attach.lua @@ -8,11 +8,11 @@ local filetype_attach = setmetatable({}, { return function(client, bufnr) local filetype = vim.api.nvim_buf_get_option(0, "filetype") -- keymaps for lsp - vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0 }) - vim.keymap.set("n", "vrn", vim.lsp.buf.rename, { buffer = 0 }) - vim.keymap.set("i", "", vim.lsp.buf.signature_help, { buffer = 0 }) - vim.keymap.set("n", "vo", ":LspRestart", { noremap = true }) - vim.keymap.set({ "n", "v" }, "vca", vim.lsp.buf.code_action, {}) + vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0, desc = "LSP Help information of symbol under the cursor" }) + vim.keymap.set("n", "vrn", vim.lsp.buf.rename, { buffer = 0, desc = "LSP Rename symbol under cursor" }) + vim.keymap.set("i", "", vim.lsp.buf.signature_help, { buffer = 0, desc = "LSP Signature help" }) + vim.keymap.set("n", "vo", ":LspRestart", { noremap = true, desc = "LSP Restart Server" }) + vim.keymap.set({ "n", "v" }, "vca", vim.lsp.buf.code_action, { buffer = 0, desc = "LSP Code actions" }) vim.keymap.set("n", "vf", function() return vim.lsp.buf.format { async = true, @@ -20,12 +20,12 @@ return function(client, bufnr) return cli.name ~= "lua_ls" end, } - end, {}) + end, { buffer = 0, desc = "LSP format file" }) - telescope_mapper("gr", "lsp_references", nil, true) - telescope_mapper("pv", "find_symbol", nil, true) - telescope_mapper("pd", "lsp_document_symbols", nil, true) - telescope_mapper("", "lsp_definitions", nil, true) + telescope_mapper("gr", "lsp_references", { buffer = true, desc = "LSP References of symbol on cursor" }) + telescope_mapper("pv", "find_symbol", { buffer = true, desc = "LSP find symbol on the project" }) + telescope_mapper("pd", "lsp_document_symbols", { buffer = true, desc = "LSP document symbols" }) + telescope_mapper("", "lsp_definitions", { buffer = true, desc = "LSP go to definition" }) vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" diff --git a/lua/alpha/lsp/null-ls.lua b/lua/alpha/lsp/null-ls.lua index 0a4443a..2c4c3bc 100644 --- a/lua/alpha/lsp/null-ls.lua +++ b/lua/alpha/lsp/null-ls.lua @@ -4,7 +4,7 @@ local php_actions = require "php-code-actions" null_ls.setup { sources = { - null_ls.builtins.code_actions.gitsigns, + -- null_ls.builtins.code_actions.gitsigns, null_ls.builtins.formatting.jq, null_ls.builtins.code_actions.refactoring, null_ls.builtins.formatting.alejandra, @@ -32,7 +32,7 @@ null_ls.setup { }, } -vim.keymap.set({ "n", "v" }, "vca", vim.lsp.buf.code_action, {}) +vim.keymap.set({ "n", "v" }, "vca", vim.lsp.buf.code_action, {desc = "LSP (null ls) Code actions"}) vim.keymap.set("n", "vf", function() return vim.lsp.buf.format { async = true } -end, {}) +end, {desc = "LSP (null ls) Format file"}) diff --git a/lua/alpha/php/gateway.lua b/lua/alpha/php/gateway.lua index 614c4f2..07fad33 100644 --- a/lua/alpha/php/gateway.lua +++ b/lua/alpha/php/gateway.lua @@ -49,7 +49,7 @@ end --- @param bufnr integer Buff id gateway.get_graphql_definitions = function(bufnr) - vim.treesitter.set_query( + vim.treesitter.query.set( "yaml", "GraphQL_endpoints", [[ @@ -69,7 +69,7 @@ gateway.get_graphql_definitions = function(bufnr) ]] ) - local query = vim.treesitter.get_query("yaml", "GraphQL_endpoints") + local query = vim.treesitter.query.get("yaml", "GraphQL_endpoints") local elements = {} diff --git a/lua/alpha/snips/ft/go.lua b/lua/alpha/snips/ft/go.lua index 637f57d..9c3977f 100644 --- a/lua/alpha/snips/ft/go.lua +++ b/lua/alpha/snips/ft/go.lua @@ -13,11 +13,6 @@ local ts_utils = require "nvim-treesitter.ts_utils" local get_node_text = vim.treesitter.get_node_text -if vim.fn.has "nvim-0.9.0" ~= 1 then - vim.treesitter.query.get = vim.treesitter.get_query - vim.treesitter.query.set = vim.treesitter.set_query -end - vim.treesitter.query.set( "go", "LuaSnip_Result", @@ -88,7 +83,7 @@ local function go_result_type(info) end end - local query = vim.treesitter.query.get_query("go", "LuaSnip_Result") + local query = vim.treesitter.query.get("go", "LuaSnip_Result") for _, node in query:iter_captures(function_node, 0) do if handlers[node:type()] then return handlers[node:type()](node, info) diff --git a/lua/alpha/telescope/actions.lua b/lua/alpha/telescope/actions.lua index c7cdaa8..b0e9f10 100644 --- a/lua/alpha/telescope/actions.lua +++ b/lua/alpha/telescope/actions.lua @@ -9,8 +9,9 @@ M.create_plugin = function(prompt_bufnr) vim.cmd(string.format("edit ~/.config/nvim/lua/plugins/%s.lua", new_plugin)) end + local get_disable_stm_node = function(bufnr, tree) - vim.treesitter.set_query( + vim.treesitter.query.set( "lua", "alpha_plugin_is_disabled", [[ @@ -27,7 +28,7 @@ local get_disable_stm_node = function(bufnr, tree) ]] ) - local query = vim.treesitter.get_query("lua", "alpha_plugin_is_disabled") + local query = vim.treesitter.query.get("lua", "alpha_plugin_is_disabled") for id, node in query:iter_captures(tree:root(), bufnr) do if query.captures[id] == "enabled" then @@ -39,7 +40,7 @@ local get_disable_stm_node = function(bufnr, tree) end local get_enabled_node = function(bufnr, tree) - vim.treesitter.set_query( + vim.treesitter.query.set( "lua", "alpha_plugin_has_enable_property", [[ @@ -55,7 +56,7 @@ local get_enabled_node = function(bufnr, tree) ]] ) - local query = vim.treesitter.get_query("lua", "alpha_plugin_has_enable_property") + local query = vim.treesitter.query.get("lua", "alpha_plugin_has_enable_property") for id, node in query:iter_captures(tree:root(), bufnr) do if query.captures[id] == "enabled" then @@ -67,7 +68,7 @@ local get_enabled_node = function(bufnr, tree) end local get_return_node = function(bufnr, tree) - vim.treesitter.set_query( + vim.treesitter.query.set( "lua", "alpha_plugin_return_table_constructor", [[ @@ -79,7 +80,7 @@ local get_return_node = function(bufnr, tree) ]] ) - local query = vim.treesitter.get_query("lua", "alpha_plugin_return_table_constructor") + local query = vim.treesitter.query.get("lua", "alpha_plugin_return_table_constructor") for id, node in query:iter_captures(tree:root(), bufnr) do if query.captures[id] == "table_constructor" then diff --git a/lua/alpha/telescope/init.lua b/lua/alpha/telescope/init.lua index 28397b0..70ef47f 100644 --- a/lua/alpha/telescope/init.lua +++ b/lua/alpha/telescope/init.lua @@ -84,7 +84,7 @@ function M.find_symbol() end function M.my_plugins() - if vim.fn.isdirectory "~/code/plugins/" == 0 then + if vim.fn.isdirectory(vim.fn.getenv "HOME" .. "/code/plugins/") == 0 then vim.notify("Directory ~/code/plugins does not exists", vim.log.levels.WARN, { title = "Telescope Mappings" }) return end @@ -98,11 +98,11 @@ function M.scratchs() prompt_title = "Scratchs", no_ignore = true, cwd = "~/.config/nvim/lua/scratchs/", - attach_mappings = function (_, map) + attach_mappings = function(_, map) map("i", "", my_actions.create_scratch_file) return true - end + end, } end diff --git a/lua/alpha/telescope/mappings.lua b/lua/alpha/telescope/mappings.lua index be59eaf..4843731 100644 --- a/lua/alpha/telescope/mappings.lua +++ b/lua/alpha/telescope/mappings.lua @@ -1,44 +1,50 @@ -TelescopeMapArgs = TelescopeMapArgs or {} - -local map_tele = function(key, f, options, buffer, mode) - mode = mode or "n" +local map_tele = function(key, f, opts) + local default = { + mode = "n", + options = {}, + buffer = nil, + desc = nil, + } + opts = opts or {} + opts = vim.tbl_deep_extend("force", default, opts or {}) local rhs = function() - R("alpha.telescope")[f](options or {}) + R("alpha.telescope")[f](opts.options) end local map_options = { remap = false, silent = true, } - if buffer then - map_options.buffer = buffer + if opts.buffer then + map_options.buffer = opts.buffer + end + if opts.desc then + map_options.desc = "Telescope: " .. opts.desc end - vim.keymap.set(mode, key, rhs, map_options) + vim.keymap.set(opts.mode, key, rhs, map_options) end -- not shure what this line does vim.api.nvim_set_keymap("c", "", "(TelescopeFuzzyCommandSearch)", { noremap = false, nowait = true }) -map_tele("pp", "project_files") -map_tele("gc", "branches") -map_tele("pw", "grep_word") -map_tele("ps", "grep_string") -map_tele("pf", "projectionist") -map_tele("rc", "search_config") -map_tele("rn", "find_nvim_config") -map_tele("rp", "find_nvim_plugin") -map_tele("rs", "scratchs") -map_tele("ph", "help_tags") -map_tele("pe", "buffers") -map_tele("pr", "treesitter") -map_tele("bb", "file_browser_relative") -map_tele("bp", "file_browser") -map_tele("gs", "git_status") -map_tele("ve", "diagnostics") -map_tele("fp", "my_plugins") -map_tele("po", "api_specs") -map_tele("pm", "gateway") +map_tele("pp", "project_files", { desc = "Open Project files" }) +map_tele("gc", "branches", { desc = "Git Branches selector" }) +map_tele("pw", "grep_word", { desc = "Grep word under cursor" }) +map_tele("ps", "grep_string", { desc = "Grep provided input string" }) +map_tele("rc", "search_config", { desc = "Search Files in .dotfiles directory" }) +map_tele("rn", "find_nvim_config", { desc = "Search Files in nvim config directory" }) +map_tele("rp", "find_nvim_plugin", { desc = "Search Neovim plugins" }) +map_tele("rs", "scratchs", { desc = "Search Neovim Scratchs files" }) +map_tele("ph", "help_tags", { desc = "Neovim Help" }) +map_tele("pe", "buffers", { desc = "Open buffers" }) +map_tele("pr", "treesitter", { desc = "Treesitter buffer elements" }) +map_tele("bb", "file_browser_relative", { desc = "Current directory" }) +map_tele("bp", "file_browser", { desc = "Project directory" }) +map_tele("gs", "git_status", { desc = "Git status" }) +map_tele("ve", "diagnostics", { desc = "Diagnostic of the buffer" }) +map_tele("po", "api_specs", { desc = "Openapi directory" }) +map_tele("pm", "gateway", { desc = "Graphql mutations and queries" }) return map_tele diff --git a/lua/alpha/utils.lua b/lua/alpha/utils.lua index b1202d6..ee80a1c 100644 --- a/lua/alpha/utils.lua +++ b/lua/alpha/utils.lua @@ -1,21 +1,21 @@ local M = {} M.save_and_exec = function() - local source_commands = { - lua = "luafi %", - vim = "source %", - } - - local ft = vim.api.nvim_buf_get_option(0, "filetype") - local command = source_commands[ft] - if command == nil then - vim.notify("This type cant not be sourced", vim.log.levels.ERROR, { title = "Alpha Developer" }) - return - end + -- local source_commands = { + -- lua = "luafi %", + -- vim = "source %", + -- } + -- + -- local ft = vim.api.nvim_buf_get_option(0, "filetype") + -- local command = source_commands[ft] + -- if command == nil then + -- vim.notify("This type cant not be sourced", vim.log.levels.ERROR, { title = "Alpha Developer" }) + -- return + -- end -- Save and source vim.api.nvim_command "silent w" - vim.api.nvim_command(command) + vim.api.nvim_command "so" local current_file_name = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t") vim.notify(string.format("File %s Sourced", current_file_name), vim.log.levels.INFO, { title = "Alpha Developer" }) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index ae03444..39831ed 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -4,36 +4,33 @@ map("v", "p", function() local val = vim.fn.getreg '"' vim.api.nvim_command [[normal! p]] vim.fn.setreg('"', val) -end) +end, { desc = "Special paste, paste without replacing copy register content" }) -map("n", "bd", ":bd!") +map("n", "bd", ":bd!", { desc = "Deletes the current buffer" }) -- lists navigation -map("n", "j", ":cnextzz") -map("n", "k", ":cprevzz") -map("n", "i", ":lnextzz") -map("n", "o", ":lprevzz") -map("n", "cc", ":cclose") - --- quick split -map("n", "wsv", ":vsp") +map("n", "", ":cnextzz", { desc = "Goes to the next item in the quickfixlist and center to the screen" }) +map("n", "", ":cprevzz", { desc = "Goes to the previous item in the quickfixlist and center to the screen" }) +-- map("n", "i", ":lnextzz") +-- map("n", "o", ":lprevzz") +map("n", "cc", ":cclose", { desc = "Close the quick fix list" }) -- tabulation -map("v", "<", "", ">gv") +map("v", "<", "", ">gv", { desc = "Indent in and keeps the selection" }) -- symbols to add undo points local symbols = { ",", ".", "!", "?", "$", ">", "<" } for _, symbol in pairs(symbols) do - map("i", symbol, symbol .. "u") + map("i", symbol, symbol .. "u", { desc = string.format("Add symbol %s to the undo list and writes it", symbol) }) end -- search result focus -map("n", "n", "nzzzv") -map("n", "N", "Nzzzv") +map("n", "n", "nzzzv", { desc = "Goes to next result on the search and put the cursor in the middle of the screen" }) +map("n", "N", "Nzzzv", { desc = "Goes to prev result on the search and put the cursor in the middle of the screen" }) -- join lines focus -map("n", "J", "mzJ`z") +map("n", "J", "mzJ`z", { desc = "Join lines and keep in the same place the cursor" }) -- Terminal map("t", "", "") @@ -43,10 +40,15 @@ map("t", "k", "k") map("t", "l", "l") -- quick env file edit -map("n", "ee", ":vsp .env") +map("n", "ee", ":vsp .env", { desc = "Open .env file in a vertical split" }) -- quick save and exec -map("n", "x", require("alpha.utils").save_and_exec) - -map("n", "vn", vim.diagnostic.goto_next, {}) -map("n", "vp", vim.diagnostic.goto_prev, {}) +map( + "n", + "x", + require("alpha.utils").save_and_exec, + { desc = "Save the current file and source it for .vim and .lua files" } +) + +map("n", "vn", vim.diagnostic.goto_next, { desc = "Goes to next diagnostic error" }) +map("n", "vp", vim.diagnostic.goto_prev, { desc = "Goes to prev diagnostic error" }) diff --git a/lua/plugins/color-picker.lua b/lua/plugins/color-picker.lua index 482103f..1e6c88b 100644 --- a/lua/plugins/color-picker.lua +++ b/lua/plugins/color-picker.lua @@ -1,7 +1,7 @@ return { "ziontee113/color-picker.nvim", keys = { - {"", "PickColorInsert", mode = "i"}, + { "", "PickColorInsert", mode = "i", desc = "ColorPicker" }, }, config = true, } diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 84de2ba..801223b 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -1,5 +1,5 @@ return { "numToStr/Comment.nvim", - keys = { { "gcc" }, { "gbc" }, { "gc", mode = "v" }, { "gb", mode = "v" } }, + keys = { { "gcc", desc = "Comment current line" }, { "gc", mode = "v", desc = "Comment selected text" } }, config = true, } diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index cdcdf85..a6582a6 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -9,7 +9,7 @@ return { "nvim-telescope/telescope-dap.nvim", "rcarriga/cmp-dap", }, - keys = { { "d" } }, + keys = { { "d", desc = "Open Debug menu" } }, config = function() require "alpha.dap" local ok_telescope, telescope = pcall(require, "telescope") diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua index c6ed7ea..5c0bddf 100644 --- a/lua/plugins/database.lua +++ b/lua/plugins/database.lua @@ -5,7 +5,7 @@ return { "kristijanhusak/vim-dadbod-completion", "tpope/vim-dotenv", }, - keys = { { "db", ":tab DBUI" } }, + keys = { { "db", ":tab DBUI", desc = "Open Database client" } }, init = function() require "alpha.database" end, diff --git a/lua/plugins/easy-align.lua b/lua/plugins/easy-align.lua index 6e14908..7d33478 100644 --- a/lua/plugins/easy-align.lua +++ b/lua/plugins/easy-align.lua @@ -1,4 +1,4 @@ return { "junegunn/vim-easy-align", - keys = { { "ga", "(EasyAlign)", mode = { "n", "v" } } }, + keys = { { "ga", "(EasyAlign)", mode = { "n", "v" }, desc = "EasyAlign" } }, } diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua index 10df419..4698d40 100644 --- a/lua/plugins/fugitive.lua +++ b/lua/plugins/fugitive.lua @@ -1,10 +1,10 @@ return { "tpope/vim-fugitive", keys = { - { "ga", ":Git fetch --all -p" }, - { "gl", ":Git pull" }, - { "gdh", ":diffget //2" }, - { "gdl", ":diffget //3" }, + { "ga", ":Git fetch --all -p", desc = "Git fetch" }, + { "gl", ":Git pull", desc = "Git pull" }, + { "gdh", ":diffget //2", desc = "Git diff grab from left" }, + { "gdl", ":diffget //3", desc = "Git diff grab from right" }, }, cmd = { "G", "Git" }, } diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 06ec2aa..a214924 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -7,6 +7,7 @@ table.insert(keys, { function() require("harpoon.ui").toggle_quick_menu() end, + desc = "Harpoon Menu", }) table.insert(keys, { @@ -14,15 +15,17 @@ table.insert(keys, { function() require("harpoon.mark").add_file() end, + desc = "Harpoon Add file", }) table.insert(keys, { "st", - function () - vim.api.nvim_command([[vsplit]]) + function() + vim.api.nvim_command [[vsplit]] require("harpoon.term").gotoTerminal(1) - vim.api.nvim_command([[startinsert]]) - end + vim.api.nvim_command [[startinsert]] + end, + desc = "Harpoon quick split Terminal", }) for i = 1, terms do @@ -31,6 +34,7 @@ for i = 1, terms do function() require("harpoon.term").gotoTerminal(i) end, + desc = "Harpoon go to terminal " .. i, }) end @@ -40,6 +44,7 @@ for i = 1, binds do function() require("harpoon.ui").nav_file(i) end, + desc = "Harpoon go to file " .. i, }) end diff --git a/lua/plugins/icon-picker.lua b/lua/plugins/icon-picker.lua index e9f1e94..a466b6a 100644 --- a/lua/plugins/icon-picker.lua +++ b/lua/plugins/icon-picker.lua @@ -1,9 +1,9 @@ return { "ziontee113/icon-picker.nvim", keys = { - { "i", "IconPickerNormal nerd_font", mode = "n" }, - { "y", "IconPickerYank nerd_font", mode = "n" }, - { "", "IconPickerInsert nerd_font", mode = "i" }, + { "i", "IconPickerNormal nerd_font", mode = "n", desc = "IconPicker NerdFont Insert" }, + { "y", "IconPickerYank nerd_font", mode = "n", desc = "IconPicker NerdFont Yank" }, + { "", "IconPickerInsert nerd_font", mode = "i", desc = "IconPicker NerdFont Insert mode" }, }, opts = { disable_legacy_commands = true }, } diff --git a/lua/plugins/laravel.lua b/lua/plugins/laravel.lua index b236e54..b87b12b 100644 --- a/lua/plugins/laravel.lua +++ b/lua/plugins/laravel.lua @@ -6,8 +6,8 @@ return { }, cmd = { "Sail", "Artisan", "Composer", "Npm", "Laravel" }, keys = { - { "la", ":Laravel artisan" }, - { "lr", ":Laravel routes" }, + { "la", ":Laravel artisan", desc = "Laravel Application Commands" }, + { "lr", ":Laravel routes", desc = "Laravel Application Routes" }, }, config = function() vim.g.laravel_log_level = "debug" diff --git a/lua/plugins/neogen.lua b/lua/plugins/neogen.lua index 9fd3c36..6b234ae 100644 --- a/lua/plugins/neogen.lua +++ b/lua/plugins/neogen.lua @@ -2,6 +2,6 @@ return { "danymat/neogen", dependencies = "nvim-treesitter/nvim-treesitter", cmd = { "Neogen" }, - keys = {{"n", ":Neogen"}}, + keys = { { "n", ":Neogen", desc = "Add comment to the near possible object" } }, opts = { snippet_engine = "luasnip" }, } diff --git a/lua/plugins/overseer.lua b/lua/plugins/overseer.lua index ab773ac..634de8b 100644 --- a/lua/plugins/overseer.lua +++ b/lua/plugins/overseer.lua @@ -1,5 +1,5 @@ return { "stevearc/overseer.nvim", - enabled = false, + enabled = false, config = true, } diff --git a/lua/plugins/refactoring.lua b/lua/plugins/refactoring.lua index 6c48610..92cdf64 100644 --- a/lua/plugins/refactoring.lua +++ b/lua/plugins/refactoring.lua @@ -11,6 +11,7 @@ return { require("telescope").extensions.refactoring.refactors() end, mode = { "n", "v" }, + desc = "Refactoring menu", }, }, config = function() diff --git a/lua/plugins/rest.lua b/lua/plugins/rest.lua index 2391d02..2eca102 100644 --- a/lua/plugins/rest.lua +++ b/lua/plugins/rest.lua @@ -32,11 +32,21 @@ return { pattern = "http", callback = function() local buff = tonumber(vim.fn.expand "", 10) - vim.keymap.set("n", "rn", rest_nvim.run, { noremap = true, buffer = buff }) - vim.keymap.set("n", "rl", rest_nvim.last, { noremap = true, buffer = buff }) - vim.keymap.set("n", "rp", function() + vim.keymap.set( + "n", + "hn", + rest_nvim.run, + { noremap = true, buffer = buff, desc = "Run near http request" } + ) + vim.keymap.set( + "n", + "hl", + rest_nvim.last, + { noremap = true, buffer = buff, desc = "Run last http resquest" } + ) + vim.keymap.set("n", "hp", function() rest_nvim.run(true) - end, { noremap = true, buffer = buff }) + end, { noremap = true, buffer = buff, desc = "Preview http curl" }) end, }) end, diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua index 49e1df3..57faedb 100644 --- a/lua/plugins/smart-splits.lua +++ b/lua/plugins/smart-splits.lua @@ -7,24 +7,28 @@ return { function() require("smart-splits").resize_left() end, + desc = "Resize window left +10", }, { "", function() require("smart-splits").resize_down() end, + desc = "Resize window down +10", }, { "", function() require("smart-splits").resize_up() end, + desc = "Resize window up +10", }, { "", function() require("smart-splits").resize_right() end, + desc = "Resize window right +10", }, }, } diff --git a/lua/plugins/smooth-cursor.lua b/lua/plugins/smooth-cursor.lua index d855e1c..58efc73 100644 --- a/lua/plugins/smooth-cursor.lua +++ b/lua/plugins/smooth-cursor.lua @@ -1,7 +1,7 @@ return { "gen740/SmoothCursor.nvim", config = function() - require("smoothcursor").setup({cursor = ""}) + require("smoothcursor").setup { cursor = "" } vim.api.nvim_set_hl(0, "SmoothCursor", { fg = "#8a9baa" }) diff --git a/lua/plugins/snippets.lua b/lua/plugins/snippets.lua index 9ed2edf..48c93b8 100644 --- a/lua/plugins/snippets.lua +++ b/lua/plugins/snippets.lua @@ -133,6 +133,6 @@ return { event = "VeryLazy", config = function() config() - vim.keymap.set("n", "s", config) + vim.keymap.set("n", "s", config, { desc = "Reload snippets" }) end, } diff --git a/lua/plugins/spectre.lua b/lua/plugins/spectre.lua index e11a328..7510c7a 100644 --- a/lua/plugins/spectre.lua +++ b/lua/plugins/spectre.lua @@ -1,5 +1,5 @@ return { "nvim-pack/nvim-spectre", - keys = {{"F", ":Spectre"}}, + keys = { { "F", ":Spectre", desc = "Spectre Search open" } }, config = true, } diff --git a/lua/plugins/test.lua b/lua/plugins/test.lua index e203679..aa9cba7 100644 --- a/lua/plugins/test.lua +++ b/lua/plugins/test.lua @@ -1,6 +1,6 @@ return { "vim-test/vim-test", - keys = { { "t" } }, + keys = { { "t", desc = "Open Test menu" } }, dependencies = { "anuvyklack/hydra.nvim", }, diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index 2e53f49..fef635e 100644 --- a/lua/plugins/todo-comments.lua +++ b/lua/plugins/todo-comments.lua @@ -12,12 +12,14 @@ return { function() require("todo-comments").jump_next() end, + desc = "Jump to next TODO", }, { "[t", function() require("todo-comments").jump_prev() end, + desc = "Jump to prev TODO", }, }, } diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index 5d53edb..81dcff9 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -1,6 +1,6 @@ return { "folke/trouble.nvim", dependencies = "kyazdani42/nvim-web-devicons", - keys = { { "t", "TroubleToggle" } }, + keys = { { "t", "TroubleToggle", desc = "Trouble toggle" } }, config = true, } diff --git a/lua/plugins/worktree.lua b/lua/plugins/worktree.lua index c3bfd8d..9e74a9c 100644 --- a/lua/plugins/worktree.lua +++ b/lua/plugins/worktree.lua @@ -6,12 +6,14 @@ return { function() require("telescope").extensions.git_worktree.git_worktrees() end, + desc = "Git Worktree switch", }, { "gn", function() require("telescope").extensions.git_worktree.create_git_worktree() end, + desc = "Git Worktree new branch", }, }, config = function() -- cgit v1.2.3