local whichkey = require("whichkey_setup") -- lsp format vim.g.formatfix = function() vim.lsp.buf.format { async = true } end -- TODO fix based instructions local keymap = { t = 'Toggle Terminal', l = { name = '+lsp', e = { "vim.diagnostic.open_float", 'Diagnostic Float' }, n = { "vim.diagnostic.goto_next", 'Next Diagnostic' }, N = { "vim.diagnostic.goto_prev", 'Previous Diagnostic' }, j = { "vim.diagnostic.setloclist", 'Diagnostic List' }, --- Dynamic to each buffer potential TODO? D = { "vim.lsp.buf.declaration", 'Declaration' }, d = { "vim.lsp.buf.definition", 'Definition' }, k = { "vim.lsp.buf.hover", 'Hover' }, i = { "vim.lsp.buf.implementation", 'Implementation' }, t = { "vim.lsp.buf.type_definition", 'Type Definition' }, R = { "vim.lsp.buf.rename", 'Rename' }, a = { "vim.lsp.buf.code_action", 'Code Action' }, r = { "vim.lsp.buf.references", 'References' }, f = { "lua vim.g.formatfix()", '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' }, } } whichkey.config { hide_statusline = false, default_keymap_settings = { silent = true, noremap = true, }, default_mode = 'n', } whichkey.register_keymap('leader', keymap)