Thursday, July 12, 2012

Re: Overriding setlocal in session files

On Thursday, July 12, 2012 7:47:22 PM UTC-5, Tim Johnson wrote:
> For a long time I have had the following in my .vimrc
> autocmd BufRead,BufNewFile *.js setlocal shiftwidth=2 tabstop=2
> Thus, numerous session files have those settings.
> Now I have changed my .vimrc to
> autocmd BufRead,BufNewFile *.js setlocal shiftwidth=4 tabstop=4
>
> *But* the now-desirable setting above are being overriden by the session files with the old settings.
> I could manually edit each session file and remove the 'old'
> settings, but is there an easier or more 'vimish' solution?
>

You could remove "options" and "localoptions" from your 'sessionoptions' setting, then re-save your session with mksession. This will make the mappings not be included at all in the session, since you've got them in your .vimrc anyway. Unfortunately options are also not stored, which may or may not be something you're OK with. The mappings being included is annoying enough for me I've turned it off.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: