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

Use `set -o vi` to get vi navigation commands on the command line.

EDIT: In bash, that is. It's `bindkey -v` in zsh.



Do it in .inputrc like this:

set editing-mode vi

Now any executable that uses readline will have vi editing commands on its command line. mysql, psql, etc.

Do as much of your command line editing configuration in .inputrc as possible, and you'll have it everywhere.

EDIT: man readline


set -o vi works in zsh as well.




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: