logoalt Hacker News

dbtclast Thursday at 4:42 PM1 replyview on HN

I use vim a lot but not on the shell

A mistake 3 words earlier?

meta-bbbd (not as elegant, I admit)

delete the whole thing?

ctrl-ak (this is even quicker than vim, especially if capslock is mapped to ctrl)

the control-based emacs movements work system-wide on macos btw. I am using ctrl-p and ctrl-n to go up and down lines, ctrl-a and ctrl-e to go to beginning and end of lines while writing this comment in by browser (which has vimium extension)

Sometimes I wish vim just had full emacs bindings while in insert mode. But I don't like to mess with defaults too much.

I keep thinking I should give vim readline a try though, so maybe today. Thanks for the comment.


Replies

sanjayjcyesterday at 4:53 AM

> "delete the whole thing?"

With vi (after running "set -o vi"): <esc>kC

(k to move up back one position in history. C to "change" to the end of the line.)

This is equivalent to doing the following with "set -o emacs": <ctrl>pu

Regardless, use what you're comfortable with or can incrementally add to your muscle memory.