Hacker News new | past | comments | ask | show | jobs | submit login

Sigh. Hit ‘up’, ‘left’ until at the ‘p’ and type ‘e’ and return.

One could also use <c-p>,<c-a> and <c-f> to achieve the same result much quicker.




Yup. The moment you need editing capabilities more sophisticated than those three keys, though, I recommend switching to vi input mode (set -o vi) if you are familiar with vim keybindings. Although tapping Esc is not as quick as Ctrl (or, my chosen alternative, Ctrl-[), you have an entire library of editing commands already at your beck and call. I find that using 'f' or 'F' and '.' more quickly triangulates the problem area of the text in most cases.

Of course, if you are an emacs user, more power to you with the emacs bindings.


IMO you might as well run "fc" (if you have vim set as your editor) in that case, rather than changing mode.


Or, if you already started editing a line, and decided that you'd rather finish it in a proper editor, you can press Ctrl+X Ctrl+E.


Didn't know that one, thanks.


I've grown fond of the new :term command in vim (inspired by neovim).


I prefer "grep !*", which will be replaced by all arguments to the previous command


True, I use that too, but gets trickier in the middle of the line.


As a for-your-consideration, C-r leaves the cursor at the matched string when doing reverse search; so "echo helol world", enter, mutter "rats", C-r, o-l-sp, right (just to break the search), and voila you are now positioned on the offending substring




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: