update lsp
This commit is contained in:
parent
dc1ca46da0
commit
7a7f957854
2 changed files with 20 additions and 18 deletions
17
README.md
17
README.md
|
@ -29,10 +29,13 @@ nvim
|
|||
`<leader>gs` → Git status<br>
|
||||
`<leader>u` → Undo tree<br>
|
||||
|
||||
`<leader>mh` → LSP hover<br>
|
||||
`<leader>mr` → LSP rename<br>
|
||||
`<leader>ma` → LSP action<br>
|
||||
`<leader>mgd` → LSP go to definition<br>
|
||||
`<leader>mgD` → LSP go to declaration<br>
|
||||
`<leader>mgr` → LSP go to references<br>
|
||||
`<leader>mf` → LSP format<br>
|
||||
`K` → Hover<br>
|
||||
`gd` → Go to definition<br>
|
||||
`gD` → Go to declaration<br>
|
||||
`gi` → Go to implementation<br>
|
||||
`go` → Type definition<br>
|
||||
`gr` → Go to references<br>
|
||||
`gs` → Signature help<br>
|
||||
`<F2>` → Rename<br>
|
||||
`<F3>` → Format<br>
|
||||
`<F4>` → Code action<br>
|
||||
|
|
|
@ -11,17 +11,16 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||
|
||||
-- these will be buffer-local keybindings
|
||||
-- because they only work if you have an active language server
|
||||
|
||||
vim.keymap.set('n', '<leader>mh', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mgd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mgD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mgi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mgo', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mgr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mgs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>mr', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
|
||||
vim.keymap.set({'n', 'x'}, '<leader>mf', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
|
||||
vim.keymap.set('n', '<leader>ma', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
|
||||
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
|
||||
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
||||
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
|
||||
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
|
||||
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
|
||||
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
|
||||
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
|
||||
vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
|
||||
vim.keymap.set({'n', 'x'}, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
|
||||
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
|
||||
end
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue