Updated config

This commit is contained in:
Eduard Urbach 2025-05-28 16:39:25 +02:00
parent 90e01eaea4
commit 666fc20045
No known key found for this signature in database
GPG key ID: C874F672B1AF20C0
21 changed files with 155 additions and 199 deletions

View file

@ -0,0 +1,40 @@
local on = vim.api.nvim_create_autocmd
local group = vim.api.nvim_create_augroup("autocmds", {clear = true})
on({ "LspAttach" }, {
desc = "LSP completion",
group = group,
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client:supports_method("textDocument/completion") then
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
end
end,
})
on({ "TextYankPost" }, {
desc = "Highlight when copying text",
group = group,
callback = function()
vim.highlight.on_yank()
end,
})
on({ "BufNewFile", "BufRead" }, {
desc = "Enable word wrap in text files and markdown documents",
group = group,
pattern = { "*.txt", "*.md" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.signcolumn = "no"
end,
})
on({ "TermOpen", "TermEnter" }, {
desc = "Disable sign column in terminals",
group = group,
callback = function()
vim.opt_local.signcolumn = "no"
end,
})