local whichkey = require("which-key") -- TODO fix based instructions local keymap = { t = 'Toggle Terminal', l = { name = '+lsp', e = { "lua vim.diagnostic.open_float()", 'Diagnostic Float' }, n = { "lua vim.diagnostic.goto_next()", 'Next Diagnostic' }, N = { "lua vim.diagnostic.goto_prev()", 'Previous Diagnostic' }, j = { "lua vim.diagnostic.setloclist()", 'Diagnostic List' }, --- Dynamic to each buffer potential TODO? D = { "lua vim.lsp.buf.declaration()", 'Declaration' }, d = { "lua vim.lsp.buf.definition()", 'Definition' }, k = { "lua vim.lsp.buf.hover()", 'Hover' }, i = { "lua vim.lsp.buf.implementation()", 'Implementation' }, t = { "lua vim.lsp.buf.type_definition()", 'Type Definition' }, R = { "lua vim.lsp.buf.rename()", 'Rename' }, a = { "lua vim.lsp.buf.code_action()", 'Code Action' }, r = { "lua vim.lsp.buf.references()", 'References' }, f = { function() vim.lsp.buf.format { async = true } end, 'Format' }, }, f = { name = '+find (telescope)', f = { "Telescope find_files", 'Find' }, o = { "Telescope oldfiles", 'Old Files' }, g = { "Telescope live_grep", 'Grep' }, h = { "Telescope help_tags", 'Help Tags' }, }, g = { name = '+git', g = { 'Telescope git_commits', 'Commits' }, b = { 'Telescope git_branches', 'Branches' }, s = { 'Telescope git_status', 'Status' }, }, T = { name = '+todo', j = { 'TodoLocList', 'List TODO:\'s in buffer' }, T = { 'TodoTelescope', 'Search TODO:\'s' }, n = {function() require("todo-comments").jump_next() end, 'Jump to next TODO:' }, N = {function() require("todo-comments").jump_prev() end, 'Jump to previous TODO:' }, }, w = { name = '+window', w = 'Pick Window', s = "Split window", v = "Split window vertically", q = "Quit a window", T = "Break out into a new tab", x = "Swap current with next", ["-"] = "Decrease height", ["+"] = "Increase height", [""] = "Decrease width", [">"] = "Increase width", ["|"] = "Max out the width", ["="] = "Equally high and wide", h = "Go to the left window", l = "Go to the right window", k = "Go to the up window", j = "Go to the down window", }, o = { name = '+org mode', }, m = { 'DarkLightSwitch', 'Toggle dark mode' } } -- Map window keys to leader w vim.cmd [[nmap w ]] whichkey.setup { hide_statusline = false, default_keymap_settings = { silent = true, noremap = true, }, default_mode = 'n', } whichkey.register(keymap, { prefix = '' })