Small changes

This commit is contained in:
Chris
2026-08-21 11:57:15 +01:00
parent ae26197a78
commit 285d4d5f00
6 changed files with 35 additions and 31 deletions
+7 -9
View File
@@ -14,17 +14,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
local autosave_group = vim.api.nvim_create_augroup('autosaving', { clear = true })
vim.api.nvim_create_autocmd('FocusLost', {
vim.api.nvim_create_autocmd({ 'FocusLost', 'BufLeave' }, {
group = autosave_group,
pattern = '*',
command = 'silent! wa', -- Save all files when moving away from the window
nested = true, -- Allow other autocommands to run after this one
})
callback = function(args)
if vim.bo[args.buf].filetype == 'oil' then
return
end
vim.api.nvim_create_autocmd('BufLeave', {
group = autosave_group,
pattern = '*',
command = 'silent! wa', -- Save all files when switching buffers
vim.cmd 'silent! wa'
end,
nested = true, -- Allow other autocommands to run after this one
})
@@ -218,4 +217,3 @@ vim.api.nvim_create_autocmd('VimLeavePre', {
})
require('helpers').edit_cf('a', '/lua/autocmd.lua')