diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-05 01:39:13 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-05 01:39:13 +1300 |
commit | 2105d7080529cf549eca10e716291ddee635498f (patch) | |
tree | 8271030fb547f438aba5d43437f4e8aad9d56fa4 /vim/config | |
parent | Merge branch 'feature/fo-a-vim7' into develop (diff) | |
download | dotfiles-2105d7080529cf549eca10e716291ddee635498f.tar.gz dotfiles-2105d7080529cf549eca10e716291ddee635498f.zip |
Keep script var cache of 'j' 'fo' flag support
We'll use this in a subsequent commit to decide how to map <Leader>j.
Diffstat (limited to 'vim/config')
-rw-r--r-- | vim/config/format.vim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/vim/config/format.vim b/vim/config/format.vim index fe6da87c..7d6fb2b1 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -1,7 +1,10 @@ -" If we can, add j to the format options to get rid of comment leaders when -" joining lines -if v:version > 703 +" Figure out if we have the 'j' flag for 'formatoptions', to automatically +" delete comment leaders when joining lines; keep it in a script variable +let s:formatoptions_has_j = v:version > 703 \ || v:version ==# 703 && has('patch541') + +" If we do have 'j', default to setting it +if s:formatoptions_has_j set formatoptions+=j endif |