diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-02 17:47:10 -0500 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2025-03-02 17:47:10 -0500 |
| commit | 3fb87c7b8b2377a2cfc0f6e2b858a5b4f96f49d6 (patch) | |
| tree | 7efef9eec4b626cbcfd1d1396cb6dee4c73c7783 /modules/neovim/lsp.lua | |
| parent | b5e3e6f12b41a9a1133744e139c5aa47d1bee006 (diff) | |
| download | home-3fb87c7b8b2377a2cfc0f6e2b858a5b4f96f49d6.tar.gz | |
update
Diffstat (limited to 'modules/neovim/lsp.lua')
| -rw-r--r-- | modules/neovim/lsp.lua | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/modules/neovim/lsp.lua b/modules/neovim/lsp.lua deleted file mode 100644 index ad6cddf..0000000 --- a/modules/neovim/lsp.lua +++ /dev/null @@ -1,57 +0,0 @@ --- builtin neovim lsp configuration -vim.opt.cot = "menu,menuone,noselect" ---vim.opt.cot = "menu,menuone" - -local methods = vim.lsp.protocol.Methods -local map = vim.keymap.set - --- hook that makes every floating window opened by nvim lsp rounded -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 "rounded" - return orig_util_open_floating_preview(contents, syntax, opts, ...) -end - -vim.diagnostic.config({ --- virtual_text = { prefix = "", virt_text_pos = "eol_right_align", }, - virtual_text = false, - float = { border = "rounded" }, - signs = false, - underline = true, - update_in_insert = false, - float = true, - jump = { float = true } -}) - -local function pumvisible() - return tonumber(vim.fn.pumvisible()) ~= 0 -end - -vim.api.nvim_create_autocmd("LspAttach", { callback = function(args) - local client = vim.lsp.get_client_by_id(args.data.client_id) - --- fun but gets annoying --- if client:supports_method(methods.textDocument_inlayHint) then --- vim.lsp.inlay_hint.enable() --- end - - map('n', 'E', '<cmd>lua vim.lsp.buf.hover()<CR>', { silent = true }) - - if client:supports_method(methods.textDocument_completion) then - vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = false }) - vim.keymap.set('i', '<C-n>', function() - return pumvisible() and '<C-n>' or vim.lsp.completion.trigger() - end) - end - --- autoformat on save - if client:supports_method(methods.textDocument_formatting) then - vim.api.nvim_create_autocmd("BufWritePre", { - buffer = args.buf, - callback = function() - vim.lsp.buf.format({bufnr = args.buf, id = client_id}) - end - }) - end -end}) |