Update lsp keymaps
This commit is contained in:
parent
75014599e7
commit
23e436273f
|
|
@ -42,5 +42,5 @@ vim.keymap.set('n', '<leader>cf', 'mF:%!eslint_d --stdin --fix-to-stdout --stdin
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>tg', '<cmd>Neogit<CR>', { silent = true, desc = 'Neogit' })
|
vim.keymap.set('n', '<leader>tg', '<cmd>Neogit<CR>', { silent = true, desc = 'Neogit' })
|
||||||
|
|
||||||
vim.keymap.set('n', 'grs', ':vsplit | lua vim.lsp.buf.definition()<CR>', { silent = true, desc = '[G]oto [D]efinition [V]ertical [S]plit' })
|
vim.keymap.set('n', '<leader>cs', ':vsplit | lua vim.lsp.buf.definition()<CR>', { silent = true, desc = '[G]oto [D]efinition [V]ertical [S]plit' })
|
||||||
vim.keymap.set('n', 'grS', ':split | lua vim.lsp.buf.definition()<CR>', { silent = true, desc = '[G]oto [D]efinition [H]orizontal [S]plit' })
|
vim.keymap.set('n', '<leader>cS', ':split | lua vim.lsp.buf.definition()<CR>', { silent = true, desc = '[G]oto [D]efinition [H]orizontal [S]plit' })
|
||||||
|
|
|
||||||
|
|
@ -75,27 +75,27 @@ return {
|
||||||
|
|
||||||
-- Rename the variable under your cursor.
|
-- Rename the variable under your cursor.
|
||||||
-- Most Language Servers support renaming across files, etc.
|
-- Most Language Servers support renaming across files, etc.
|
||||||
map('grn', vim.lsp.buf.rename, '[R]e[n]ame')
|
map('<leader>cn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
|
|
||||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||||
-- or a suggestion from your LSP for this to activate.
|
-- or a suggestion from your LSP for this to activate.
|
||||||
map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
map('<leader>ca', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||||
|
|
||||||
-- Find references for the word under your cursor.
|
-- Find references for the word under your cursor.
|
||||||
map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
map('<leader>cr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
|
|
||||||
-- Jump to the implementation of the word under your cursor.
|
-- Jump to the implementation of the word under your cursor.
|
||||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||||
map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
map('<leader>ci', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||||
|
|
||||||
-- Jump to the definition of the word under your cursor.
|
-- Jump to the definition of the word under your cursor.
|
||||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||||
-- To jump back, press <C-t>.
|
-- To jump back, press <C-t>.
|
||||||
map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
map('<leader>cd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
|
|
||||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||||
-- For example, in C this would take you to the header.
|
-- For example, in C this would take you to the header.
|
||||||
map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
map('<leader>cD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
|
||||||
-- Fuzzy find all the symbols in your current document.
|
-- Fuzzy find all the symbols in your current document.
|
||||||
-- Symbols are things like variables, functions, types, etc.
|
-- Symbols are things like variables, functions, types, etc.
|
||||||
|
|
@ -108,7 +108,7 @@ return {
|
||||||
-- Jump to the type of the word under your cursor.
|
-- Jump to the type of the word under your cursor.
|
||||||
-- Useful when you're not sure what type a variable is and you want to see
|
-- Useful when you're not sure what type a variable is and you want to see
|
||||||
-- the definition of its *type*, not where it was *defined*.
|
-- the definition of its *type*, not where it was *defined*.
|
||||||
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
map('<leader>ct', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||||
|
|
||||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||||
---@param client vim.lsp.Client
|
---@param client vim.lsp.Client
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue