mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-28 22:08:12 +02:00
more refactor
This commit is contained in:
parent
339aa8756e
commit
78dd92b616
2 changed files with 30 additions and 24 deletions
29
lua/lsp/keybinds.lua
Normal file
29
lua/lsp/keybinds.lua
Normal file
|
@ -0,0 +1,29 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
function M.setup_default_bindings()
|
||||
if lvim.lsp.default_keybinds then
|
||||
vim.cmd "nnoremap <silent> gd <cmd>lua vim.lsp.buf.definition()<CR>"
|
||||
vim.cmd "nnoremap <silent> gD <cmd>lua vim.lsp.buf.declaration()<CR>"
|
||||
vim.cmd "nnoremap <silent> gr <cmd>lua vim.lsp.buf.references()<CR>"
|
||||
vim.cmd "nnoremap <silent> gi <cmd>lua vim.lsp.buf.implementation()<CR>"
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"gl",
|
||||
'<cmd>lua vim.lsp.diagnostic.show_line_diagnostics({ show_header = false, border = "single" })<CR>',
|
||||
{ noremap = true, silent = true }
|
||||
)
|
||||
|
||||
vim.cmd "nnoremap <silent> gp <cmd>lua require'lsp.utils'.PeekDefinition()<CR>"
|
||||
vim.cmd "nnoremap <silent> K :lua vim.lsp.buf.hover()<CR>"
|
||||
vim.cmd "nnoremap <silent> <C-p> :lua vim.lsp.diagnostic.goto_prev({popup_opts = {border = lvim.lsp.popup_border}})<CR>"
|
||||
vim.cmd "nnoremap <silent> <C-n> :lua vim.lsp.diagnostic.goto_next({popup_opts = {border = lvim.lsp.popup_border}})<CR>"
|
||||
-- vim.cmd "nnoremap <silent> <tab> <cmd>lua vim.lsp.buf.signature_help()<CR>"
|
||||
-- scroll down hover doc or scroll in definition preview
|
||||
-- scroll up hover doc
|
||||
-- vim.cmd 'command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue