mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-30 03:42:04 +00:00
35 lines
1.4 KiB
Lua
35 lines
1.4 KiB
Lua
-- ╭─────────────────────────────────────────────────────────╮
|
|
-- │ Autogroups │
|
|
-- ╰─────────────────────────────────────────────────────────╯
|
|
|
|
local augroup = vim.api.nvim_create_augroup -- Create/get autocommand group
|
|
local autocmd = vim.api.nvim_create_autocmd -- Create autocommand
|
|
|
|
-- ── Highlight on yank ───────────────────────────────────────────────
|
|
-- See `:help vim.highlight.on_yank()`
|
|
local highlight_group = augroup('YankHighlight', { clear = true })
|
|
autocmd('TextYankPost', {
|
|
callback = function()
|
|
vim.highlight.on_yank()
|
|
end,
|
|
group = highlight_group,
|
|
pattern = '*',
|
|
})
|
|
|
|
-- ── Windows to close with "q" ───────────────────────────────────────
|
|
autocmd('FileType', {
|
|
callback = function()
|
|
vim.keymap.set('n', '<esc>', ':bd<CR>', { buffer = true, silent = true })
|
|
end,
|
|
pattern = {
|
|
'help',
|
|
'startuptime',
|
|
'qf',
|
|
'lspinfo',
|
|
'man',
|
|
'checkhealth',
|
|
},
|
|
})
|
|
|
|
-- vim: ts=2 sts=2 sw=2 et
|