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

Mapping for switching windows

Expand Messages
  • Adolfo Olivera
    Hello List, Does anyone have some examples on mappings to switch windows faster *CTRL-W, h and CTRL-W, l* ? -- -- You received this message from the vim_use
    Message 1 of 17 , Jan 25, 2013
    • 0 Attachment
      Hello List,
                   Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

      --
      --
      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
       
       
       
    • neoaggelos@...
      ... I guess mapping shift-w to do this would be great for fast switching Add this to your vimrc ... Ctrl-w Ctrl-w is used to go to the next window mapping this
      Message 2 of 17 , Jan 25, 2013
      • 0 Attachment

        Hello List,
                     Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

         

        I guess mapping shift-w to do this would be great for fast switching

        Add this to your vimrc

        :map <s-w> <esc><c-w><c-w>

        Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

        --
        --
        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
         
         
         
      • Adolfo Olivera
        Thanks. What does shift-w exactly does? From what I see it goes down a line? ... -- Adolfo Olivera 15-3429-9743 -- -- You received this message from the
        Message 3 of 17 , Jan 25, 2013
        • 0 Attachment
          Thanks. What does shift-w exactly does? From what I see it goes down a line?

          On Fri, Jan 25, 2013 at 8:01 PM, <neoaggelos@...> wrote:

          Hello List,
                       Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

           

          I guess mapping shift-w to do this would be great for fast switching

          Add this to your vimrc

          :map <s-w> <esc><c-w><c-w>

          Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

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



          --
          Adolfo Olivera
          15-3429-9743


          --
          --
          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
           
           
           
        • Adolfo Olivera
          Ok. I am an idiot. You are telling me to map shift-w to do this. Understood. Thank you. ... -- Adolfo Olivera 15-3429-9743 -- -- You received this message from
          Message 4 of 17 , Jan 25, 2013
          • 0 Attachment
            Ok. I am an idiot. You are telling me to map shift-w to do this. 

            Understood. Thank you.

            On Fri, Jan 25, 2013 at 8:10 PM, Adolfo Olivera <olivera.adolfo@...> wrote:
            Thanks. What does shift-w exactly does? From what I see it goes down a line?


            On Fri, Jan 25, 2013 at 8:01 PM, <neoaggelos@...> wrote:

            Hello List,
                         Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

             

            I guess mapping shift-w to do this would be great for fast switching

            Add this to your vimrc

            :map <s-w> <esc><c-w><c-w>

            Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

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



            --
            Adolfo Olivera
            15-3429-9743





            --
            Adolfo Olivera
            15-3429-9743


            --
            --
            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
             
             
             
          • neoaggelos@...
            It shifts through the open windows, one by one see ... And find Ctrl-wCtrl-w for more information ... -- -- You received this message from the vim_use
            Message 5 of 17 , Jan 25, 2013
            • 0 Attachment
              It shifts through the open windows, one by one see 
              :help Ctrl-w 
              And find Ctrl-wCtrl-w for more information 




              Thanks. What does shift-w exactly does? From what I see it goes down a line?

              On Fri, Jan 25, 2013 at 8:01 PM, <neoaggelos@...> wrote:

              Hello List,
                           Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

               

              I guess mapping shift-w to do this would be great for fast switching

              Add this to your vimrc

              :map <s-w> <esc><c-w><c-w>

              Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

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



              --
              Adolfo Olivera
              15-3429-9743


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

              --
              --
              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
               
               
               
            • neoaggelos@...
              You re welcome. Glad to have helped you! Sent from my iPod ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
              Message 6 of 17 , Jan 25, 2013
              • 0 Attachment
                You're welcome. Glad to have helped you!

                Sent from my iPod

                On Jan 26, 2013, at 1:13 AM, Adolfo Olivera <olivera.adolfo@...> wrote:

                Ok. I am an idiot. You are telling me to map shift-w to do this. 

                Understood. Thank you.

                On Fri, Jan 25, 2013 at 8:10 PM, Adolfo Olivera <olivera.adolfo@...> wrote:
                Thanks. What does shift-w exactly does? From what I see it goes down a line?


                On Fri, Jan 25, 2013 at 8:01 PM, <neoaggelos@...> wrote:

                Hello List,
                             Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

                 

                I guess mapping shift-w to do this would be great for fast switching

                Add this to your vimrc

                :map <s-w> <esc><c-w><c-w>

                Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

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



                --
                Adolfo Olivera
                15-3429-9743





                --
                Adolfo Olivera
                15-3429-9743


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

                --
                --
                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
                 
                 
                 
              • Michael Hernandez
                By the way, TPope s vim-unimpaired plugin has cool bindings for this and other stuff too, you may want to check it out! --Mike H ... -- -- You received this
                Message 7 of 17 , Jan 25, 2013
                • 0 Attachment
                  By the way, TPope's vim-unimpaired plugin has cool bindings for this and other stuff too, you may want to check it out!

                  --Mike H

                  On Jan 25, 2013, at 6:14 PM, neoaggelos@... wrote:

                  You're welcome. Glad to have helped you!

                  Sent from my iPod

                  On Jan 26, 2013, at 1:13 AM, Adolfo Olivera <olivera.adolfo@...> wrote:

                  Ok. I am an idiot. You are telling me to map shift-w to do this. 

                  Understood. Thank you.

                  On Fri, Jan 25, 2013 at 8:10 PM, Adolfo Olivera <olivera.adolfo@...> wrote:
                  Thanks. What does shift-w exactly does? From what I see it goes down a line?


                  On Fri, Jan 25, 2013 at 8:01 PM, <neoaggelos@...> wrote:

                  Hello List,
                               Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

                   

                  I guess mapping shift-w to do this would be great for fast switching

                  Add this to your vimrc

                  :map <s-w> <esc><c-w><c-w>

                  Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

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



                  --
                  Adolfo Olivera
                  15-3429-9743





                  --
                  Adolfo Olivera
                  15-3429-9743


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

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

                  --
                  --
                  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
                   
                   
                   
                • Sven Guckes
                  ... yes: map h map l map k map j happy? but remember: the fastest way to use any program is to simply
                  Message 8 of 17 , Jan 25, 2013
                  • 0 Attachment
                    * Adolfo Olivera <olivera.adolfo@...> [2013-01-26 00:18]:
                    > Does anyone have some examples on mappings to
                    > switch windows faster [than] CTRL-W,h and CTRL-W,l?

                    yes:

                    map <left> <c-w>h
                    map <right> <c-w>l
                    map <up> <c-w>k
                    map <down> <c-w>j

                    happy?

                    but remember: the fastest way to use
                    any program is to simply learn about
                    the default config - and use just that.

                    Sven

                    --
                    To me vi is Zen. To use vi is to practice zen.
                    Every command is a koan. Profound to the
                    user, unintelligible to the uninitiated.
                    You discover truth everytime you use it. --Reddy

                    --
                    --
                    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
                  • neoaggelos@...
                    Seams great, thanks for sharing!!! ... -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are
                    Message 9 of 17 , Jan 25, 2013
                    • 0 Attachment
                      Seams great, thanks for sharing!!!

                      On Jan 26, 2013, at 1:19 AM, Michael Hernandez <sequethin@...> wrote:

                      By the way, TPope's vim-unimpaired plugin has cool bindings for this and other stuff too, you may want to check it out!

                      --Mike H

                      On Jan 25, 2013, at 6:14 PM, neoaggelos@... wrote:

                      You're welcome. Glad to have helped you!

                      Sent from my iPod

                      On Jan 26, 2013, at 1:13 AM, Adolfo Olivera <olivera.adolfo@...> wrote:

                      Ok. I am an idiot. You are telling me to map shift-w to do this. 

                      Understood. Thank you.

                      On Fri, Jan 25, 2013 at 8:10 PM, Adolfo Olivera <olivera.adolfo@...> wrote:
                      Thanks. What does shift-w exactly does? From what I see it goes down a line?


                      On Fri, Jan 25, 2013 at 8:01 PM, <neoaggelos@...> wrote:

                      Hello List,
                                   Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  

                       

                      I guess mapping shift-w to do this would be great for fast switching

                      Add this to your vimrc

                      :map <s-w> <esc><c-w><c-w>

                      Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster. 

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



                      --
                      Adolfo Olivera
                      15-3429-9743





                      --
                      Adolfo Olivera
                      15-3429-9743


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

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

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

                      --
                      --
                      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
                       
                       
                       
                    • Andy Spencer
                      ... I also have alt+shift versions of each of those for moving windows and tabs rather than just focusing them. I also use the tab key to cycle through windows
                      Message 10 of 17 , Jan 25, 2013
                      • 0 Attachment
                        On 2013-01-25 19:57, Adolfo Olivera wrote:
                        > Does anyone have some examples on mappings to switch windows
                        > faster *CTRL-W, h and CTRL-W, l* ?

                        When I use win32 gvim I use:

                        :map <Alt+h> <C-W>h
                        :map <Alt+j> <C-W>j
                        :map <Alt+k> <C-W>k
                        :map <Alt+l> <C-W>l
                        :map <Alt+i> gT
                        :map <Alt+o> gt

                        I also have alt+shift versions of each of those for moving windows and
                        tabs rather than just focusing them. I also use the tab key to cycle
                        through windows a lot, but this works best with only a couple splits.

                        :map <Tab> <C-W><C-W>

                        When I use Linux, I have a real window manager and a real shell and
                        those sorts of things, which means I don't need Vim's tabs and windows
                        nearly as much as I do using win32.
                      • Ben Fritz
                        ... I would NEVER consider mapping , a.k.a. W which is the jump to the next WORD command in normal mode. My w key is one of the most worn on my
                        Message 11 of 17 , Jan 26, 2013
                        • 0 Attachment
                          On Friday, January 25, 2013 5:01:25 PM UTC-6, Aggelos Kolaitis wrote:
                          > Hello List,
                          >
                          >              Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?  
                          >
                          >  
                          >
                          >
                          >
                          > I guess mapping shift-w to do this would be great for fast switching
                          >
                          >
                          > Add this to your vimrc
                          >
                          >
                          > :map <s-w> <esc><c-w><c-w>
                          >
                          >
                          > Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster.


                          I would NEVER consider mapping <S-w>, a.k.a. 'W' which is the "jump to the next WORD" command in normal mode. My 'w' key is one of the most worn on my keyboard, the label is almost entirely gone.

                          --
                          --
                          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
                        • neoaggelos@...
                          Hmmm... You re right, but to my knowledge, W is the same as w. So, it can be used for that purpose... Well, that depends on each one s needs of course ... --
                          Message 12 of 17 , Jan 26, 2013
                          • 0 Attachment
                            Hmmm... You're right, but to my knowledge, W is the same as w. So, it can be used for that purpose...

                            Well, that depends on each one's needs of course

                            On Jan 26, 2013, at 6:44 PM, Ben Fritz <fritzophrenic@...> wrote:

                            > On Friday, January 25, 2013 5:01:25 PM UTC-6, Aggelos Kolaitis wrote:
                            >> Hello List,
                            >>
                            >> Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?
                            >>
                            >>
                            >>
                            >>
                            >>
                            >> I guess mapping shift-w to do this would be great for fast switching
                            >>
                            >>
                            >> Add this to your vimrc
                            >>
                            >>
                            >> :map <s-w> <esc><c-w><c-w>
                            >>
                            >>
                            >> Ctrl-w Ctrl-w is used to go to the next window mapping this to shift-w makes it faster.
                            >
                            >
                            > I would NEVER consider mapping <S-w>, a.k.a. 'W' which is the "jump to the next WORD" command in normal mode. My 'w' key is one of the most worn on my keyboard, the label is almost entirely gone.
                            >
                            > --
                            > --
                            > 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
                            >
                            >
                            >

                            --
                            --
                            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
                            Hi neoaggelos! ... It is not. See ... regards, Christian -- Die Weltanschauungen mancher Menschen gleichen lächelnden Festungen. -- Christian Morgenstern --
                            Message 13 of 17 , Jan 26, 2013
                            • 0 Attachment
                              Hi neoaggelos!

                              On Sa, 26 Jan 2013, neoaggelos@... wrote:

                              > Hmmm... You're right, but to my knowledge, W is the same as w. So, it can be used for that purpose...

                              It is not.

                              See
                              :h word
                              :h WORD

                              regards,
                              Christian
                              --
                              Die Weltanschauungen mancher Menschen gleichen lächelnden Festungen.
                              -- Christian Morgenstern

                              --
                              --
                              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
                            • neoaggelos@...
                              Well, then W is the same as and which work at normal, visual and normal mode. ... -- -- You received this message from the vim_use
                              Message 14 of 17 , Jan 26, 2013
                              • 0 Attachment
                                Well, then W is the same as <Ctrl-left> and <ctrl-right> which work at normal, visual and normal mode.

                                On Jan 26, 2013, at 11:37 PM, Christian Brabandt <cblists@...> wrote:

                                > Hi neoaggelos!
                                >
                                > On Sa, 26 Jan 2013, neoaggelos@... wrote:
                                >
                                >> Hmmm... You're right, but to my knowledge, W is the same as w. So, it can be used for that purpose...
                                >
                                > It is not.
                                >
                                > See
                                > :h word
                                > :h WORD
                                >
                                > regards,
                                > Christian
                                > --
                                > Die Weltanschauungen mancher Menschen gleichen lächelnden Festungen.
                                > -- Christian Morgenstern
                                >
                                > --
                                > --
                                > 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
                                >
                                >
                                >

                                --
                                --
                                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
                                Hi neoaggelos! Please don t top poste. ... The problem with ctrl is, it does not reliably work in all terminals. regards, Christian -- Man soll die lieben,
                                Message 15 of 17 , Jan 26, 2013
                                • 0 Attachment
                                  Hi neoaggelos!

                                  Please don't top poste.

                                  On Sa, 26 Jan 2013, neoaggelos@... wrote:

                                  > Well, then W is the same as <Ctrl-left> and <ctrl-right> which work at
                                  > normal, visual and normal mode.

                                  The problem with ctrl is, it does not reliably work in all terminals.

                                  regards,
                                  Christian
                                  --
                                  Man soll die lieben, über die man befielt, aber man soll es ihnen
                                  nicht sagen.
                                  -- Antoine de Saint-Exypery

                                  --
                                  --
                                  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
                                • darkweasel
                                  ... And in addition, the ability to use alphanumeric keys to move around is the very reason many people (at least me) use vim and not something like kate or
                                  Message 16 of 17 , Jan 26, 2013
                                  • 0 Attachment
                                    Am 2013-01-26 23:03, schrieb Christian Brabandt:
                                    > The problem with ctrl is, it does not reliably work in all terminals.

                                    And in addition, the ability to use "alphanumeric" keys to move around
                                    is the very reason many people (at least me) use vim and not something
                                    like kate or gedit or Notepad or TextEdit.

                                    regards
                                    darkweasel

                                    --
                                    --
                                    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
                                  • skeept
                                    ... I use the mappings nmap nmap this makes the movement between windows very convenient (tab + hjkl) but also other window
                                    Message 17 of 17 , Jan 26, 2013
                                    • 0 Attachment
                                      On Friday, January 25, 2013 5:57:30 PM UTC-5, Adolfo Olivera wrote:
                                      > Hello List,
                                      >
                                      >              Does anyone have some examples on mappings to switch windows faster CTRL-W, h and CTRL-W, l ?

                                      I use the mappings

                                      nmap <TAB> <C-W>
                                      nmap <TAB><TAB> <C-W><C-W>

                                      this makes the movement between windows very convenient (tab + hjkl) but also other window operations (close (c), quit (q), only (o), top (t), bottom (b), previous (p)). The list goes on...

                                      Of course if you do this you lose the ability of going back after using a <ctrl-o> jump.
                                      For that I have a command
                                      command! -count=1 Jump exe ":norm! <count>\<C-I>"

                                      so if I use ctrl-o I can use :Jump and go back.
                                      if you use <c-i> a lot you could define a mapping say ,i to act as <c-i>.

                                      Regards,

                                      Jorge

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