local function augroup(name) return vim.api.nvim_create_augroup("custom_" .. name, {}) end vim.api.nvim_create_autocmd("FileType", { group = augroup("use_sentences"), pattern = { "vimwiki", "latex", "tex", }, callback = function() vim.bo.formatprg = "/home/yigit/.local/bin/sentences" end, }) vim.api.nvim_create_autocmd("VimLeave", { group = augroup("tex_clear"), pattern = { '*.tex', }, command = "!textclear %", }) vim.api.nvim_create_autocmd("VimResized", { group = augroup("sane_windows"), pattern = { '*.*', }, command = "wincmd =", })