Skip to content

Commit

Permalink
Avoid overriding formatoptions in puppet's ftplugin
Browse files Browse the repository at this point in the history
We're using formatexpr. This means that we're explicitly not using vim's
builtin formatting, so the formatoptions are (currently) not used by the
formatexpr function.

If this plugin were to vary the formatting according to formatoptions,
it would actually be up to users to choose what they want to be
formatted, not the plugin itself.
  • Loading branch information
lelutin committed Sep 8, 2024
1 parent 28c1f1b commit a706f02
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ftplugin/puppet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ setlocal commentstring=#\ %s
" full resource name, however since : is used in many non-keyword contexts it
" is a bad idea to add it to the option.

setlocal formatoptions-=t formatoptions+=croql
setlocal formatexpr=puppet#format#Format()

let b:undo_ftplugin = '
\ setlocal tabstop< tabstop< softtabstop< shiftwidth< expandtab<
\| setlocal keywordprg< iskeyword< comments< commentstring<
\| setlocal formatoptions< formatexpr<
\| setlocal formatexpr<
\'

0 comments on commit a706f02

Please sign in to comment.