" ================================================================ " Ex/Vi Setup File (for all Vi Clones) " ================================================================ " Filename: $HOME/.exrc " Size: exactly 10,000 bytes. " Last update: Wed Oct 01 05:55:55 CEST 2003 " Available: http://www.guckes.net/setup/exrc/ " Purpose: Setup file for "ex" - the underlying editor of "vi" " Author: Sven Guckes setup-exrc(at)guckes.net " Homepage: http://www.vi-editor.org/ http://www.guckes.net/vi/ " " this file should be usable for all vi clones, " most notably elvis, ex-vi, nvi, vile, and vim. " see http://www.vi-editor.org/homes.php3 " " Feedback by email is very welcome! --Sven " " ==================================================================== " Overview: " ==================================================================== " The structure of this file: " - Header: Info about the file. " - Overview (you are here :-) " - Warnings: some "gotchas". " - Installation: where to put this file. " - Notes: some more notes.. " There are three kinds of setup commands in this file: " - Abbreviations (command "ab") " Abbreviations define short words to be replaced by longer words. " - Mappings (command "map") " Mappings define abbreviations of keys issuing commands. " - Settings (command "set") " - Settings change the value of options/variables which affect commands. " " ==================================================================== " WARNINGs: " ==================================================================== " This file contains control code characters! " Example: ^A, ^C, ^G, ^I, ^K, ^M, ^X, and ^[ (escape) " " Download instead view+save: " So if you are viewing this file with a web browser " then do *not* "save" this file because the contents have " already been interpreted - including the control characters. " Instead, you must *download* this file to preserve them. " " Encode mappings with control characters: " For the same reason you should *encode* Vi mappings as " text before sending it via email or posting on usenet! " Please use standard encoding, ie "uucode" or "base64"! " " Empty Lines: " Some (old) versions of Vi will stop reading the exrc at the first empty " line. So all lines after the first empty line will *not* be read. :-( " So if you need "empty" lines then put a '"' at the beginning instead! " However, you can also look at this as a feature and insert an empty " line to disable the rest of the exrc on purpose, of course. ;-) " " ==================================================================== " Installation: " ==================================================================== " Put this file into your home directory: " cp file $HOME/.exrc " Start up "vi" and then check the effect of the exrc setup " with the commands ":set", ":map", and ":ab". " " ==================================================================== " Notes: " ==================================================================== " - An inverted comma (") starts a comment. Mind you, this works " not only at the start of the line but also within lines. " You may be used to comments started with '#' (as " in shell scripts) - but this does not hold with Vi. " - To enable SETtings, MAPpings, or ABbreviations remove the commenting '"'. " - To unset a variable prepend "no" before its name, eg ":set nonumber". " - To see all variables and values enter command ":set all". " " ==================================================================== " Startup: " ==================================================================== " OK, here we go: Display the version of the Vi first. " This is a good test to see that your exrc was found. " Besides, it it nice to see which version you are using. version " " ==================================================================== " ABbreviations: " ==================================================================== " Abbreviations define short words to be expanded to longer words. " Expansions are made only after a word was finished, that is " after you type a non-letter (usually a space or punctuation). " Abbreviations are used mostly in insert/append/open/replace mode - " but are useful on the command line, too. " " Examples: " ab YDD Donaudampfschiffahrtgesellschaftskapitaenwitwenrentengesetz " a typical German word. " ab YLL LLanfairpwllgwyngyllgogerychwyrndrobwllllantisiliogogogoch " a town in Wales. no kidding! " ab Yalpha abcdefghijklmnopqrstuvwxyz ab YALPHA ABCDEFGHIJKLMNOPQRSTUVWXYZ " ab Ypass "You are in a maze of twisty little passages, all alike." " my standard answer to emails with "help!" in them. " ab Ysuper supercalifragilisticexpialidocious " the longest word in English dictionaries? " ab Yupsidedown umop-ap!sdn " hello Australia, New Zealand and all! :-) " ab sveng Sven Guckes ab MYemail setup-exrc(at)guckes.net " " ==================================================================== " LaTeX: " Enter an "environment" and continue insert between begin and end: " ab Ybe \begin{foo} \end{foo}O " ==================================================================== " " ==================================================================== " SETtings " ==================================================================== set noautoindent set autoprint set autowrite " set directory=~/tmp set noerrorbells " set flash " set hardtabs=8 set noignorecase " set nolisp " set nolist " set magic " set mesg set nonumber " set redraw set report=2 " set scroll " set shell " set shiftwidth " set showmatch set showmode " set noslowopen " vi clone 'elvis' does not like this! set tabstop=8 " set term set noterse " set warn " set window " set wrapscan set wrapmargin=8 " set writeany " " ==================================================================== " MAPpings " ==================================================================== " Mappings define abbreviations of keys issuing commands. " You can map one key to many keys, but also a key sequence " (eg the key sequence issued by arrow keys). " For expansion of letters to words use abbreviations. " " It is recommended to use the unused keys " of command mode for your own mappings. " " Unmapped keys (no commands) of standard vi: " Unmapped lower keys: g q v * _ " Unmapped upper keys: K V " Unmapped control-keys: ^A ^C ^K ^O ^T ^W ^X ^Z ^\ ^_ " " NOTE: " Mapping of ^D is dangerous as some implementations of Vi " stop reading the exrc file when they encounter a literal ^D ! " " ==================================================================== " Unmapped lower keys: g q v " " map g 1G " map q :x " map v  " " ==================================================================== " Unmapped upper keys: K V " " map K k " just in case your finger happens to be on the " shift key when you want to move the cursor "up". " " map V  " makes 'V' a command alias for the CTRL-G command " which shows the current cursor position. " " map V mz} bmx:'z,'x!fmt map V 0!}par w76 " "par" reformats "paragraphs" -> http://www.nicemice.net/par/ " ==================================================================== " Unmapped control-keys: " ^A ^C ^K ^O ^X ^\ ^_ " mapped to CTRL-G here - " please adjust to your taste! " map  ^ " go to first non-whitespace character of line " map   " map CTRL-D not recommended! map d$ " kills/deletes the rest of the line " map   " map   " map   map   " " ==================================================================== " More MAPpings " ==================================================================== " CTRL-T: Jump to an older tag stack entry. " Mapping CTRL-T to move the current line to the top screen line: " map  z " " ';': Repeat the last "current-line search command" (fFtT). " Remap to: " Change to ex mode when types a semicolon (instead of a colon): " map ; : " " 'm': Set mark of following letter ([a-zA-Z]) at current position. " Mapping 'm' to format current paragraph unto end with "fmt -c": " map m !} fmt -c " " 'T': Jump backward till after the next typed character. " Mapping 'T' to sort current paragraph unto end with "sort": " map T !} sort " " ==================================================================== " MAPping cursor key sequences " ==================================================================== " this leaves command mode, moves the cursor, " and then goes into insert mode again. map! OA ki map! OB ji map! OC li map! OD hi " " ==================================================================== " Example output of ":set all" : " ==================================================================== " :set all " noautoindent nonumber noslowopen " autoprint nonovice nosourceany " autowrite nooptimize tabstop=8 " nobeautify paragraphs=IPLPPPQPP LIpplpipnpbtaglength=0 " directory=/var/tmp prompt tags=tags /usr/lib/tags " noedcompatible noreadonly tagstack " noerrorbells redraw term=vt100 " flash remap noterse " hardtabs=8 report=2 timeout " noignorecase scroll=11 ttytype=vt100 " nolisp sections=NHSHH HUuhsh+c warn " nolist shell=/Vol/pub/bin/zsh window=23 " magic shiftwidth=8 wrapscan " mesg noshowmatch wrapmargin=8 " nomodeline showmode nowriteany " ==================================================================== " THPXRF " ==================================================================== " vim: noet