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

POSIX specifically calls out "set -o vi" for any and all compliant shells.

The .inputrc is specific to readline, and will not be honored by libedit (used extensively on MacOS and BSD-centric systems).

"vi: Allow shell command line editing using the built-in vi editor. Enabling vi mode shall disable any other command line editing mode provided as an implementation extension. It need not be possible to set vi mode on for certain block-mode terminals."

The standard does not specify an emacs option.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V...



Bash uses readline, so setting it in .inputrc would be sufficient for bash, but it will also get applied to other apps using readline like gdb. Setting an .inputrc also allows you to configure other niceties like colored-completion-prefix and colored-stats [0].

There's certainly no harm in doing both 'set -o vi' in shell rc and 'set editing-mode vi' in .inputrc

[0]: https://wiki.archlinux.org/title/Readline#Colorized_completi...


Well, the impact of .inputrc is going to hit anything else linked with it.

Your Postgres psql client will switch to vi mode, which might not be what you intended.

And if a day comes that dash gets linked to libedit on Debian/Ubuntu, only the POSIX standard command will have the desired effect.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: