From b62bd9efa0a85304a88dee9ea0134bb4892688e1 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 13 Dec 2022 11:17:53 -0500 Subject: [PATCH] small changes to default mappings --- init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/init.lua b/init.lua index b9c89ad..d085ade 100644 --- a/init.lua +++ b/init.lua @@ -304,8 +304,9 @@ local on_attach = function(_, bufnr) nmap('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') - nmap('gi', vim.lsp.buf.implementation, '[G]oto [I]mplementation') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation') + nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') @@ -315,7 +316,6 @@ local on_attach = function(_, bufnr) -- Lesser used LSP functionality nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('D', vim.lsp.buf.type_definition, 'Type [D]efinition') nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') nmap('wl', function() @@ -324,11 +324,7 @@ local on_attach = function(_, bufnr) -- Create a command `:Format` local to the LSP buffer vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - if vim.lsp.buf.format then - vim.lsp.buf.format() - elseif vim.lsp.buf.formatting then - vim.lsp.buf.formatting() - end + vim.lsp.buf.format() end, { desc = 'Format current buffer with LSP' }) end @@ -355,7 +351,7 @@ for _, lsp in ipairs(servers) do } end --- Turn on status information +-- Turn on lsp status information require('fidget').setup() -- Example custom configuration for lua