Vim logo vim online Vim Book Ad

basic Tip #175: how to make VIM as ur default editor even without root ac.

 tip karma   Rating -1/17, Viewed by 772 

created:   December 6, 2001 10:53      complexity:   basic
author:   bhaskar      as of Vim:   5.7

hi,
if u have installed vim in your home directory somewhere
and u don't have a root account, and you want to
make VIM the default editor for anything u do.
i.e if ur using SQLplus and want to edit a sql command.
normally typing edit brings up the vi editor and not vim editor.
to solve this problem.
define these three variables in your .profile
VIM=<base directory where vim executable is placed>
VIMRUNTIME=<base direcoty where vim runtimes are kept>
EDITOR=$VIM/vim

note if u have installed vim with another name, say vim.exe then
change EDITOR=$VIM/vim to EDITOR=$VIM/vim.exe

source the .profile and viola. next time u start an editor from any
program u have the vim editor.

Njoy.

 rate this tip  Life Changing Helpful Unfulfilling 

<<Footnotes | Autocheckout from perforce >>

Additional Notes

[email protected], December 9, 2001 6:41
This tip might be more useful if translated into English.
Anonymous, December 10, 2001 14:17
Notable programs which use the $EDITOR variable include CVS and Mutt.  Anyone care to add to the list?
[email protected], August 15, 2002 23:35
$EDITOR is The place to have your editor defined. There's also $VISUAL to define a non-line oriented editor (which is actually vi's place).
All programs on unixlikes spawning editors should support these. Some have reasons not to and some are just stupidly made and others stupidly configured.
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo