01.09.2014 Views

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

The Linux Development Platform Configuring, Using, and ... - Classes

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CH02.fm Page 40 Monday, October 7, 2002 8:09 PM<br />

40 Chapter 2 • Working With Editors<br />

Table 2-15 Entering Insert mode<br />

Action<br />

i a<br />

I A<br />

o O<br />

Comm<strong>and</strong><br />

Begin inserting characters at the cursor, after the cursor<br />

Begin inserting characters at the beginning, end of the line<br />

Open a new line after, before the current line<br />

In addition to simply entering text into the buffer, vim can change text already in the document.<br />

Table 2-16 lists the comm<strong>and</strong>s for changing text <strong>and</strong> their function.<br />

Table 2-16 Comm<strong>and</strong>s to change text<br />

Action<br />

Comm<strong>and</strong><br />

cw<br />

cc<br />

r<br />

R<br />

Change from the current cursor position to the end of the word<br />

Change the current line<br />

Replace the letter at the cursor<br />

Replace from cursor on<br />

Also of note are the deletion comm<strong>and</strong>s. <strong>The</strong>y are entered from Normal mode <strong>and</strong> may be<br />

used to delete a character, a word or a line at a time. <strong>The</strong>se comm<strong>and</strong>s are listed in Table 2-17.<br />

Table 2-17 Deletion comm<strong>and</strong>s<br />

Action<br />

x X<br />

dw<br />

dd<br />

D<br />

Comm<strong>and</strong><br />

Delete the character at, before the cursor<br />

Delete from the cursor to the end of the current word<br />

Delete the current line<br />

Delete from cursor to end of the current line<br />

Automatic Indentation<br />

<strong>The</strong>re are several indenting options available with VIM. <strong>The</strong>y are autoindent,<br />

smartindent <strong>and</strong> cindent. <strong>The</strong> first, autoindent, simply copies the indentention from<br />

the previous line <strong>and</strong> uses that as the default for all new lines entered into the buffer. Smartindent<br />

<strong>and</strong> cindent are similar, but cindent is stricter in the way that it h<strong>and</strong>les the formatting<br />

<strong>and</strong> may not be suitable for programming languages other than C.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!