Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a reason some of VIM's motion commands are restricted to one line?

Tags:

vim

I'm beginning to learn VIM (I've downloaded an emulator plugin for my IDE) and unsurprisingly it's making me irritated and extremely slow. That is all fine and I realize it's a phaze everyone goes through.

However this one feature is quite frustrating - being unable to jump to the next line via l, previous with h or search more than one line with f.

Is there a valid, typing speed enhancing reason for this?

like image 974
raveren Avatar asked Oct 14 '22 01:10

raveren


1 Answers

You can make h and l wrap lines by adding h and l to the whichwrap option (:he whichwrap), although for the sake of compatibility with scripts and macros that don't expect h and l to wrap, you might want to avoid adding them, and add the < and > options instead (which allow the left and right arrow keys to wrap).

As for f (and F and t and T), they're just really not meant to do that, but you can use / and ? as movements -- d/foo<Enter> to delete everything between here and a following "foo" (whether it's on this line or a later one).

like image 133
hobbs Avatar answered Oct 18 '22 07:10

hobbs