Loading ...
Sorry, an error occurred while loading the content.

Switch vim window with command line option

Expand Messages
  • Roy Fulbright
    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,
    Message 1 of 3 , Sep 26, 2012
    • 0 Attachment
      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.

      --
      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
    • Christian Brabandt
      ... or even better use ... to switch windows See ... regards, Christian -- You received this message from the vim_use maillist. Do not top-post! Type your
      Message 2 of 3 , Sep 26, 2012
      • 0 Attachment
        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

        --
        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
      • Roy Fulbright
        ... Thanks, Christian. That worked great! -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
        Message 3 of 3 , Sep 26, 2012
        • 0 Attachment

           
          > Date: Wed, 26 Sep 2012 15:36:35 +0200
          > Subject: Re: Switch vim window with command line option
          > From: cblists@...
          > To: vim_use@...
          >
          > 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!
           

          --
          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
        Your message has been successfully submitted and would be delivered to recipients shortly.