diff --git a/init.lua b/init.lua index eb0c153..9b2d42f 100644 --- a/init.lua +++ b/init.lua @@ -14,3 +14,4 @@ vim.opt.rtp:prepend(lazypath) require("znvim.options") require("lazy").setup("znvim.plugins") require("znvim.keymaps") +require("znvim.autocmds") diff --git a/lua/znvim/autocmds.lua b/lua/znvim/autocmds.lua new file mode 100644 index 0000000..f64089a --- /dev/null +++ b/lua/znvim/autocmds.lua @@ -0,0 +1,16 @@ +vim.api.nvim_create_autocmd("TextYankPost", { -- highlight yanked characters + callback = function() + vim.highlight.on_yank({ timeout = 250 }) + end +}) + +vim.api.nvim_create_autocmd("FileType", { -- close some filetypes with + pattern = { + "help", + "man", + }, + callback = function(event) + vim.bo[event.buf].buflisted = false + vim.keymap.set("n", "q", "quit", { buffer = event.buf, silent = true }) + end, +})