slackware-current/slackbook/html/vi-configuration.html
Patrick J Volkerding 75a4a592e5 Slackware 13.37
Mon Apr 25 13:37:00 UTC 2011
Slackware 13.37 x86_64 stable is released!

Thanks to everyone who pitched in on this release: the Slackware team,
the folks producing upstream code, and linuxquestions.org for providing
a great forum for collaboration and testing.

The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a
dual-sided
32-bit/64-bit x86/x86_64 DVD.  Please consider supporting the Slackware
project by picking up a copy from store.slackware.com.  We're taking
pre-orders now, and offer a discount if you sign up for a subscription.

As always, thanks to the Slackware community for testing, suggestions,
and feedback.  :-)

Have fun!
2018-05-31 22:45:18 +02:00

96 lines
4.2 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>vi Configuration</title>
<meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" />
<link rel="HOME" title="Slackware Linux Essentials" href="index.html" />
<link rel="UP" title="Vi" href="vi.html" />
<link rel="PREVIOUS" title="Quitting vi" href="vi-quitting-vi.html" />
<link rel="NEXT" title="Vi Keys" href="vi-keys.html" />
<link rel="STYLESHEET" type="text/css" href="docbook.css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"
alink="#0000FF">
<div class="NAVHEADER">
<table summary="Header navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<th colspan="3" align="center">Slackware Linux Essentials</th>
</tr>
<tr>
<td width="10%" align="left" valign="bottom"><a href="vi-quitting-vi.html"
accesskey="P">Prev</a></td>
<td width="80%" align="center" valign="bottom">Chapter 16 Vi</td>
<td width="10%" align="right" valign="bottom"><a href="vi-keys.html"
accesskey="N">Next</a></td>
</tr>
</table>
<hr align="LEFT" width="100%" />
</div>
<div class="SECT1">
<h1 class="SECT1"><a id="VI-CONFIGURATION" name="VI-CONFIGURATION">16.6 vi
Configuration</a></h1>
<p>Your <tt class="COMMAND">vi</tt> clone of choice can be configured in several
ways.</p>
<p>A variety of commands can be entered while in command mode to set up <tt
class="COMMAND">vi</tt> just how you like it. Depending on your editor, you can enable
features to make programming easier (like syntax hilighting, auto-indenting, and more),
set up macros to automake tasks, enable textual substitutions, and more.</p>
<p>Almost all of these commands can be put into a configuration file in your home
directory. <tt class="COMMAND">elvis</tt> expects a <tt class="FILENAME">.exrc</tt> file,
while <tt class="COMMAND">vim</tt> expects a <tt class="FILENAME">.vimrc</tt> file. Most
of the setup commands that can be entered in command mode can be placed in the
configuration file. This includes setup information, textual substitutions, macros, and
more.</p>
<p>Discussing all these options and the differences between the editors is quite an
involved subject. For more information, check out the man page or web site for your
preferred <tt class="COMMAND">vi</tt> editor. Some editors (like <tt
class="COMMAND">vim</tt>) have extensive help within the editor that can be accessed with
the <b class="KEYCAP">:help</b> command, or something similar. You can also check out the
O'Reilly book <i class="CITETITLE">Learning the <tt class="COMMAND">vi</tt> Editor</i> by
Lamb and Robbins.</p>
<p>Many common programs in Linux will load up a text file in <tt class="COMMAND">vi</tt>
by default. For example, editing your crontabs will start up <tt class="COMMAND">vi</tt>
by default. If you do not like <tt class="COMMAND">vi</tt> and would like another editor
to be started instead, all you need to do is set the <tt class="ENVAR">VISUAL</tt>
environment variable to the editor you prefer. For information on setting environment
variables, see the section called Environment Variables in Chapter 8. If you want to make
sure that your editor will be the default every time you login, add the VISUAL setting to
your <tt class="FILENAME">.bash_profile</tt> or <tt class="FILENAME">.bashrc</tt>
files.</p>
</div>
<div class="NAVFOOTER">
<hr align="LEFT" width="100%" />
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td width="33%" align="left" valign="top"><a href="vi-quitting-vi.html"
accesskey="P">Prev</a></td>
<td width="34%" align="center" valign="top"><a href="index.html"
accesskey="H">Home</a></td>
<td width="33%" align="right" valign="top"><a href="vi-keys.html"
accesskey="N">Next</a></td>
</tr>
<tr>
<td width="33%" align="left" valign="top">Quitting vi</td>
<td width="34%" align="center" valign="top"><a href="vi.html" accesskey="U">Up</a></td>
<td width="33%" align="right" valign="top">Vi Keys</td>
</tr>
</table>
</div>
</body>
</html>