Sponsored Links

Maxabout.com > Tips

Tweaking Vi

Added on:9/6/2008 12:13:31 AM
In Linux Tips
 Rated by 1 users

    We can add some personal tweaks to the vi editor, making editing just a bit easier.
  1. 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.

  2. 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

  3. 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.


Sponsored Links
Tools
Bookmark/Discuss