Skip to content

Commit

Permalink
Add autocmd so that GuessIndent runs when new files are saved
Browse files Browse the repository at this point in the history
  • Loading branch information
NMAC427 committed May 15, 2022
1 parent ac89299 commit bdecfbd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/guess-indent/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 <buffer=abuf> ++once silent lua require("guess-indent").set_from_buffer(true)
augroup END
]])
end
Expand Down

0 comments on commit bdecfbd

Please sign in to comment.