Live data from Hacker News

Vim Splits – Move Faster and More Naturally

robots.thoughtbot.com

61–68 of 68 posts

Re: Vim Splits – Move Faster and More Naturally

#62

Earlier quoted context omitted.

Can you point me to docs on in file searching? Those symbols are predictably hard to google. Based on a little messing around, it appears that * is what I expect from bash, and can also include directory separators.

Google is not the right place to search for help: Vim comes with an extensive and easily searchable documentation. :h ** is all you need to get your answer.

Google helps when you don't exactly know what's the name of the thing you're looking for. That's in my case 85% of all searches.

Re: Vim Splits – Move Faster and More Naturally

#63
post #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

[deleted]

Re: Vim Splits – Move Faster and More Naturally

#64
post #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

I think I solved that problem quite elegantly :) However I still have a small TODO regarding printing from cygwin:

    set encoding=utf-8
    " TODO check if printing of utf-8 chars works with 'set fileencoding=utf-8'
    set fileencoding=utf-8


    " {{{ Diacritic characters: char (keyboard switching doesn't work in cygwin)
    " Use the same keys as on a keyboard
    inoremap ; ö
    inoremap : ö
    inoremap ' ä
    inoremap " Ä
    inoremap [ ü
    inoremap { Ü
    inoremap - ß

    " Comment/Uncoment following as you need:
    "inoremap `A Á
    "inoremap `Ae Ä
    "inoremap `C Č
    "inoremap `D Ď
    "inoremap `E É
    "inoremap `I Í
    "inoremap `Ll Ĺ
    "inoremap `L Ľ
    "inoremap `N Ň
    "inoremap `O Ó
    "inoremap `Ou Ô
    "inoremap `R Ŕ
    "inoremap `S Š
    "inoremap `T Ť
    "inoremap `U Ú
    "inoremap `Y Ý
    "inoremap `Z Ž
    "inoremap `a á
    ""inoremap ` ä " defined already
    "inoremap `c č
    "inoremap `z ž
    "inoremap `e é
    "inoremap `i í
    "inoremap `l ľ
    "inoremap `n ň
    "inoremap `o ó
    "inoremap `ou ô
    "inoremap `r ŕ
    "inoremap `s š
    "inoremap `t ť
    "inoremap `u ú
    "inoremap `y ý
    "inoremap `z ž
    " }}}

Re: Vim Splits – Move Faster and More Naturally

#65
post #62

Earlier quoted context omitted.

Google is not the right place to search for help: Vim comes with an extensive and easily searchable documentation. :h ** is all you need to get your answer.

Google helps when you don't exactly know what's the name of the thing you're looking for. That's in my case 85% of all searches.

You could try :helpgrep foo next time.

Re: Vim Splits – Move Faster and More Naturally

#67
If you use splits a lot, you might be interested in the Golden Ratio plugin. It resizes the active window to be about (user-definable) two-thirds of the screen. So you jump between windows and get max screen space for the one you're working on.

Sometimes you don't want it, so you can toggle it off.

http://www.vim.org/scripts/script.php?script_id=3690

Re: Vim Splits – Move Faster and More Naturally

#68

Mastering window splitting and tabbing allows one to truly step into the flow that Vim has to offer. However, it doesn't stop at simply dealing with opening files in new panes. :vsplit . I use this all the time when I need to find a file or I'm not sure where something is. It just opens the file browser in a new window split. It's extremely handy. Once you've got it open, it's important to note that you can use your…

I love using splits, but your `set autochdir` tip is amazing. I hadn't know about it before today. Thank you!

If you like 'set autochdir', then you should try this plugin https://github.com/amiorin/vim-project
Post reply on HN