fixed lsp and updated
This commit is contained in:
parent
17fda33a90
commit
9127a6161e
5 changed files with 69 additions and 44 deletions
|
|
@ -1,52 +1,10 @@
|
|||
---@module "utils.plugins"
|
||||
---@type Plugin
|
||||
return {
|
||||
after = "mason",
|
||||
after = { "mason", "blink.cmp" },
|
||||
configure = function(load)
|
||||
load("neovim/nvim-lspconfig")
|
||||
|
||||
load("folke/lazydev.nvim")
|
||||
require("lazydev").setup({})
|
||||
|
||||
--[[
|
||||
---@type vim.lsp.Config
|
||||
local config = {
|
||||
---@type lspconfig.settings.lua_ls
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
workspace = {
|
||||
preloadFileSize = 10000,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.lsp.config("lua_ls", config)
|
||||
]]
|
||||
--
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client and client:supports_method("textDocument/completion") then
|
||||
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = true })
|
||||
end
|
||||
end,
|
||||
})
|
||||
vim.opt.completeopt = { "menuone", "noinsert", "popup" }
|
||||
vim.keymap.set("i", "<Tab>", function()
|
||||
if vim.fn.pumvisible() == 1 then
|
||||
return "<C-y>"
|
||||
end
|
||||
return "<Tab>"
|
||||
end, { expr = true })
|
||||
|
||||
-- Reserve a space in the gutter
|
||||
-- This will avoid an annoying layout shift in the screen
|
||||
vim.opt.signcolumn = "yes"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue