*this
home about contact feed
projects
vagra vaBlo
categories
C++(7) Solaris(4) tntnet(3) vi(3) Linux(2) DeleGate(2) Postgres(2) proxy(2) cxxtools(1) regex(1) readline(1) dtrace(1) gcc(1) MeeGo(1) ssh(1) firefox(1)

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.

Write comment