From 77ff4928a33c5e182597c3f5e1f114de4a41ecd4 Mon Sep 17 00:00:00 2001 From: yage Date: Tue, 9 Aug 2022 13:29:47 -0600 Subject: [PATCH] ensure forced-filetypes are set before custom format options; added new recognized filetypes --- vim/formatting.vim | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/vim/formatting.vim b/vim/formatting.vim index f6e4d68..d047404 100644 --- a/vim/formatting.vim +++ b/vim/formatting.vim @@ -12,6 +12,18 @@ function FormatFileType(indent, expandtab, foldmethod, foldlevel, spell) let &l:spell = a:spell endfunction +augroup forced_filetype_recognition + autocmd BufRead,BufNewFile *.tmux setfiletype tmux + autocmd BufRead,BufNewFile *.clisp setfiletype lisp + autocmd BufRead,BufNewFile *.lsp setfiletype lisp + autocmd BufRead,BufNewFile Dockerfile* setfiletype dockerfile + autocmd BufRead,BufNewFile *i3.conf setfiletype i3config + autocmd BufRead,BufNewFile *.template.yaml set filetype=yaml.cloudformation + autocmd BufRead,BufNewFile git.conf setfiletype gitconfig + + let g:tex_flavor = "latex" +augroup end + augroup filetype_specific_formatting autocmd! autocmd FileType python call FormatFileType(4, v:true, 'indent', 99, v:false) @@ -39,16 +51,6 @@ augroup filetype_specific_formatting autocmd FileType go call FormatFileType(4, v:false, 'manual', 99, v:false) autocmd FileType json call FormatFileType(2, v:false, 'indent', 99, v:false) augroup end - -augroup forced_filetype_recognition - autocmd BufRead,BufNewFile *.tmux setfiletype tmux - autocmd BufRead,BufNewFile *.clisp setfiletype lisp - autocmd BufRead,BufNewFile *.lsp setfiletype lisp - autocmd BufRead,BufNewFile Dockerfile* setfiletype dockerfile - autocmd BufRead,BufNewFile *i3.conf setfiletype i3config - - let g:tex_flavor = "latex" -augroup end " }}}