after/ftplugin instead of autocmd
Use after/ftplugin instead of autocmds to handle options depending on filetype
This commit is contained in:
parent
6997f3da65
commit
aa0f1fbd92
5 changed files with 26 additions and 9 deletions
|
|
@ -7,12 +7,13 @@ vim.api.nvim_create_autocmd("TextYankPost", {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Disable (relative) line numbers on Oil windows
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("weeheavy-no-line-numbers-in-oil", { clear = true }),
|
||||
pattern = { "oil" },
|
||||
callback = function()
|
||||
vim.opt.relativenumber = false
|
||||
vim.opt.number = false
|
||||
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,
|
||||
--})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue