nvim-ks/lua/autocmd.lua

24 lines
664 B
Lua
Raw Normal View History

2024-08-06 03:03:57 +02:00
-- [[ Autocommands ]]
-- See `:help autocmd`
-- See `:help lua-guide-autocommands`
-- Instantly move help window to the right
-- This is almost certainly a hacky way to do this)
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'help' },
2024-08-04 09:33:12 +02:00
command = 'wincmd L',
})
2024-08-06 03:03:57 +02:00
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
-- vim: ts=2 sts=2 sw=2 et