mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 18:48:04 +00:00
feat(nvim): refactoring, docs, keybinds, others
This commit is contained in:
34
config/nvim/lua/autogroups.lua
Normal file
34
config/nvim/lua/autogroups.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
-- ╭─────────────────────────────────────────────────────────╮
|
||||
-- │ 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
|
||||
Reference in New Issue
Block a user