-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit.lua
More file actions
79 lines (71 loc) · 2.04 KB
/
Copy pathinit.lua
File metadata and controls
79 lines (71 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
-- Quickstart configs for Nvim LSP
return {
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"saghen/blink.cmp",
"SmiteshP/nvim-navic",
{ "antosha417/nvim-lsp-file-operations", config = true },
},
opts = {
servers = {
},
},
keys = {
-- Add this keys (minimal one key) for showing all lsp keys on main whichkey menu
{ "<leader>ls", "<cmd>LspRestart<CR>", desc = "LSP Restart LSP server" },
-- info
{ "<leader>il", "<cmd>LspInfo<CR>", desc = "LSP info" },
},
config = function(_, opts)
vim.lsp.set_log_level("warn")
local icons = require("config.icons")
local blink_cmp = require("blink.cmp")
local severity = vim.diagnostic.severity
vim.diagnostic.config({
signs = {
text = {
[severity.ERROR] = icons.diagnostics.Error,
[severity.WARN] = icons.diagnostics.Warn,
[severity.HINT] = icons.diagnostics.Hint,
[severity.INFO] = icons.diagnostics.Info,
},
numhl = {
[severity.ERROR] = "DiagnosticSignError",
[severity.WARN] = "DiagnosticSignWarn",
[severity.HINT] = "DiagnosticSignHint",
[severity.INFO] = "DiagnosticSignInfo",
},
},
})
local srvopts = {
capabilities = blink_cmp.get_lsp_capabilities(),
on_attach = require("plugins.code.lsp.lib.on_attach"),
}
srvopts.capabilities.offsetEncoding = { "utf-8" }
for server_name, server_config in pairs(opts.servers) do
server_config.capabilities = srvopts.capabilities
server_config.on_attach = srvopts.on_attach
vim.lsp.config(server_name, server_config)
vim.lsp.enable(server_name)
end
--
-- lspconfig["lua_ls"].setup({
-- settings = { -- custom settings for lua
-- Lua = {
-- -- make the language server recognize "vim" global
-- diagnostics = {
-- globals = { "vim" },
-- },
-- workspace = {
-- -- make language server aware of runtime files
-- library = {
-- [vim.fn.expand("$VIMRUNTIME/lua")] = true,
-- [vim.fn.stdpath("config") .. "/lua"] = true,
-- },
-- },
-- },
-- },
-- })
end,
}