BrainDump
  Home arrow BrainDump arrow Page 2 - A Look at the VI Editor
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

A Look at the VI Editor
By: Mamun Zaman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2007-08-07

    Table of Contents:
  • A Look at the VI Editor
  • Saving and Closing a file
  • Cursor motion/movements
  • Undo editing

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    A Look at the VI Editor - Saving and Closing a file
    (Page 2 of 4 )

    Use :w for saving the content and :q for quitting. Here are some examples.

    :w

    Saves current file but doesn't exit

    :w file

    Saves current content as file but doesn't exit

    :n,mw file

    Saves lines n through m to file

    :n,mw >>file

    Saves lines n through m to the end of file

    :q

    Quits VI and may prompt if you need to save

    :q!

    Quits VI without saving

    ZZ or :wq

    Saves and exits VI

    VI has two modes; one is the command mode and the other is the edit mode. To change to the edit mode you have to use i (insert) or a (append). Use the ESC character to change back to command mode.

    Inserting texts: Use i, I, a, A, o or O for insertion as described in the following table.

    i

    Insert before cursor

    I

    Insert before line

    a

    Append after cursor

    A

    Append after line

    o

    Open a new line after current line

    O

    Open a new line before current line

    More BrainDump Articles
    More By Mamun Zaman


       · As someone who has been using vi for over 20 years, the part about "Unix" using the...
       · After you have done a search (using / or ?) you can repeat the search using either n...
     

       

    BRAINDUMP ARTICLES

    - Outsourcing: the Hoopla, the Reality
    - MySQL Plays in the Sun
    - All About SQL Functions
    - SQL: Functioning in the Real World
    - More Advanced SQL Statements
    - Beginning SQL the SEQUEL: Working with Advan...
    - Beginning SQL
    - A Look at the VI Editor
    - A Quick Tour of Boo
    - Book Review: Open Source Licensing
    - PGP and GPG: Email for the Practical Parano...
    - Microsoft Continues War on Open Source
    - Secure Remote Desktop Sharing with VNC on Li...
    - A Look at Google Project Hosting
    - What we can Learn from Two Linux vs. Microso...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway