summaryrefslogtreecommitdiff
path: root/misc/slackbook/html/vi-saving-files.html
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2010-05-19 08:58:23 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 22:43:05 +0200
commitb76270bf9e6dd375e495fec92140a79a79415d27 (patch)
tree3dbed78b2279bf9f14207a16dc634b90995cbd40 /misc/slackbook/html/vi-saving-files.html
parent5a12e7c134274dba706667107d10d231517d3e05 (diff)
downloadcurrent-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy!
Diffstat (limited to 'misc/slackbook/html/vi-saving-files.html')
-rw-r--r--misc/slackbook/html/vi-saving-files.html103
1 files changed, 103 insertions, 0 deletions
diff --git a/misc/slackbook/html/vi-saving-files.html b/misc/slackbook/html/vi-saving-files.html
new file mode 100644
index 00000000..137c46b5
--- /dev/null
+++ b/misc/slackbook/html/vi-saving-files.html
@@ -0,0 +1,103 @@
+<!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>Saving Files</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="Opening Files" href="vi-opening-files.html" />
+<link rel="NEXT" title="Quitting vi" href="vi-quitting-vi.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-opening-files.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-quitting-vi.html"
+accesskey="N">Next</a></td>
+</tr>
+</table>
+
+<hr align="LEFT" width="100%" />
+</div>
+
+<div class="SECT1">
+<h1 class="SECT1"><a id="VI-SAVING-FILES" name="VI-SAVING-FILES">16.4 Saving
+Files</a></h1>
+
+<p>There are several ways to save files in <tt class="COMMAND">vi</tt>. If you want to
+save the current buffer to the file <tt class="FILENAME">randomness</tt>, you would
+type:</p>
+
+<table border="0" bgcolor="#E0E0E0" width="100%">
+<tr>
+<td>
+<pre class="SCREEN">
+<kbd class="USERINPUT">:w randomness</kbd>
+</pre>
+</td>
+</tr>
+</table>
+
+<p>Once you've saved the file once, saving it again is as simple as typing <b
+class="KEYCAP">:w</b>. Any changes will be written out to the file. After you've saved
+the file, you are dumped back into command mode. If you want to save the file and quit
+<tt class="COMMAND">vi</tt> (a very common operation), you would type <b
+class="KEYCAP">:wq</b>. That tells <tt class="COMMAND">vi</tt> to save the current file
+and quit back to the shell.</p>
+
+<p>On occasion, you want to save a file that is marked as read-only. You can do this by
+adding an exclamation point after the write command, like so:</p>
+
+<table border="0" bgcolor="#E0E0E0" width="100%">
+<tr>
+<td>
+<pre class="SCREEN">
+<kbd class="USERINPUT">:w!</kbd>
+</pre>
+</td>
+</tr>
+</table>
+
+<p>However, there will still be instances where you cannot write the file (for example,
+you are attempting to edit a file that is owned by another user). When this happens, <tt
+class="COMMAND">vi</tt> will tell you that it cannot save the file. If you really want to
+edit the file, you'll have to come back and edit it as <tt class="USERNAME">root</tt> or
+(preferably) the owner of that file.</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-opening-files.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-quitting-vi.html"
+accesskey="N">Next</a></td>
+</tr>
+
+<tr>
+<td width="33%" align="left" valign="top">Opening Files</td>
+<td width="34%" align="center" valign="top"><a href="vi.html" accesskey="U">Up</a></td>
+<td width="33%" align="right" valign="top">Quitting vi</td>
+</tr>
+</table>
+</div>
+</body>
+</html>
+