diff options
author | Brahmajit Das <listout@listout.xyz> | 2025-06-04 03:18:34 +0530 |
---|---|---|
committer | Brahmajit Das <listout@listout.xyz> | 2025-06-04 03:47:45 +0530 |
commit | a0d54522045755812e81121a5bbf3f115bf76a5a (patch) | |
tree | ae4c7cef384d2750c7ae1357bdaaee20e86f3a9a /plugin/lsp.lua | |
parent | ab9378da69edb6fec97c0cb3f87bb02f83fc4b7f (diff) |
moving lsp config, removing lsp-config dependency (v.11.0+) and removing LspAttach from lsp config
Signed-off-by: Brahmajit Das <listout@listout.xyz>
Diffstat (limited to 'plugin/lsp.lua')
-rw-r--r-- | plugin/lsp.lua | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/plugin/lsp.lua b/plugin/lsp.lua new file mode 100644 index 0000000..e1bae06 --- /dev/null +++ b/plugin/lsp.lua @@ -0,0 +1,53 @@ +vim.lsp.enable({ + "lua_ls" +}) + +local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } +vim.diagnostic.config({ + signs = { + enable = true, + text = { + ["ERROR"] = signs.Error, + ["WARN"] = signs.Warn, + ["HINT"] = signs.Hint, + ["INFO"] = signs.Info, + }, + texthl = { + ["ERROR"] = "DiagnosticDefault", + ["WARN"] = "DiagnosticDefault", + ["HINT"] = "DiagnosticDefault", + ["INFO"] = "DiagnosticDefault", + }, + numhl = { + ["ERROR"] = "DiagnosticDefault", + ["WARN"] = "DiagnosticDefault", + ["HINT"] = "DiagnosticDefault", + ["INFO"] = "DiagnosticDefault", + }, + } +}) + +vim.o.updatetime = 250 +-- vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false, scope="cursor"}) +-- vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] +vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#4c4f69]] +vim.cmd [[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]] + +local border = { + { "╭", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╮", "FloatBorder" }, + { "│", "FloatBorder" }, + { "╯", "FloatBorder" }, + { "─", "FloatBorder" }, + { "╰", "FloatBorder" }, + { "│", "FloatBorder" }, +} + +-- To instead override globally +local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview +function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...) + opts = opts or {} + opts.border = opts.border or border + return orig_util_open_floating_preview(contents, syntax, opts, ...) +end |