Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



TWEAKING VI


We can add some personal tweaks to the vi editor, making editing just a bit easier.
Remember on page 5 the important config files ? Remember ~/.exrc ? That is one we will tweak.
The ~/.exrc file stores the settings for the vi editor, I like my vi to number the lines, so if I get an error message that on line 26 there is a conflict I can easily find it, also I like to see the mode vi is in.
So I use 1 and 5 from this list: ( this list is over-complete, but just pick the ones you like )

set number
set ap
set autowrite
set showmatch
set showmode
set redraw
set nu
map ^X :set backup="%~"
set noskipdisplay
set displayencoding=euc-jp
set inputencoding=euc-jp
set fileencoding=euc-jp
set autodetect=jp+
map S :r ~/.signature


Here is how you do it:

CODE
$ vi .exrc

"i"
set number
set showmode
< Esc >
"ZZ"

The next time you start your favorite editor the .exrc will be used.


Bruno


-- May 6 2003 ( Revised Dec 13 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email