.dotfiles/configs/nvim/lua/core/autocommands.lua
2022-05-13 19:19:05 +02:00

25 lines
510 B
Lua

local cmd = vim.cmd
local config_group = vim.api.nvim_create_augroup('Config', {})
vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
group = config_group,
callback = function()
vim.highlight.on_yank()
end,
})
cmd [[
augroup filetypedetect
au BufNewFile,BufRead *.frag setl ft=glsl
au BufNewFile,BufRead *.vert setl ft=glsl
augroup END
]]
cmd [[
augroup SaveManualFolds
autocmd!
au BufWinLeave, BufLeave ?* silent! mkview
au BufWinEnter ?* silent! loadview
augroup END
]]