From 2105d7080529cf549eca10e716291ddee635498f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 5 Nov 2017 01:39:13 +1300 Subject: Keep script var cache of 'j' 'fo' flag support We'll use this in a subsequent commit to decide how to map j. --- vim/config/format.vim | 9 ++++++--- 1 file 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 -- cgit v1.2.3