my-nvim-config/laptop/plugin/lsp_config.lua

42 lines
941 B
Lua
Raw Normal View History

2024-03-13 14:07:20 -05:00
local lspconfig = require('lspconfig')
local map = vim.keymap.set
2024-05-17 15:12:24 -05:00
lspconfig.pyright.setup({
settings = {
python = {
analysis = {
typeCheckingMode = "off"
}
}
}
})
2024-03-23 03:27:49 -05:00
lspconfig.lua_ls.setup({
settings = {
Lua = {
telemetry = { enable = false },
},
}
})
2024-05-17 15:12:24 -05:00
lspconfig.ocamllsp.setup {}
2024-05-18 17:17:52 -05:00
lspconfig.hls.setup {}
-- Set ;k to hover and ;a to show code actions
vim.api.nvim_create_autocmd("LspAttach", {
2024-04-03 15:25:09 -05:00
callback = function()
map('n', '<localleader>k', vim.lsp.buf.hover, { remap = false })
map('n', '<localleader>a', vim.lsp.buf.code_action, { remap = false })
map('n', '<localleader>d', vim.diagnostic.open_float, { remap = false })
end,
})
2024-05-19 17:30:00 -05:00
-- Enable inlay hints for Rust
vim.api.nvim_create_autocmd("LspAttach", {
pattern = "*.rs",
2024-05-19 17:30:00 -05:00
callback = function()
vim.lsp.inlay_hint.enable(true)
end,
})