2

psql, the PostgreSQL CLI, uses readline for it's user interface. Readline allows both emacs- and vi editing mode, and psql uses emacs mode by default. I, on the other hand, use vi for everything; is there a command for setting vi editing mode in psql?

2 Answers 2

4

You just have to configure readline appropriately. Create a file .inputrc in your home directory with the following content:

set editing-mode vi
1
  • This is obiously the answer! Thx
    – j4nd3r53n
    Commented Nov 21, 2021 at 13:07
0

In case, you don't run the psql on your machine, it's enough to press Ctrl+Alt+J for the session (taken from redit).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.