Sunday, July 20, 2014

Re: autosaving buffer content

On 22:52 Mon 14 Jul , Arup Rakshit wrote:
> On Saturday, July 12, 2014 06:16:52 PM Salman Halim wrote:
> > On Saturday, July 12, 2014, Arup Rakshit <aruprakshit@rocketmail.com> wrote:
> > > Hi,
> > >
> > > I am looking for a way, suppose I am working on 4 different windows.
> > > Whenever I
> > > will move from one window to another window, that data to that window
> > > should
> > > be saved to the associated file. Is this possible ?
> >
> > au WinLeave * upd
> >
> > Salman
>
> I put in my ~/.vimrc file
>
> au FocusLost * wa
>
> But it is not working. When ever I am opening Gvim getting error :-
>
> arup@linux-wzza:~/Ruby> gvim
>
> --- Auto-Commands ---
> arup@linux-wzza:~/Ruby>
>
>
> --
> ================
> Regards,
> Arup Rakshit
> ================
> Debugging is twice as hard as writing the code in the first place. Therefore,
> if you write the code as cleverly as possible, you are, by definition, not
> smart enough to debug it.
>
> --Brian Kernighan

The `FocusLost` autocommand group is for the vim window itself (as
managed by your window manager) rather than vim windows (the ones that
holds buffers, you can get a new one with the :split command). As noted
in one of the previous messages the `WinLeave` autocommand group will
work for you.

Best regards,
Marcin Szamotulski

No comments:

Post a Comment