vi-mode everywhere is possible
readline vi-mode
If you like to use your shell in vi mode, it's very likely you also love to have a vi-mode in psql and mysql or just everywhere. This is achievable if the tool of your choice can be compiled with readline support. Just check ldd if it is the case:
$ ldd `which psql` | grep readline libreadline.so.6 => /lib64/libreadline.so.6 (0x0000003ad1000000)
If so, you can enjoy using vi-mode in psql by enabling the readline vi-mode:
echo 'set editing-mode vi' >> ~/.inputrc
This enables vi-mode for all commandline tools linked against readline. Interestingly it also enables a more advanced tab completion in mysql. DESCR<tab> will now expand to DESCRIBE for example.
5 Aug 2011, 22:15
by Julian
| Updated at 6 Aug 2011, 13:40
| Tags:
Postgres
readline
vi
| There are 0 Comments