gentoo.LinuxHowtos.org5. Practice Lesson #2


In this lesson we will set up vi configuration file .exrc
and will test the configuration.


Also, in this lesson we will no longer follow the
Action/Verification exercise structure. You should be
sufficiently comfortable with vi by now to successfully complete
the exercises on your own.


Open vi on a blank file:



$ vi

Type commands :set all and press Enter.
You are likely to see something similar to the following:



noaltwerase noextended matchtime=7 report=5 term="xterm"
autoindent filec="" mesg noruler noterse
autoprint flash nomodeline scroll=24 notildeop
noautowrite nogtagsmode noprint="" nosearchincr timeout
backup="" hardtabs=0 nonumber nosecure nottywerase
nobeautify noiclower nooctal shiftwidth=8 noverbose
cdpath=":" ignorecase open noshowmatch warn
cedit="" keytime=6 optimize noshowmode window=48
columns=80 noleftright path="" sidescroll=16 nowindowname
nocomment lines=50 print="" noslowopen wraplen=0
noedcompatible nolisp prompt nosourceany wrapmargin=15
escapetime=6 nolist noreadonly tabstop=8 wrapscan
noerrorbells lock noredraw taglength=0 nowriteany
noexrc magic remap tags="tags"
directory="/tmp"
msgcat="/usr/share/vi/catalog/"
paragraphs="IPLPPPQPP LIpplpipbp"
recdir="/var/tmp/vi.recover"
sections="NHSHH HUnhsh"
shell="/usr/local/bin/bash"
shellmeta="~{[*?$`'"\"

These are vi environment variables. They can be modified through
the :set commands. In this practice we will configure only
a few of those variables. You are encouraged to experiment with
others.


Exit vi. Make sure you are in your home directory. The easiest
way is to do that is to execute cd with no arguments at
the UNIX command prompt. Now open the .exrc file:



$ vi .exrc

If your .exrc file is not blank, exit, back it up first
and start from scratch. Now create six entries exactly as described
above in Section 4: Startup File. Save, and open
vi with no arguments. Type text without hitting Enter
key. It should wrap around 72nd column. Indent one of the lines
with the Tab key. Continue typing on the same line.
It should wrap and start on the left side aligned with the previous
indentation. Now join two of the lines using J command.
Go to the beginning of the joined line and press function key 4. If
your terminal is set up properly, and the fmt utility
is present in your distribution, your paragraph should be reformatted.


Type a couple of lines and intentionally misspell "customer" as
"cutsomer" and "the" as "teh". Watch your text as it is corrected
on the fly.


This concludes our practice. The remainder of this document is
left up to the reader to practice at his convenience.


End Of Practice Lesson #2



/* The article above and any accompanying files are freely
* distributable, but please leave this notice and the text intact.
* Home for this document: http://www.infobound.com/vi.html
* Copyright (C) 1994, 1999 Tony Thomas
* Contact author through email:tony@infobound.com
* Last revision Feb 23, 1999
* UNIX is a trademark of X/Open
*/

rate this article:
current rating: average rating: 1.0 (11 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

back