local wk = require("which-key") local mappings = { f = { name = "Telescope", --optional group name b = { "Telescope buffers", "Find Buffer" }, f = { "Telescope find_files", "Find File" }, s = { "Telescope live_grep", "Live Grep" }, h = { "Telescope help_tags", "Find Help" }, r = { "Telescope oldfiles", "Open Recent File", noremap = false }, w = { "Telescope grep_string", "Find string under cursor" }, d = { "Telescope lsp_document_symbols", "Find LSP Symbols" }, -- does not work as of now: --i = { "AdvancedGitSearch", "Git Search" }, --n = { "New File" }, --just a label, don't create any mapping --e = "Edit File", --same as above }, t = { name = "tabs", n = { "tabnext", "Next Tab" }, p = { "tabprevious", "Previous Tab" }, f = { "tabfirst", "First Tab" }, l = { "tablast", "Last Tab" }, a = { "tabnew", "Add new Tab" }, c = { "tabclose", "Close Tab" }, m = { name = "Move Tab", f = { "tabmove 0", "Move Tab to First" }, l = { "tabmove $", "Move Tab to Last" }, i = { ":tabmove ", "Input position to move Tab to" }, } }, K = { "Show definition" }, u = { "Toggle undo-tree" }, i = { "Auto format file with linter(?), also on F3" }, r = { name = "Rename", r = { "Rename Variable" } }, l = { e = { "Open diagnostic float" } }, w = { name = "Workspaces + Whichkey", a = { "Add workspace folder" }, r = { "Remove workspace folder" }, w = { "WhichKey", "Show keybindings" }, }, s = { name = "Sessions", n = { "New Session" }, u = { "Update Session" }, d = { "Delete Session" }, l = { "Load Session" }, }, g = { name = "Gitsigns", b = { "Gitsigns blameline", "Show Blame Inline" }, B = { "Gitsigns blame", "Toggle Blame Sidebar" }, s = { name = "stage", h = { "Gitsigns stage_hunk", "Stage Hunk"}, b = { "Gitsigns stage_buffer", "Stage Buffer"}, }, h = { name = "hunks", l = { "Gitsigns setloclist", "List file Changes" }, n = { "Gitsigns nav_hunk", "Nav Hunk"}, }, r = { name = "reset", h = { "Gitsigns reset_hunk", "Reset Hunk"}, b = { "Gitsigns reset_buffer", "Reset Buffer"}, }, u = { "Gitsigns undo_stage_hunk", "Undo Stage Hunk"}, }, n = { "nohl", "Stop highlighting search results" }, } local opts = { mode = "n", prefix = '' } wk.register({ mappings, opts, prefix = "" }) local mappings_leaderless = { K = { "Show definition" }, g = { name = "lsp functions", d = { "go to definition" }, D = { "go to declaration" }, i = { "show implementations" }, r = { "list all references to symbol under cursor" }, }, ["["] = { name = "jump backward", d = "Previous Diagnostic", c = "Previous diff change", h = { "Gitsigns prev_hunk", "Previous changed git block" }, }, ["]"] = { name = "jump forward", d = "Next Diagnostic", c = "Next diff change", h = { "Gitsigns next_hunk", "Next changed git block" }, }, } wk.register({ mappings_leaderless, opts })