diff --git a/lua/guess-indent/init.lua b/lua/guess-indent/init.lua index 53943c9..6f9c4fd 100644 --- a/lua/guess-indent/init.lua +++ b/lua/guess-indent/init.lua @@ -13,7 +13,9 @@ local function setup_autocommands() vim.cmd([[ augroup GuessIndent autocmd! - autocmd BufReadPost * :silent lua require("guess-indent").set_from_buffer(true) + autocmd BufReadPost * silent lua require("guess-indent").set_from_buffer(true) + " Run once when saving for new files + autocmd BufNewFile * autocmd BufWritePost ++once silent lua require("guess-indent").set_from_buffer(true) augroup END ]]) end