diff options
| author | Thomas Schmucker <ts@its1.de> | 2025-04-29 20:40:15 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2025-04-29 20:40:15 +0200 |
| commit | cd5e33da517352d17b4c0ff93df5092eb6bb4001 (patch) | |
| tree | ad3b33fac083f53dd220155293b2666f66c448ff /nvim/completion.lua | |
| parent | 137e69a202f60db986662d6d727b100014b31af6 (diff) | |
| download | dotfiles-cd5e33da517352d17b4c0ff93df5092eb6bb4001.tar.gz dotfiles-cd5e33da517352d17b4c0ff93df5092eb6bb4001.tar.bz2 dotfiles-cd5e33da517352d17b4c0ff93df5092eb6bb4001.zip | |
neue lsp Konfiguration und Plugins ausgemistet
Diffstat (limited to 'nvim/completion.lua')
| -rw-r--r-- | nvim/completion.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nvim/completion.lua b/nvim/completion.lua new file mode 100644 index 0000000..d477367 --- /dev/null +++ b/nvim/completion.lua | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | vim.api.nvim_create_autocmd("LspAttach", { | ||
| 2 | callback = function(ev) | ||
| 3 | local client = vim.lsp.get_client_by_id(ev.data.client_id) | ||
| 4 | if client and client:supports_method("textDocument/completion") then | ||
| 5 | vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true }) | ||
| 6 | end | ||
| 7 | |||
| 8 | if client and not client:supports_method('textDocument/willSaveWaitUntil') and client:supports_method('textDocument/formatting') then | ||
| 9 | vim.api.nvim_create_autocmd('BufWritePre', { | ||
| 10 | group = vim.api.nvim_create_augroup('my.lsp', {clear=false}), | ||
| 11 | buffer = ev.buf, | ||
| 12 | callback = function() | ||
| 13 | vim.lsp.buf.format({ bufnr = ev.buf, id = client.id, timeout_ms = 1000 }) | ||
| 14 | end, | ||
| 15 | }) | ||
| 16 | end | ||
| 17 | end, | ||
| 18 | }) | ||
| 19 | |||
| 20 | vim.o.winborder = 'rounded' | ||
| 21 | |||
