autocmds
This commit is contained in:
parent
50dfcd9bd8
commit
38fd1b675e
2 changed files with 17 additions and 0 deletions
1
init.lua
1
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")
|
||||
|
|
16
lua/znvim/autocmds.lua
Normal file
16
lua/znvim/autocmds.lua
Normal file
|
@ -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 <q>
|
||||
pattern = {
|
||||
"help",
|
||||
"man",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>quit<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
Loading…
Reference in a new issue