by sudonim · 14y ago · 0 comments
I started my vim experience using Janus
But I didn't understand how anything worked or why any of the plugins were there.
That led me to starting from scratch (I forked my cofounder's dotfiles) and now I feel like I know my vim config waaaay better. If you've been using janus, I'd highly recommend giving the ground up strategy a shot.
One day I was SSH'd into a remote server and vim'd a directory by accident and I discovered Netrw. It wasn't the same as NERDTree, but it was good enough for me to get rid of that plugin. Eventually I just learned to enjoy the defaults with minor tweaks. Today my vimrc[1] is < 200 lines, mostly comments and navigation shortcuts.
I was looking for the rightbelow this, found it in your vimrc. Found it weird you don't have wildmenu...
See :help netrw_browse_split for other options.
P " Disable arrow keys
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
It'll be super annoying for the first day or two, vexing for the rest of the week, then you'll just forget it's even there.Staying on the home-row vs having to move your hand over and back constantly affects your speed and accuracy in a big way.
Here's an easy way to switch: never, ever use the arrow keys to move the cursor again. Done!
inoremap <Left> <NOP>
inoremap <Right> <NOP>
inoremap <Up> <NOP>
inoremap <Down> <NOP>See? the arrow key scan become four more user keys, and they have easy to remember direction/orientation if you need it. Having trouble navigating, swapping, and resizing, your layout (and accidentally hosing text with ^w in the wrong mode? I did, but 20 minutes after seeing someone else use a similar setup, I was using my own variant more comfortably than any console window management bindings I'd ever tried before.
tl;dr; Remap the arrow keys from movement to anything you struggle with normally, and be amazed how you survived before your four newest "user" keys were liberated!
(Also, if anyone wants me to, I'd be happy to post my re-binding config lines as a template/sample.)
Lots of people say they are faster using motion commands, and I know I use search motions 85% of the time. But if I want to go somewhere that's visible on the screen, the mouse is almost always quicker. And I've used vi and derivatives for 20+ years now (although obviously they initially didn't have mouse support :-)).
Similar for hjkl, especially if you use single cell motion mixed with whole page motion (Fn-arrow on a macbook), I just don't see hjkl + ^D^U being quicker. It seems more like something that might be useful every once in a while, but not terribly useful 100% or even 50% of the time.
EDIT: And the book says this:
"type the number of characters or lines you want the cursor to move, followed by h, j, k, or l. This technique cannot be used with the arrow keys: left, right, up, and down."
Which is not correct.
Really, more things just need vi-like interfaces :(
I figured out that when you're in the learning stage with vim, you should always be editing your dotfiles because that's a big part of progressing up the learning curve.
I love reading other people's vimrc as I usually always find something new that I'm willing to try out. Mine is here in case someone wants to take a look: https://github.com/PatrickLerner/dotfiles/blob/master/vimrc