-- disable v -- local presets = require("which-key.plugins.presets") -- presets.operators["v"] = nil require("which-key").setup({ plugins = { marks = true, -- shows a list of your marks on ' and ` registers = true, -- shows your registers on " in NORMAL or in INSERT mode spelling = { enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions suggestions = 20, -- how many suggestions should be shown in the list? }, -- the presets plugin, adds help for a bunch of default keybindings in Neovim -- No actual key bindings are created presets = { operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion motions = true, -- adds help for motions text_objects = true, -- help for text objects triggered after entering an operator windows = true, -- default bindings on nav = true, -- misc bindings to work with windows z = true, -- bindings for folds, spelling and others prefixed with z g = true, -- bindings for prefixed with g }, }, -- add operators that will trigger motion and text object completion -- to enable all native operators, set the preset / operators plugin above operators = { gc = "Comments" }, key_labels = { -- override the label used to display some keys. It doesn't effect WK in any other way. -- For example: -- [""] = "SPC", -- [""] = "RET", -- [""] = "TAB", }, icons = { breadcrumb = "»", -- symbol used in the command line area that shows your active key combo separator = "➜", -- symbol used between a key and it's label group = "+", -- symbol prepended to a group }, window = { border = "single", -- none, single, double, shadow position = "bottom", -- bottom, top margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left] }, layout = { height = { min = 4, max = 25 }, -- min and max height of the columns width = { min = 20, max = 50 }, -- min and max width of the columns spacing = 2, -- spacing between columns align = "center", -- align columns left, center or right }, ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label hidden = { "", "", "", "", "", "call", "lua", "require", "^:", "^ ", }, -- hide mapping boilerplate show_help = false, -- show help message on the command line when the popup is visible triggers = "auto", -- automatically setup triggers -- triggers = {""} -- or specify a list manually triggers_blacklist = { -- list of mode / prefixes that should never be hooked by WhichKey -- this is mostly relevant for key maps that start with a native binding -- most people should not need to change this i = { "j", "k" }, v = { "j", "k" }, }, }) local wk = require("which-key") local default_options = { silent = true } -- register non leader based mappings wk.register({ ga = { "(EasyAlign)", "Align", mode = "x" }, sa = "Add surrounding", sd = "Delete surrounding", sh = "Highlight surrounding", sn = "Surround update n lines", sr = "Replace surrounding", sF = "Find left surrounding", sf = "Replace right surrounding", ss = { "Lightspeed_s", "Search 2-character forward" }, -- SS = {"Lightspeed_S", "Search 2-character backward"} st = { "lua require('tsht').nodes()", "TS hint textobject" }, }) -- Register all leader based mappings wk.register({ [""] = { "e#", "Prev buffer" }, [""] = { name = "Leader", a = { "lua print('fasfAS')", "test" }, }, b = { name = "Buffers", b = { "Telescope buffers", "Find buffer", }, a = { "BufferLineCloseLeftBufferLineCloseRight", "Close all but the current buffer", }, d = { "Bdelete!", "Close buffer" }, f = { "BufferLinePick", "Pick buffer" }, l = { "BufferLineCloseLeft", "Close all buffers to the left" }, p = { "BufferLineMovePrev", "Move buffer prev" }, n = { "BufferLineMoveNext", "Move buffer next" }, r = { "BufferLineCloseRight", "Close all BufferLines to the right", }, x = { "BufferLineSortByDirectory", "Sort BufferLines automatically by directory", }, L = { "BufferLineSortByExtension", "Sort BufferLines automatically by extension", }, }, f = { name = "Files", b = { "Telescope file_browser", "File browser" }, f = { "lua require'telescope.builtin'.find_files()", "Find File", }, l = { "Lf", "Open LF" }, p = { "NvimTreeToggle", "Toggle Tree" }, r = { "Telescope oldfiles", "Open Recent File" }, s = { "w", "Save Buffer" }, T = { "NvimTreeFindFile", "Find in Tree" }, z = { "Telescope zoxide list", "Zoxide" }, }, g = { name = "Git", j = { "lua require 'gitsigns'.next_hunk()", "Next Hunk" }, k = { "lua require 'gitsigns'.prev_hunk()", "Prev Hunk" }, l = { "Telescope git_commits", "Log" }, p = { "lua require 'gitsigns'.preview_hunk()", "Preview Hunk" }, r = { "lua require 'gitsigns'.reset_hunk()", "Reset Hunk" }, R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, S = { "lua require 'gitsigns'.stage_buffer()", "Stage Buffer" }, t = "Open Gitui", -- command in toggleterm.lua n = { "Neogit", "Open Neogit" }, u = { "lua require 'gitsigns'.undo_stage_hunk()", "Undo Stage Hunk", }, g = { "Telescope git_status", "Open changed file" }, b = { "Telescope git_branches", "Checkout branch" }, B = { "GitBlameToggle", "Toggle Blame" }, c = { "Telescope git_commits", "Checkout commit" }, C = { "Telescope git_bcommits", "Checkout commit(current file)", }, }, h = { name = "Harpoon", a = { "lua require('harpoon.mark').add_file()", "Add file" }, u = { "lua require('harpoon.ui').toggle_quick_menu()", "Open Menu", }, ["1"] = { "lua require('harpoon.ui').nav_file(1)", "Open File 1", }, ["2"] = { "lua require('harpoon.ui').nav_file(1)", "Open File 2", }, ["3"] = { "lua require('harpoon.ui').nav_file(1)", "Open File 3", }, ["4"] = { "lua require('harpoon.ui').nav_file(1)", "Open File 4", }, }, m = { name = "Misc", a = { "lua require'telegraph'.telegraph({cmd='gitui', how='tmux_popup'})", "Test Telegraph", }, d = { "lua require('functions').toggle_diagnostics()", "Toggle Diagnostics" }, l = { "source ~/.config/nvim/snippets/*", "Reload snippets" }, p = { "PackerSync", "PackerSync" }, s = { "SymbolsOutline", "Toggle SymbolsOutline" }, t = { "FloatermNew --autoclose=2", "New Floaterm" }, z = { "ZenMode", "Toggle ZenMode" }, }, q = { name = "Quickfix", j = { "cnext", "Next Quickfix Item" }, k = { "cprevious", "Previous Quickfix Item" }, q = { "lua require('functions').toggle_qf()", "Toggle quickfix list" }, t = { "TodoQuickFix", "Show TODOs" }, }, s = { name = "Search", C = { "CheatSH", "Cht.sh" }, h = { "Telescope help_tags", "Find Help" }, H = { "Telescope heading", "Find Header" }, M = { "Telescope man_pages", "Man Pages" }, R = { "Telescope registers", "Registers" }, t = { "Telescope live_grep", "Text" }, s = { "Telescope grep_string", "Text under cursor" }, S = { "Telescope symbols", "Search symbols" }, k = { "Telescope keymaps", "Keymaps" }, c = { "Telescope commands", "Commands" }, p = { "Telescope projects", "Projects" }, P = { "Telescope builtin", "Builtin pickers" }, z = { "Telescope packer", "Plugins" }, }, w = { name = "Window", p = { "x", "Swap" }, q = { ":q", "Close" }, s = { ":split", "Horizontal Split" }, t = { "t", "Move to new tab" }, ["="] = { "=", "Equally size" }, v = { ":vsplit", "Verstical Split" }, w = { "lua require('nvim-window').pick()", "Choose window to jump", }, }, x = { name = "LanguageTool", c = { "GrammarousCheck", "Grammar check" }, i = { "(grammarous-open-info-window)", "Open the info window" }, r = { "(grammarous-reset)", "Reset the current check" }, f = { "(grammarous-fixit)", "Fix the error under the cursor" }, x = { "(grammarous-close-info-window)", "Close the information window", }, e = { "(grammarous-remove-error)", "Remove the error under the cursor", }, n = { "(grammarous-move-to-next-error)", "Move cursor to the next error", }, p = { "(grammarous-move-to-previous-error)", "Move cursor to the previous error", }, d = { "(grammarous-disable-rule)", "Disable the grammar rule under the cursor", }, }, z = { name = "Spelling", n = { "]s", "Next" }, p = { "[s", "Previous" }, a = { "zg", "Add word" }, f = { "1z=", "Use 1. correction" }, l = { "Telescope spell_suggest", "List corrections" }, }, }, { prefix = "", mode = "n", default_options })