I include set number
in my .vimrc
file to have line numbers automatically displayed upon opening a file. I also use the following code block to automatically save and load the view when closing and opening buffers, mainly for the purpose of saving folds:
augroup AutoSaveFolds
autocmd!
autocmd BufWinLeave * mkview
autocmd BufWinEnter * silent loadview
augroup END
However, one view setting that I wish to avoid saving is line numbering. Currently, if I hide line numbering and then close a file, line numbering is unset when that file is reopened. This is true even if set number
is placed after the augroup
block in my .vimrc
file.
Can I circumvent this limitation, such that line numbering will automatically be enabled any time a buffer is opened while still allowing fold settings to be persistent?
localoptions
and/oroptions
from the value of the'viewoptions'
option help? Maybe something likeset vop-=localoptions vop-=options
orset vop=folds,cursor,curdir
...set vop=folds,cursor,curdir
.)