neovim/lua/weeheavy/autocmd.lua
Oliver Ladner aa0f1fbd92 after/ftplugin instead of autocmd
Use after/ftplugin instead of autocmds to handle options depending on
filetype
2024-05-17 15:24:50 +02:00

19 lines
644 B
Lua

-- Highlight yanked text on e.g. yy,yap etc.
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("weeheavy-highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
-- NOTE: the config below was put to after/ftplugin to make it simpler
-- Disable colorcolumn on quickfix (qf) windows
--vim.api.nvim_create_autocmd("FileType", {
-- group = vim.api.nvim_create_augroup("weeheavy-no-colorcolumn-in-quickfix", { clear = true }),
-- pattern = { "qf", "Trouble" },
-- callback = function()
-- vim.opt.colorcolumn = ""
-- end,
--})