Wednesday, September 26, 2012

RE: Switch vim window with command line option


 
> Date: Wed, 26 Sep 2012 15:36:35 +0200
> Subject: Re: Switch vim window with command line option
> From: cblists@256bit.org
> To: vim_use@googlegroups.com
>
> On Wed, September 26, 2012 15:31, Roy Fulbright wrote:
> >
> >
> >
> >
> > I have the following in a batch file on Windows 7. My goal is to start
> > gvim with the help window for dbext open, open a new window with a
> > vertical split, switch to the new window, and open an SQL file. gvim -c
> > ":help dbext" -c ":vsplit" -c "normal <c-w><c-w>" -c ":e tutorial.sql"
> > Everything works except for switching to the new window with <c-w><c-w>.
> > What am I doing wrong? Thanks.
>
> normal doesn't understand the <key> notation. Either use exe:
> :exe "normal \<c-w>\<c-w>"
> or even better use
> :wincmd w
> to switch windows
>
> See
> :h :wincmd
> :h :exe
>
>
> regards,
> Christian
>
Thanks, Christian. That worked great!
 

No comments: