6
1
I have a Fresh Ubuntu installation. I have no personal dot-files active.
I run unsuccessfully \e file.sql
in Psql, when I have the following in my .bashrc, since Nano opens instead of Vim
export VISUAL=/usr/bin/vim
export EDITOR=/usr/bin/vim
export PSQL_EDITOR=/usr/bin/vim
I run the same command when I have vim in place of PATH/vim in .bashrc for the above three commands.
I get vim
when I cat $EDITOR
, for instance.
The problem is in environmental variables likely. However, I am not sure where.
How can you have Vim as Psql's editor?
1Ah, well if postgres is running as a different user then that would explain the problem with
~/.bashrc
too. Looks likeSELECTED_EDITOR
is yet another way of choosing an editor per-user, with priority betweenEDITOR
and the /etc/alternatives links (though my old Ubuntu 8.04 install doesn't honor it). If you want to set the editor system-wide then use the alternatives command I gave below. – jtb – 2009-08-03T05:16:47.6171I suppose Debian has real good reasons for things like "selected editor", "update-alternatives", and all those symlinks chasing themselves around the filesystem, but I remember when Unix meant a simple system you could rap your head around... Now if you'll excuse me, I have to go chase some kids off my lawn. :) – Richard Hoskins – 2009-08-03T06:19:12.507
I run your command
select-editor
. However, Emacs is now my default editor for some unknown reason, although I selected Vim. If I run the command again, the list shows that my default editor is Nano. I run the command withsudo
unsuccessfully. This suggests me that there is also some file manipulating the editor settings in Ubuntu. – Léo Léopold Hertz 준영 – 2009-08-07T12:29:30.723