Home arrow BrainDump arrow Page 4 - A Look at the VI Editor

Undo editing - BrainDump

VI is the widely used text editor in UNIX operating systems. I have had the chance to use the VI editor in the Solaris and Linux operating systems. In this article we are going to learn how to use the VI editor.

TABLE OF CONTENTS:
  1. A Look at the VI Editor
  2. Saving and Closing a file
  3. Cursor motion/movements
  4. Undo editing
By: Mamun Zaman
Rating: starstarstarstarstar / 9
August 07, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Use u for undoing the last command. For undoing the last edit on the current line only, unless you move off the line you were editing. use U.

Tips: To perform the last change, use . (period once).

Copying and pasting: You can paste the content you deleted, since the deleted contents are kept in a buffer. Use p to paste. Use yy to copy the current line or use :y for copying (or yanking) the current line, and use yw to copy the buffer contents ("yw" for "yank work"). You can use yyp together to copy and paste the current line. Use p to put the buffer contents after the position or after the line. Use P to put the buffer contents before the position or before the line.

You can copy the content in different buffers from a to z, and you can also paste from these buffers by specifying the buffer before the paste command like (a-z)p or (a-z)P. Named buffers may be specified before any deletion, change, yank or put command. The general prefix has the form "c where c is any lowercase character. For example, "adw deletes a word into buffer a. It may thereafter be put back into text with an appropriate "ap.

Searching:Use / for searching in the forward direction and, use ? for searching in the backward direction. The following are some examples.

/str

search down for "str" in forward direction

?str

search up for "str" in backward direction

You can ignore cases during searching by using the set command.



 
 
>>> More BrainDump Articles          >>> More By Mamun Zaman
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

BRAINDUMP ARTICLES

- Apple Founder Steve Jobs Dies
- Steve Jobs` Era at Apple Ends
- Google's Chrome Developer Tool Updated
- Google's Chrome 6 Browser Brings Speed to th...
- New Open Source Update Fedora 13 is Released...
- Install Linux with Knoppix
- iPad Developers Flock To SDK 3.2
- Managing a Linux Wireless Access Point
- Maintaining a Linux Wireless Access Point
- Securing a Linux Wireless Access Point
- Configuring a Linux Wireless Access Point
- Building a Linux Wireless Access Point
- Migrating Oracle to PostgreSQL with Enterpri...
- Demystifying SELinux on Kernel 2.6
- Yahoo and Microsoft Create Ad Partnership

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: