Guys, anyone know how to change linux console editor from vi into vim everytime we execute vi? I'm using Ubuntu and Fedora Core
|
feedback
|
migrated from stackoverflow.com Aug 21 '09 at 10:42
This question came from our site for professional and enthusiast programmers.
|
First, make sure you have the proper Vim packages installed. The default on many systems is to install a minimal Vim package that is closer to Vi in functionality. On Red Hat based systems (RHEL, CentOS, Fedora), you need the vim-enhanced package, for example from a CentOS system I have installed:
'common' contains common libraries used by all the Vim packages. 'minimal' is the plain vi editor executables as installed by default. On Debian based systems (like Ubuntu), you need 'vim'. For example:
These should be installed by default. On Debian/Ubuntu, you can update the default system editor for all users:
Select the version you want from the selection menu. Post installation scripts for the vim package should have already updated this, though. Use Finally, on a per user basis for any distribution, set up an alias in the user profile. For example if the shell is bash, edit ~username/.bashrc:
Also, you may check the system vimrc (/etc/vimrc, usually) to see if compatibility mode is turned on.
Will tell Vim to behave more like old-school Vi, no matter how you've handled using Vim per above. Change to 'nocp' or 'nocompatibility' to make Vim more useful. | |||||
feedback
|
|
In your .bashrc:
| |||||||
feedback
|
|
If it is a Debian or Ubuntu system, and you want to make this change system wide, you should use | |||
|
feedback
|
|
If you need the changes only for your id, and within a terminal session: alias vi to vim as suggested by AI. If you want a system-wide change on your machine, soft-link to vim in /usr/local/bin:
Note: Programs can ignore any aliases on vi by running | ||||
|
feedback
|
|
Some dists use vim:s old school mode where it behaves like vi. check if your .vimrc contains
I have been fooled by this a couple of times.... | |||
|
feedback
|
|
On Debian systems, when you execute the default vim-tiny as 'vi', a different RC file is used - /etc/vim/vimrc.tiny. To make 'vi' act more like 'vim', edit /etc/vim/vimrc.tiny and change the line:
to read:
| |||
|
feedback
|
vito classic mode in VIM. – Seh Hui 'Felix' Leong Aug 21 '09 at 10:45