feat: added better bindings for lsp
This commit is contained in:
parent
1239047cc9
commit
d589775634
4 changed files with 24 additions and 8 deletions
|
|
@ -27,8 +27,8 @@ require("mason-lspconfig").setup({
|
|||
"cmake", -- cmake
|
||||
"bashls", -- shell
|
||||
"ansiblels", -- ansible
|
||||
"omnisharp", -- dotnot
|
||||
"hls", -- haskel
|
||||
-- "omnisharp", -- dotnot
|
||||
-- "hls", -- haskel
|
||||
},
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
|
@ -39,8 +39,17 @@ local on_attach = function(client, bufnr)
|
|||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
local opts = { noremap = true, silent = true, buffer=bufnr }
|
||||
vim.keymap.set("n", "<C-k>", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
vim.keymap.set("n", "<M-CR>", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>h", "<Cmd>lua vim.lsp.buf.declaration()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>j", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>k", "<Cmd>lua vim.lsp.buf.implementation()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>l", "<Cmd>lua vim.lsp.buf.references()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>;", "<Cmd>lua vim.lsp.buf.code_action()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>u", "<Cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
|
||||
vim.keymap.set("n", "<leader>g", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts)
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue