Suppose I had tabstop set to 4 in ~/.vimrc
. When I edit a file, I set the tabstop to 5 with :set tabstop=5
. After that, I close vim and restarted the terminal. When I open the file again, the tabstop for that file is still set to 5. How to make vim forget all settings (not just tabstop) I made (which I forgot) in that specific file?
Currently, when I open a previously opened file, it restores everything (settings, cursor position, etc) the way they were when I last left it. I'm not sure what causes this though. Here's my .vimrc, I guess it has something to do with BufWinLeave
and BufWinEnter
there.
What I have tried:
- reset all settings with
:set all&
and reload vimrc with:source $MYVIMRC
. Somehow the syntax highlighting is off afterward. - Create a duplicate file, delete the original one, rename the duplicate file to the original one. No effect.
autocmd Filetype dart,html,javascript setlocal tabstop=2 expandtab
) that's always setting tabstop to 2 on files of.type Dart, HTML and JavaScript?:mkview
is a Vimscript file, so technically you could even inspect or edit the file to remove commands you don't want/like and then reopen the file again...options
fromviewoptions
, withset viewoptions-=options
in your vimrc.