comment out keymaps - do we need them?

This commit is contained in:
Andrzej Stepien 2024-03-12 16:13:45 +01:00
parent a2ee74b73a
commit aa78891b98
1 changed files with 46 additions and 46 deletions

View File

@ -17,49 +17,49 @@ map("n", "<leader>d", ":ToggleDiag<cr>") -- toggle all diagnostics
vim.api.nvim_create_autocmd('LspAttach', { -- vim.api.nvim_create_autocmd('LspAttach', {
desc = 'LSP actions', -- desc = 'LSP actions',
callback = function() -- callback = function()
local bufmap = function(mode, lhs, rhs) -- local bufmap = function(mode, lhs, rhs)
local opts = {buffer = true} -- local opts = {buffer = true}
vim.keymap.set(mode, lhs, rhs, opts) -- vim.keymap.set(mode, lhs, rhs, opts)
end -- end
--
-- Displays hover information about the symbol under the cursor -- -- Displays hover information about the symbol under the cursor
bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>') -- bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>')
--
-- Jump to the definition -- -- Jump to the definition
bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>') -- bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>')
--
-- Jump to declaration -- -- Jump to declaration
bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>') -- bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>')
--
-- Lists all the implementations for the symbol under the cursor -- -- Lists all the implementations for the symbol under the cursor
bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>') -- bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>')
--
-- Jumps to the definition of the type symbol -- -- Jumps to the definition of the type symbol
bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>') -- bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>')
--
-- Lists all the references -- -- Lists all the references
bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>') -- bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>')
--
-- Displays a function's signature information -- -- Displays a function's signature information
bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>') -- bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>')
--
-- Renames all references to the symbol under the cursor -- -- Renames all references to the symbol under the cursor
bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>') -- bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>')
--
-- Selects a code action available at the current cursor position -- -- Selects a code action available at the current cursor position
bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>') -- bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>')
--
-- Show diagnostics in a floating window -- -- Show diagnostics in a floating window
bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>') -- bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>')
--
-- Move to the previous diagnostic -- -- Move to the previous diagnostic
bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>') -- bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>')
--
-- Move to the next diagnostic -- -- Move to the next diagnostic
bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>') -- bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>')
end -- end
}) -- })
--