Administration
  Home arrow Administration arrow Page 8 - Vi 101
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
ADMINISTRATION

Vi 101
By: Vikram Vaswani, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 5
    2000-03-27


    Table of Contents:
  • Vi 101
  • Vi? V who?
  • Start Me Up!
  • Let's Tango!
  • Lather, Rinse, Repeat...
  • One, Two, Buckle My Shoe...
  • Searching For Hope
  • Of Files And Windows
  • Saved By The Bell

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    Vi 101 - Of Files And Windows
    ( Page 8 of 9 )


    You've already seen that

    $ vi <filename>
    starts vi with the file specified already loaded. But why restrict yourself to one - you can load multiple files in this manner:

    $ vi file1 file2 file3
    To switch between files, use these commands:

    :next = go to the next file in the file list
    :rewind = go to the first file in the file list
    :last = go to the last file in the file list

    To exit all files at once, use

    :qa!
    to exit without saving, or

    :wqa
    to save all changes and exit [the "a" here means "all"]

    Once you've started vi, you can also load a new file into the editor with the "edit" command, like this

    :e /path/to/file.txt
    If you'd prefer to insert the contents of another file directly into the document you're currently editing, there's a "read" command designed to do just that. Try it!

    :read /path/to/file_to_be_inserted.txt
    If you're a programmer, you'll definitely appreciate vi's ability to provide you with multiple views of the same file, referred to in geek speak as "window splitting". And the command is, naturally,

    :split
    Each of the windows created can be manipulated independent of the others, although changes made to the file will be immediately visible in all of them.

    Let's take it one step further - how about having *different* files loaded into each of the windows? For example, wouldn't it be nice if you could load an HTML form into one, the associated CGI script into another, some help documentation into the third, and have all three visible at the same time?

    Well, you can - simply use the "new" command to create a new window for each file, like this:

    :new form.html :new mailform.cgi :new help.txt
    To switch between windows, use

    ^W W [that's Ctrl-W, immediately followed by W]


    This article copyright Melonfire 2000. All rights reserved.

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

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek