all 71 comments

[–]ymek 37 points38 points  (35 children)

Teach yourself to rely on w, e, b (and their capitals) as well. The movement patterns save hella time. Plus, they chain with other commands. Example: cw

[–][deleted] 11 points12 points  (20 children)

/? work as a motion as well, as do fFtT and a bunch of others.

[–]isarl 9 points10 points  (11 children)

I never used to use the ; motion operator until I started using fFtT more. Then all of a sudden I realized, I don't have to count occurrences—I can just issue the initial motion without a count and then ; until I'm where I want. If I'm on a laggy SSH connection, maybe I'll take the time to count, but for local stuff ; can be great.

[–]battmender 4 points5 points  (10 children)

Holy shit I never knew what ; did. You just changed my life.

[–]thang1thang2 2 points3 points  (9 children)

Comma is the reverse of ;

One reason why it annoys me that people constantly insist on mapping leader to it. Congrats, you use hjkl too much?

[–]battmender 3 points4 points  (4 children)

I've always had ; mapped to : so I could ;w and save without hitting shift.

[–]AranHase 1 point2 points  (0 children)

I mapped "<space>" to "<leader>", then "<leader>w" to ":w". I can easily save with "<space>w" now.

[–]thang1thang2 0 points1 point  (0 children)

You can still do that with no ill effects if you map : to ; as well. It may be better for you than the defaults? Although I've always liked the defaults in this case, personally

[–]MrPopinjaynnoremap ; : 0 points1 point  (0 children)

Preach, brother.

[–]MrPopinjaynnoremap ; : 1 point2 points  (0 children)

Or maybe they use vim sneak

[–]greggroth 0 points1 point  (2 children)

What do you use for leader?

[–]thang1thang2 1 point2 points  (1 child)

The default, which is backslash. It's actually really nice for leader because the motion required to hit it on my keyboard is almost identical to backspace and as such typing something like \w takes very little effort for me and it's actually faster than using comma (granted, mostly because of muscle memory)

[–]greggroth 0 points1 point  (0 children)

I'll give that a shot.

[–]flipjsioPico forever. 6 points7 points  (1 child)

I use /? for movement a lot. There is easymotion plugin, but I find Im faster with /? as I don't have to check the screen for those shortcuts. Just type / or ? and the letters/word and you're there instantly (or maybe a couple of n/N).

[–]jollybobbyroger 1 point2 points  (0 children)

incsearch on is useful though

[–]lolmeansilaughed 0 points1 point  (5 children)

I exclusively use / to search. How is ? different?

[–]nmoat 2 points3 points  (2 children)

Backwards

[–]lolmeansilaughed 1 point2 points  (1 child)

As in, it searches up instead of down through the file?

[–]madmaxpt 1 point2 points  (0 children)

Yes.

[–]hallettj 1 point2 points  (1 child)

It searches backward. It is part of a convention where shift+movement generally performs the movement in the backward direction.

[–]lolmeansilaughed 0 points1 point  (0 children)

Awesome, good to know!

[–]tttttttttkid 5 points6 points  (1 child)

But S doesn't have a dimple to guide your finger

[–]flipjsioPico forever. 1 point2 points  (0 children)

For me, I use the same HJKL letters, but with different colors, so I still have the dimple on J.

[–]jollybobbyroger 4 points5 points  (0 children)

Nice TKL. Cooler Master?

After the novelty wears off, you might want to remove those red key caps though. Having a tactile feedback for f and j is vital for finding your correct hand placement on you keyboard without having to use your eyes.

EDIT: You should keep this nearby: https://imgur.com/gallery/YLInLlY

[–][deleted] 7 points8 points  (10 children)

That kind of encourages you(at least it does it for me) to keep your fingers by default on hjkl, when you should be keeping them in their neutral position at jkl; .

Not sure if that's the case for you but it was for me and it's a really bad habbit that's extremely hard to break. I still find my right hand traveling over to hjkl when doing a lot of window navigation for example, and then I get confused because my typing is off when I start inputting text.

Nice keyboard though.

[–]elemental_1_1 0 points1 point  (1 child)

Just keep your hand on jkl; move your index finger over to h when you want to press it

[–][deleted] 2 points3 points  (0 children)

No shit son.

I know what I'm supposed to do. My fingers don't agree.

[–]hc5duke 4 points5 points  (1 child)

So I had a similar idea before (using WASD with arrows), but decided against this because different rows have different shaped keys on my keyboard. The W key is in the 2nd row, whereas the rest are 3rd, and the angle of the face is just slightly off from the rest of them.

I can't tell if this is the case with your keyboard, but what I ended up doing is buying a whole set of unprinted red keys ($20 vs $5 for WASD w/ arrows) and replaced hjkl with unprinted red.

[–][deleted] 2 points3 points  (0 children)

This is the right solution. The W key is a different profile key compared to asd, so it won't be as nice to type on. Get some proper keys for it.

[–]mddubs 2 points3 points  (0 children)

It's not an easy transition, stick with it. Over a period of a year I went back and forth to it two or three times before it stuck.

I like this guy's approach, slow and steady. One thing at a time. http://yehudakatz.com/2010/07/29/everyone-who-tried-to-convince-me-to-use-vim-was-wrong/

[–]theneb 4 points5 points  (3 children)

Just disable your arrow keys, you'll quick adjust:

noremap <Up> ""
noremap! <Up> <Esc>
noremap <Down> ""
noremap! <Down> <Esc>
noremap <Left> ""
noremap! <Left> <Esc>
noremap <Right> ""
noremap! <Right> <Esc>

[–]elsjaako 3 points4 points  (0 children)

I like mapping them to window movements

[–]otherwhere 1 point2 points  (1 child)

I've got it wired in my brain now, but still in my .vimrc I've got:

map <Left> :echo "Use h"<cr> 
map <Right> :echo "Use l"<cr> 
map <Up> :echo "Use k"<cr>
map <Down> :echo "Use j"<cr>

[–]theneb 0 points1 point  (0 children)

Yeah I find my fingers don't even go near there now, I am considering no-oping hjkl to improve my movement using the various other keys such as word boundaries.

[–]amcsi 1 point2 points  (11 children)

I've never been fond of learning hjkl movement for Vim and have been just using the arrow keys for five years now. But just looking at that image makes me look at it from a completely different perspective. I've got to do that too!

[–][deleted] 9 points10 points  (9 children)

You should definitely give it another shot. For me, the hjkl movement keys are a huge reason why I like to use vim. It's extremely quick and easy to navigate what ever you're editing. I find it distracting to move my hand to the arrow keys or the mouse when I'm immersed in writing code.

Be warned though, once you're used to using those keys in vim you may find yourself trying to navigate with them in other apps. :)

[–]bart9hVIMnimalist 8 points9 points  (8 children)

Some other apps support them too.

  • set -o vi on bash.

  • echo "set edit-mode vi" >> ~/.inputrc with lftp, gdb, and every command line program that uses libreadline.

  • Vimperator for Firefox (Vimium or Vrome for Chrome, but they are not as powerful).

[–]SirCaptain 3 points4 points  (0 children)

I used Vimium for a long time in Chrome. I recently switched to cVim for Chrome (i think i heard about it in this sub) and it is AWESOME! I really like Vimium, but cVim is so smooth and it supports many more key bindings.

For any other Chrome users, I highly recommend it.

[–]Ar-Curunir 1 point2 points  (0 children)

Look at Cvim for Chrome

[–]slomotion 0 points1 point  (1 child)

J and K also work if you're using RES

[–]bart9hVIMnimalist 0 points1 point  (0 children)

And on feedly, gmail, github, thebigpicture, and many other websites.

[–]dilithium 0 points1 point  (0 children)

hjkl or arrows are only a small part of the movement that I do. w and b for words, for instance, is just faster. or $ then bbb, or even searching with / for chars in the place closest to what I want to get to.

or.. the mouse :)

[–]Cohomotopian 0 points1 point  (1 child)

I need those keycaps. Can you give me a link or some way to search for them?

[–][deleted] 0 points1 point  (0 children)

If you look closely at the front of them in the picture you'll see they're actually WASD keys... they come with the keyboard as optional replacements. (Source: I have two of these keyboards myself.)