<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>x83.net &#187; vim</title>
	<atom:link href="http://www.x83.net/tag/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.x83.net</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 13:53:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Vim improved howto</title>
		<link>http://www.x83.net/vim-improved-howto/</link>
		<comments>http://www.x83.net/vim-improved-howto/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 20:44:18 +0000</pubDate>
		<dc:creator>Giany</dc:creator>
				<category><![CDATA[BSD]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vim improved]]></category>

		<guid isPermaLink="false">http://www.x83.net/blog/?p=142</guid>
		<description><![CDATA[VIM is the most useful standard text editor on your system. (vi is short for visual editor and is pronounced “vee-eye.” Unlike Emacs, it is available in nearly identical form on every modern Unix system, thus providing a kind of text-editing With a screen editor, you can scroll the page, move the cursor, delete lines, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>VIM</strong> is the most useful standard text editor on your system. (vi is short for visual editor<br />
and is pronounced “vee-eye.”<br />
Unlike Emacs, it is available in nearly identical form on every modern Unix system, thus providing<br />
a kind of text-editing</p>
<p>With a screen editor, you can scroll the page, move<br />
the cursor, delete lines, insert characters, and more, while seeing the results of your<br />
edits as you make them. Screen editors are very popular, since they allow you to make<br />
changes as you read through a file, like you would edit a printed copy, only faster.</p>
<p><strong>Intro</strong></p>
<p><strong>Quitting Without Saving Edits</strong></p>
<p>When you are first learning vi, especially if you are an intrepid experimenter, there are<br />
two other ex commands that are handy for getting out of any mess that you might create.<br />
What if you want to wipe out all of the edits you have made in a session and then return<br />
to the original file? The command:</p>
<p> :e! <Enter></p>
<p><strong>To quit :</strong></p>
<blockquote><p> :q! <Enter></p></blockquote>
<p>&#8221;The exclamation point added to the :e or :q command causes vi to override this prohibition, performing the operation<br />
even though the buffer has been modified.&#8221;</p>
<p><strong>Saving file</strong></p>
<p><strong>You can save in a new file </strong></p>
<blockquote><p> :w newfile  or :w pathname/file</p></blockquote>
<p><strong>Delete a file :</strong></p>
<blockquote><p>:!rm file</p></blockquote>
<p><strong>Free space:</strong></p>
<blockquote><p>:!df </p></blockquote>
<p><strong>Shell commands :</strong></p>
<blockquote><p> :!ls /tmp<br />
 :!sh   :!shell (For shell)  &#8211; :exit to exit or CTRL+D   CTRL+Z for background (fg + bg)</p></blockquote>
<p>You try to write your file, but you get a message telling you that your disk quota has<br />
been reached.<br />
Try to force the system to save your buffer with the ex command :pre (short<br />
for :preserve). If that doesn’t work, look for some files to remove. Use :sh (or<br />
CTRL-Z if you are using a job-control system) to move out of vi and remove files.<br />
Use CTRL-D (or fg) to return to vi when you’re done. Then write your file<br />
with :w!.</p>
<p><strong>vi Commands</strong></p>
<p>vi has two modes: command mode and insert mode. As soon as you enter a file, you<br />
are in command mode, and the editor is waiting for you to enter a command. Commands<br />
enable you to move anywhere in the file, to perform edits, or to enter insert<br />
mode to add new text. Commands can also be given to exit the file (saving or ignoring<br />
your edits) in order to return to the Unix prompt.</p>
<p><strong>Moving the Cursor</strong></p>
<p>In command mode you can position the cursor anywhere in the file. Since you begin<br />
all basic edits (changing, deleting, and copying text) by placing the cursor at the text<br />
that you want to change, you want to be able to move the cursor to that place as quickly<br />
as possible.</p>
<p><strong>Single Movements</strong></p>
<p>The keys h, j, k, and l, right under your fingertips, will move the cursor:</p>
<blockquote><p>h<br />
Left, one space<br />
j<br />
Down, one line<br />
k<br />
Up, one line<br />
l<br />
Right, one space</p></blockquote>
<p>You can also use the cursor arrow keys ( ? , ? , ? , ? ), + and &#8211; to go up and down, or<br />
the ENTER and BACKSPACE keys, but they are out of the way. At first, it may seem<br />
awkward to use letter keys instead of arrows for cursor movement. After a short while,<br />
though, you’ll find it is one of the things you’ll like best about vi—you can move around<br />
without ever taking your fingers off the center of the keyboard.</p>
<p><strong>Numeric Arguments</strong></p>
<p>You can precede movement commands with numbers. For Ex command 4l moves the cursor four spaces to the right, just as if you had typed l four times<br />
(llll).</p>
<blockquote><p>e.g 4l &#8211; 4 spaces to the right<br />
    4h &#8211; 4 spaces to the left<br />
    4k &#8211; 4 lines up<br />
    4j &#8211; 4 lines down
</p></blockquote>
<p><strong>vi</strong> has an option that allows you to set a distance from<br />
the right margin at which vi will automatically insert a newline character. This option<br />
is wrapmargin (its abbreviation is wm). You can set a wrapmargin at 10 characters:</p>
<blockquote><p> :set wm=10</p></blockquote>
<p><strong>Movement Within a Line</strong></p>
<p>Two useful commands that involve movement within a line are:</p>
<blockquote><p>0 (digit zero)<br />
Move to beginning of line.<br />
$<br />
Move to end of line.
</p></blockquote>
<p>Line numbers can be displayed<br />
in vi by using the number option, which is enabled by typing </p>
<blockquote><p> :set nu in command mode</p></blockquote>
<p>Tricks:<br />
1). edit $HOME/.vimrc and add : set ts=4 (tab space, default is 8 )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.x83.net/vim-improved-howto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

