Postgres external editor does not execute savequit request

It confuses me a little. I am trying to edit a query using \epostgres, but after saving :wqnothing happens. The launch \p, which shows that the editor has saved, just appears an empty line or everything that I started recently in Kli. It seems that the editor is not saved.

I use vim as my default editor and I am on psql version 9.5.4. OSX operating system and I use iterm2. The only similar problem that I could find on the Internet was here , and no advice there helped.

All ideas are welcome!

EDIT: Found a problem. It had something to do with my vim - everything worked when I set up my editor on Pico, so I exposed my vimrc and slowly re-read it. Oddly enough, when everything was again, he continued to work. So check if it works with another editor!

+4
source share
2 answers

I don’t know why, but it seems that you need to set an environment variable for this $EDITOR.

Run psql as follows:

EDITOR=vim psql ...

Or a longer term, add

export EDITOR=vim

on your .bashrcor equivalent.

0
source

, vim, . , , , .

~/.profile :

export PSQL_EDITOR="vim -u NONE"

Janus ( .vimrc.before .after, vim.


:

0

All Articles