user/neovim: autosave tex, and autosave while in insert

This commit is contained in:
Cilly Leang 2025-09-05 23:53:39 +10:00
parent 870fc4e2d7
commit 480208b718
Signed by: cilly
GPG key ID: 6500251E087653C9

View file

@ -69,14 +69,14 @@ vim.cmd("au FileType rust highlight DiagnosticUnderlineHint ctermfg=14 gui=itali
-- Plugins -- Plugins
require('autoclose').setup {} require('autoclose').setup {}
local function autosavecond(buf) local function autosavecond(buf)
if vim.tbl_contains({"astro"}, vim.fn.getbufvar(buf, "&filetype")) then if vim.tbl_contains({"astro", "tex"}, vim.fn.getbufvar(buf, "&filetype")) then
return true return true
end end
return false return false
end end
require('auto-save').setup { require('auto-save').setup {
trigger_events = { trigger_events = {
defer = { "InsertLeave", "TextChanged", "TextChangedI" }, defer_save = { "InsertLeave", "TextChanged", "TextChangedI" },
}, },
debounce_delay = 250, debounce_delay = 250,
condition = autosavecond, condition = autosavecond,