Home arrow Site Administration arrow Page 4 - Vi 101

Let's Tango! - Administration

Vi is probably the most powerful text editor for *NIX, but if you have ever tried to use it, you probably walked away frustrated. This article walks through all the capabilities and features of Vi - from the basics, such as saving and quitting, to the more advanced topics of searching for strings.

TABLE OF CONTENTS:
  1. Vi 101
  2. Vi? V who?
  3. Start Me Up!
  4. Let's Tango!
  5. Lather, Rinse, Repeat...
  6. One, Two, Buckle My Shoe...
  7. Searching For Hope
  8. Of Files And Windows
  9. Saved By The Bell
By: Vikram Vaswani, (c) Melonfire
Rating: starstarstarstarstar / 5
March 27, 2000

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Now that you know how to insert text, it's time to teach you the second most confusing thing about vi - moving around within the document. In order to gain the maximum benefit from this lesson, I suggest you either open an existing document, or create a new one and enter a few lines of text into it. Make sure that you're in command mode by hitting

<ESC>
a few times when you're done.

Vi's movement keys are

h = left
j = down
k = up
l = right

On some UNIX consoles, it may also be possible to use the cursor keys to accomplish movement within the document; however, I suggest that you take a few moments to memorize the list above instead, as cursor key movements can sometimes get lost over telnet connections, while the standard vi keys above will work in any situation.

Care to move between words? Try

w
to move one word forward, or 

b
to move one back.

To move between paragraphs, try

{
and 

}
while moving between sentences requires careful use of 

(
and 

)
If you need to move to a specific line in your docume nt - line 568, 
for example - try this 

:568
To move to the beginning of the file, type 

gg
while the end of the file is just a 

G [that's shift-G]
away. And vi also has an equivalent for the "Page-Up" and "Page-Down" 
commands common in other text editors; try 

^F [that's Ctrl-F]
to move one page forward, and 

^B [that's Ctrl-B]
to move one page back.

To find out your exact position in the document [kinda like GPS, but not as cool!], try

^G [that's Ctrl-G]
Of course, these aren't the only motion keys - there are quite a few 
more, but I'm afraid that you'll only hear about them in "Vi 202". For the moment, these should be sufficient for our next exercise, in which you'll be doing the tango with your keyboard. Come on, you know how this goes - two steps left, one step right, three steps back, and shake it all about... 

This article copyright Melonfire 2000. All rights reserved.

 
 
>>> More Site Administration Articles          >>> More By Vikram Vaswani, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: