Skip to content

Commit 13bd446

Browse files
committed
accumulate non-MaySet() options too
1 parent 66c1a95 commit 13bd446

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

plugin/sensible.vim

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ call s:Default('backspace', 'indent,eol,start')
5757
" Disable completing keywords in included files (e.g., #include in C). When
5858
" configured properly, this can result in the slow, recursive scanning of
5959
" hundreds of files of dubious relevance.
60-
set complete-=i
60+
call s:DefaultMod('complete', '-=', 'i', 0)
6161
call s:DefaultSet('smarttab', s:defaultval_yes)
6262

63-
set nrformats-=octal
63+
call s:DefaultMod('nrformats', '-=', 'octal', 0)
6464

6565
" Make the escape key more responsive by decreasing the wait time for an
6666
" escape sequence (e.g., arrow keys).
6767
if !has('nvim') && &ttimeoutlen == -1
68-
set ttimeout
69-
set ttimeoutlen=100
68+
call s:DefaultSet('ttimeout', s:defaultval_yes, 0)
69+
call s:Default('ttimeoutlen', '100', 0)
7070
endif
7171

7272
if has('reltime')
@@ -94,16 +94,17 @@ function! s:SetSidescroll() abort
9494
endif
9595
endfunction
9696

97-
set display+=lastline
97+
let s:display_mods='lastline'
9898
if has('patch-7.4.2109')
99-
set display+=truncate
99+
let s:display_mods .= ',truncate'
100100
endif
101+
call s:DefaultMod('display', '+=', s:display_mods, 0)
101102

102103
call s:Default('listchars', 'tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+')
103104

104105
" Delete comment character when joining commented lines.
105106
if v:version > 703 || v:version == 703 && has("patch541")
106-
set formatoptions+=j
107+
call s:DefaultMod('formatoptions', '+=', 'j', 0)
107108
endif
108109

109110
" Replace the check for a tags file in the parent directory of the current
@@ -123,17 +124,17 @@ if !empty(&viminfo)
123124
endif
124125
" Saving options in session and view files causes more problems than it
125126
" solves, so disable it.
126-
set sessionoptions-=options
127-
set viewoptions-=options
127+
call s:DefaultMod('sessionoptions', '-=', 'options', 0)
128+
call s:DefaultMod('viewoptions', '-=', 'options', 0)
128129

129130
" Allow color schemes to do bright colors without forcing bold.
130131
if &t_Co == 8 && $TERM !~# '^Eterm'
131-
set t_Co=16
132+
call s:Default('t_Co', '16', 0)
132133
endif
133134

134135
" If the running Vim lacks support for the Fish shell, use Bash instead.
135136
if &shell =~# 'fish$' && (v:version < 704 || v:version == 704 && !has('patch276'))
136-
set shell=/usr/bin/env\ bash
137+
call s:Default('shell', '/usr/bin/env\ bash', 0)
137138
endif
138139

139140
" Disable a legacy behavior that can break plugin maps.

0 commit comments

Comments
 (0)