mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-31 15:19:26 +02:00
Wrap lsp default_keybindings in function instead of load on 1st require (#1128)
Co-authored-by: Johan Melin <johan.melin@paradoxinteractive.com>
This commit is contained in:
parent
66bf89c3d1
commit
41b5a28624
2 changed files with 22 additions and 19 deletions
1
init.lua
1
init.lua
|
@ -22,6 +22,7 @@ require("settings").load_commands()
|
|||
require("core.autocmds").define_augroups(lvim.autocommands)
|
||||
|
||||
require "keymappings"
|
||||
require("lsp").setup_default_bindings()
|
||||
|
||||
local plugins = require "plugins"
|
||||
local plugin_loader = require("plugin-loader").init()
|
||||
|
|
|
@ -38,6 +38,7 @@ vim.fn.sign_define(
|
|||
-- { noremap = true, silent = true }
|
||||
-- )
|
||||
|
||||
function lsp_config.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>"
|
||||
|
@ -59,6 +60,7 @@ if lvim.lsp.default_keybinds then
|
|||
-- scroll up hover doc
|
||||
vim.cmd 'command! -nargs=0 LspVirtualTextToggle lua require("lsp/virtual_text").toggle()'
|
||||
end
|
||||
end
|
||||
|
||||
-- Set Default Prefix.
|
||||
-- Note: You can set a prefix per lsp server in the lv-globals.lua file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue