News for hackers. Stuff that matters.
Re:To understand the command line... by scott_s on Monday October 01, 2012 @10:59AM (#4597347)
I continue to use 'hjkl' to navigate in vi(m) because using the arrow keys requires me to move my whole arm. This is an awkward movement that requires time for my fingers to find the arrow keys. When using 'hjkl' to navigate, my right hand is always on home row, ready to either navigate or start typing. When typing in non-vi text boxes (such as this one), I do this movement, but I don't like it.

I do have an inefficiency: I move my hand for the escape key (which I should remap to caps lock, but I've never gotten around to it in the past decade), but I pivot at the elbow. It's far less awkward.

Re:To understand the command line... by weaksauce on Monday October 01, 2012 @12:03PM (#4597711)
Try:

inoremap jj <Esc>

In insert mode you just press j twice and you get out of insert mode. This is my favorite key remap in vim.

You can put that in your .vimrc file or just try it out from the command bar.

Re:To understand the command line... by ImprovedSilence on Monday October 01, 2012 @12:18PM (#4597813)
I started using inoremap jk <Esc>

I'm not sure why, but I found it to be more fluid for me?

Re:To understand the command line... by weaksauce on Monday October 01, 2012 @01:25PM (#4598221)
I have both in my rc file but I end up using jj 99% of the time. jk does feel pretty fluid though.
Re:To understand the command line... by jh3 on Monday October 01, 2012 @12:36PM (#4597922)
Try jw.
Re:To understand the command line... by rawland on Tuesday October 02, 2012 @01:30AM (#4600711)
inoremap jj <Esc>

Same solution here. This favors people who tend to move from top to bottom during skimming a piece of code utilizing the j-key to move further down, which then let's you automagically exit EDIT-mode. Happens to me every fourth/fifth time.

Earlier it was more often. However, as skills develop I increasingly rarely use the hjkl-keys.

These days vim is placed at the end of a git/grep toolchain and most likely I tend to "/\v" for something or move more like "45j" directly to the place in focus (relativenumbers are your friend). Being in a row the natural tendency now is to jump with "f" or "F" and repeating with ";" if necessary.

If you passed this milestone already, your opinion is highly welcome!

Re:To understand the command line... by weaksauce on Tuesday October 02, 2012 @01:16PM (#4603067)
I like to use hjkl for very short moves, wb for most moves in a sentence, "IA" for insert moves to the start or end of a line. I don't find f to be that useful because I don't like the thought required to figure out what letter I want. I guess it's just a personal preference though.

larger moves are a mix of the {}() and /\v if I know what I am looking for by name. c-f c-b is nice if I am just browsing the code.

Re:To understand the command line... by scott_s on Monday October 01, 2012 @03:07PM (#4598779)
It's not the act of doing the remapping. It's accepting that I'll have to retrain my brain.
Re:To understand the command line... by qu4z-2 on Monday October 01, 2012 @10:23PM (#4600371)
inoremap <ESC> <NUL> gets you in the habit pretty fast.
Re:To understand the command line... by weaksauce on Monday October 01, 2012 @05:05PM (#4599338)
True. Though, it gets better quickly and then it's quickly a net plus.
Re:To understand the command line... by jvm on Monday October 01, 2012 @06:05PM (#4599595)
Remap caps lock to escape. After I did this I realized Esc is a really useful key in a wide variety of contexts.
Re:To understand the command line... by mattengi on Monday October 01, 2012 @09:06PM (#4600205)
make capslock to contorl, then use xcape

https://github.com/alols/xcape

now capslock does both ctrl and escape

best settings ever!

Re:To understand the command line... by tammer on Tuesday October 02, 2012 @03:38AM (#4600942)
Great idea, thanks!

I've dealt with this by switching ctrl and alt - I find hitting alt with my thumb is far less strenuous than reaching for ctrl with my pinky.

I may give xcape a shot, however.

Re:To understand the command line... by jvm on Tuesday October 02, 2012 @06:49PM (#4604810)
Man does that ever look awesome
Re:To understand the command line... by kmm on Monday October 01, 2012 @07:04PM (#4599809)
One of the best ideas I ever had. Caps Lock is one of the biggest keys on my keyboard and close to the rest. It would be a waste to use it for a single, rarely-used function.
Re:To understand the command line... by dredmorbius on Thursday October 04, 2012 @03:10AM (#4611254)
Capslock is already ctrl.

Now, I could dmap ctrl-l to esc. But I'm so used to the high-left pivot for 'esc' on Thinkpad keypads (and it's a tall key making for an easier target) that it's not worth the bother.

Re:To understand the command line... by ephemient on Monday October 01, 2012 @03:30PM (#4598915)
After switching between keyboards with Esc in different places, I've learned to use

    Ctrl-[
instead. Can hit it without moving that far, and it works just as well in GVim as it does in all terminal programs.

The only downside is being confused when nothing happens in a browser...

Re:To understand the command line... by pestaa on Monday October 01, 2012 @03:41PM (#4598969)
I learnt that `Ctrl-W` removes a whole word backwards in vim and the terminals.

The only downside is being confused when

Re:To understand the command line... by mateuszf on Monday October 01, 2012 @02:15PM (#4598504)
You could use Ctrl+C which works great for getting out of insert mode. Also Ctrl+J can be used instead as Enter. It also does work great in bash/zsh. It took me some time to switch but it was totally worth it. Caution: Switching caps lock with control was needed as prerequisite.
Re:To understand the command line... by qu4z-2 on Monday October 01, 2012 @10:26PM (#4600378)
The downside of ^c is that it doesn't trigger an InsertLeave event or abbreviations. Which can be a pain, or exactly what you want, depending on the occasion.
Re:To understand the command line... by s00pcan on Monday October 01, 2012 @05:08PM (#4599355)
Remap caps lock to control and use ^c or ^[