aboutsummaryrefslogtreecommitdiff
path: root/nvim_alt/completion.lua
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2025-12-22 17:28:43 +0100
committerThomas Schmucker <ts@its1.de>2025-12-22 17:28:43 +0100
commit6f6457b7397247a34e25d4d9bfca434d8306283e (patch)
tree2b9d9ab2580d7fe5d6f2be31eb34c1899b7ffcd8 /nvim_alt/completion.lua
parentd662ef8d258234b6602cae1b1d9060f71d29e9c1 (diff)
downloaddotfiles-6f6457b7397247a34e25d4d9bfca434d8306283e.tar.gz
dotfiles-6f6457b7397247a34e25d4d9bfca434d8306283e.tar.bz2
dotfiles-6f6457b7397247a34e25d4d9bfca434d8306283e.zip
Backup: Alte Neovim-Konfiguration
Diffstat (limited to 'nvim_alt/completion.lua')
-rw-r--r--nvim_alt/completion.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/nvim_alt/completion.lua b/nvim_alt/completion.lua
new file mode 100644
index 0000000..747607e
--- /dev/null
+++ b/nvim_alt/completion.lua
@@ -0,0 +1,21 @@
1vim.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
9 client:supports_method('textDocument/formatting') then
10 vim.api.nvim_create_autocmd('BufWritePre', {
11 group = vim.api.nvim_create_augroup('my.lsp', { clear = false }),
12 buffer = ev.buf,
13 callback = function()
14 vim.lsp.buf.format({ bufnr = ev.buf, id = client.id, timeout_ms = 1000 })
15 end,
16 })
17 end
18 end,
19})
20
21vim.o.winborder = 'rounded'