Friday, December 21, 2012

Re: Reload Buffer

On 2012-12-21, Marcin Szamotulski wrote:
> On 06:01 Fri 21 Dec , stillLearningVim wrote:
> > Thanks for the suggestions!
> >
> > Source looks excellent and Dominique, that is a very cool trick.
> > With :source though, it seems to only execute the commands in
> > the vimrc, so if I remove something it doesn't un-execute if
> > that makes any sense. Is there another way of doing this? Or
> > maybe I'm missing something

> There is no easy way of making it work as you wish, i.e. unset changes.
> The possible thing is to make a list of all options and prior to execute
> vimrc file set all the options to its default value with a loop
>
> for se in settings
> exe 'set '.se.'&'
> endfor
>
> Though this will not work when you set local values (with setl). You
> can then wrap this loop and a vimrc source command in a function which
> is called via BufWritePost autocommand.

There is also the issue of autocommands. You can unset all of those
that were set in your .vimrc by putting them in their own group,
then clearing that group with :au! as the first command in the
group. See

:help autocmd-remove
help :augroup-delete

Regards,
Gary

--
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: