Live data from Hacker News

Vim Splits – Move Faster and More Naturally

robots.thoughtbot.com

1–10 of 68 posts

Re: Vim Splits – Move Faster and More Naturally

#2
In addition to that, I can heartily recommend the ZoomWindowPlugin:

https://github.com/skeept/dotvim/blob/master/plugin/ZoomWinP...

Basically, if you have multiple split windows, it allows you to do a cmd+O to zoom the current split view (i.e. making it the only view visible). That's neat if there's something tricky going on (say a weird bug) and you want to focus just on this piece of code, without seeing anything else. Once you're done, you can hit cmd+O again, and your old split setup comes back. I love this plugin.

Re: Vim Splits – Move Faster and More Naturally

#4
I have mapped the Tab key to move between split windows. I also mapped Ctrl+T to open a new tab, and CTRL-H and CTRL-L to move to the left/right tab respectively. It works well and seem pretty natural. I suppose if I had a giant monitor I could use more splits, but realistically more than two of them feels very cramped. My .vimrc is here: https://raw.github.com/ipartola/ipartola-bash-and-vim/master...

The relevant parts are:

  " shortcuts
  map  
  
  " Tabs
  map  :tabnew
  map  :tabnext
  map  :tabprevious

Re: Vim Splits – Move Faster and More Naturally

#6
After years of abusing my little finger for using Ctrl & the RSI that goes with it, I tend to use alt/meta with my thumb more and more nowadays, for this I make it usable in insert mode also, this is probably one of the oldest bits of my .vimrc

    "quick window movements
    map   
    map  l
    map  k
    map  j
    map  h
    imap  li
    imap  ki
    imap  ji
    imap  hi

Re: Vim Splits – Move Faster and More Naturally

#8

In addition to that, I can heartily recommend the ZoomWindowPlugin: https://github.com/skeept/dotvim/blob/master/plugin/ZoomWinP... Basically, if you have multiple split windows, it allows you to do a cmd+O to zoom the current split view (i.e. making it the only view visible). That's neat if there's something tricky going on (say a weird bug) and you want to focus just on this piece of code, without seeing anything e…

Any advantage to this plugin over mapping one key to ':tabopen' and another to ':tabclose %'? I have this in my .vimrc and it seems to get the same results:

  nmap  :tabedit %
  nmap  :tabclose

Re: Vim Splits – Move Faster and More Naturally

#9
post #6

After years of abusing my little finger for using Ctrl & the RSI that goes with it, I tend to use alt/meta with my thumb more and more nowadays, for this I make it usable in insert mode also, this is probably one of the oldest bits of my .vimrc "quick window movements map map l map k map j map h imap li imap ki imap ji imap hi

Only problem with those imaps is that now you can't type ì, ë, ê, or è. Vim is pretty dumb about utf-8.

I'd also suggest using instead of the ...i dance.

Edit: "The way [Vim] stores alt+letter in its input queue collides with UTF-8/Unicode handling" -- LeoNerd in freenode/#vim at 2013-04-15 15:22:29

Post reply on HN