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

Re: Mapping for switching windows

Expand Messages
  • 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 1 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 2 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 3 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 4 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 5 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 6 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 7 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 8 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 9 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.