Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While I'm still not going to bother with vi, I do have to admit this is probably just another one of those not-widely-known things about "Unix" which deserves some attention. God knows I didn't know about it.

Other cute things I have discovered lately: You can actually click in ncurses dialogs running in your terminal, even over SSH, if you run a proper terminal. Coming from a PuTTYish background, that is definitely not obvious ;)



And, if you've set -o vi in bash (etc?), when you're editing a command line and need more than just the limited set of vi commands that make sense on a command line, do this:

esc v

esc gets you out of input mode, and v takes the current command line that you're editing and opens a full vi/vim session initialized with the command line. After you're done editing it, :wq quits vi and executes the command. If you change your mind, delete everything in the buffer and then :wq

This is handy if you're editing a biggish command, particularly one from recent history like a loop or anything with a block.


`set -o vi` is a POSIX shell feature.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: