Live data from Hacker News

Vim Splits – Move Faster and More Naturally

robots.thoughtbot.com

51–60 of 68 posts

Re: Vim Splits – Move Faster and More Naturally

#51
post #29
post #13

Earlier quoted context omitted.

I moved over to evil-mode (Vim emulation) in Emacs a couple of months ago and do most things the Vim way but some things are more efficient to do in a non-Vim manner and this is one of them. Although I use M-- and M-| for vertical and horizontal splits.

As someone who's been using vim for about 20 years, here are the problems I have with any vi/vim emulation modes in emacs: * Configuring emacs still requires learning a lot about emacs (which takes a lot of time). * These vi/vim emulation modes doen't touch SLIME's keybindings, afaik. So, to make them less finger-twisting will require manual rebinding (which takes yet more time). * Most emacs tutorials assume you're…

You are right on all points, I come however from 10 years of Vim and 15 years of Emacs so it is a natural fit.

Vim emulation modes are mostly for people who prefer a certain environment, like f.e. Emacs but want more efficient keybindings.

Re: Vim Splits – Move Faster and More Naturally

#52

I used to use splits, then I used tabs + splits, now I just use buffers. The only time splits come into it are for quickfix or diffs. Just get used to buffers. Lots of vim commands will work with buffers but not with splits or tabs. People new to vim will immediately jump on splits or tabs because of how their previous editor work flow worked, but you aren't going to unlock the full power of vim until you get used to…

:ls works too.

Re: Vim Splits – Move Faster and More Naturally

#53

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…

:vsplit . On this point, it's worth noting that users of the NERDTree plugin[1] can set it to work with the above style of use as well: " Replace netrw with secondary NERDTree let NERDTreeHijackNetrw=1 [1] https://github.com/scrooloose/nerdtree/

Thanks for this, I was searching for this exact thing the other day and couldn't find it.

Re: Vim Splits – Move Faster and More Naturally

#54
post #9

Earlier quoted context omitted.

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 code on a Macbook, and I actually use say... Option+i, e in order to get ê. That works inside Vim, too, I just found out. Obviously not very helpful to people not on a Mac, but I don't have to go through Alt mappings at all.

The point of my comment is that with an imap on , you can't input the character ê because it will trigger the mapping. This includes option+i, e on OS X.

Re: Vim Splits – Move Faster and More Naturally

#55

Earlier quoted context omitted.

It's worth noting that :vsplit can and should be shortened to :vs Also, depending on how you like to work, keeping a stable working directory can be very useful: :vs **/bar is somehow less mentally taxing than: :vs ../../models/bar.php

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.

    :h starstar
roughly means the same thing as -r or -R.

Re: Vim Splits – Move Faster and More Naturally

#56

Earlier quoted context omitted.

It's worth noting that :vsplit can and should be shortened to :vs Also, depending on how you like to work, keeping a stable working directory can be very useful: :vs **/bar is somehow less mentally taxing than: :vs ../../models/bar.php

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.

Re: Vim Splits – Move Faster and More Naturally

#58

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…

Your last tip is a gem! Combined with :10sp, it's the perfect recipe for a mini-TODO list.

Re: Vim Splits – Move Faster and More Naturally

#59

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.

Wow. I did not think vim help would deal with symbols well, either. Thanks!

Re: Vim Splits – Move Faster and More Naturally

#60

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

To switch b/w tabs, I find Ctrl + PageUp/PageDown a lot more convenient, since it's also standard in Browsers/other text editors. :D
Post reply on HN