From ce5c5e87bb35ff5f295ebde16e523f893dedd8ed Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 31 Mar 2024 21:30:35 -0400 Subject: [PATCH] nvim: clean up keybinds also Telescope now has dynamic workspace symbols --- src/.config/nvim/lua/coding.lua | 28 ++++++++++++++-------------- src/.config/nvim/lua/init.lua | 7 +++---- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/.config/nvim/lua/coding.lua b/src/.config/nvim/lua/coding.lua index d4a3efc..a72d0ac 100644 --- a/src/.config/nvim/lua/coding.lua +++ b/src/.config/nvim/lua/coding.lua @@ -94,20 +94,20 @@ local on_attach = function(client, bufnr) buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') local opts = { noremap=true, silent=true } - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'gK', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) - buf_set_keymap('n', 'gs', 'lua vim.lsp.buf.signature_help()', opts) - buf_set_keymap('n', 'gt', 'lua vim.lsp.buf.type_definition()', opts) - buf_set_keymap('n', 'rn', 'lua vim.lsp.buf.rename()', opts) - buf_set_keymap('n', 'ss', 'lua vim.lsp.buf.workspace_symbol()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) - buf_set_keymap('n', '[d', 'lua vim.lsp.diagnostic.goto_prev()', opts) - buf_set_keymap('n', ']d', 'lua vim.lsp.diagnostic.goto_next()', opts) - buf_set_keymap('n', 'ca', 'lua vim.lsp.buf.code_action()', opts) - buf_set_keymap('n', 'f', 'lua vim.lsp.buf.format()', opts) + keymap('gD', vim.lsp.buf.declaration, opts) + keymap('gd', vim.lsp.buf.definition, opts) + keymap('gK', vim.lsp.buf.hover, opts) + keymap('gi', vim.lsp.buf.implementation, opts) + keymap('gs', vim.lsp.buf.signature_help, opts) + keymap('gt', vim.lsp.buf.type_definition, opts) + keymap('rn', vim.lsp.buf.rename, opts) + keymap('ss', vim.lsp.buf.workspace_symbol, opts) + keymap('gr', vim.lsp.buf.references, opts) + keymap('e', vim.lsp.diagnostic.show_line_diagnostics, opts) + keymap('[d', vim.lsp.diagnostic.goto_prev, opts) + keymap(']d', vim.lsp.diagnostic.goto_next, opts) + keymap('ca', vim.lsp.buf.code_action, opts) + keymap('f', vim.lsp.buf.format, opts) end -- table declares LSPs to be set up diff --git a/src/.config/nvim/lua/init.lua b/src/.config/nvim/lua/init.lua index 37495b7..65a6884 100644 --- a/src/.config/nvim/lua/init.lua +++ b/src/.config/nvim/lua/init.lua @@ -23,22 +23,21 @@ require('dressing').setup({ insert_only = false, } }) - keymap("ef", "Telescope find_files") keymap("eg", "Telescope live_grep") keymap("em", "Telescope buffers") keymap("eh", "Telescope help_tags") -keymap("es", "Telescope lsp_document_symbols") +keymap("es", "Telescope lsp_dynamic_workspace_symbols") keymap("eb", "Telescope keymaps") -require("theme") - -------------------------------- -------------------------------- -- imports (see .config/nvim/lua/) -------------------------------- -------------------------------- +require("theme") + if dotprofile >= profile_table.DEFAULT then require("coding") require("debugging")