Table of Contents Previous Chapter

CHAPTER 5 Editors

There are a number of editors available in UNIX, including emacs, vi, and uni-xedit. You are free to choose any of these or another. No specific preference is given.

GNU Emacs

GNU Emacs is arguably the most powerful and complex of the editors, constituting practically an entire computing environment within itself. Modern versions of Emacs have menu and mouse support if invoked on an X-Terminal, easing the learning curve for this editor.

GNU Emacs functions do things like move one line down, delete a word, move the cursor to the end of the file. Most of the useful functions are bound to particular key strokes so that you can invoke a function by hitting two or three keys. A typical key stroke involves the CTRL or the ESC key and another key. In this section, ^d means holding down the CTRL key while you press the key d; ESC-d means pressing the ESC key and then pressing the key d (not simultaneously). The most common functions are available in the menus in the X Windows version.

For more detailed instruction on the GNU Emacs editor, get a copy of the GNU Emacs Manual by Richard Stallman (about 300 pages) from the Help Desk in the Computer Building Lobby. You can access the man page with the command man emacs.

TABLE 5. How to access the Emacs Editor 
-----------------------------------------------------------------------------------
Function      Prompt User Sees  What User Types                                      
-----------------------------------------------------------------------------------
Enter editor  $                 emacs  RETURN                                        
Exit editor                     ^x^c (If the file has been changed, Emacs will       
                                prompt whether file is to be saved before exiting.)  
              $                                                                      
-----------------------------------------------------------------------------------
You can access an online, interactive Emacs tutorial by typing emacs and following the instructions.

Vi

vi (pronounced vee-eye) is a dual mode-oriented editor. One mode allows text entry by simply typing (called text entry mode); the other allows text manipulation by using the typing keys (called command mode). This is a completely different approach to editing than used by most other text editors and word processors. It provides some incredible possibilities for speed because one does not have to look to find special function keys to perform certain editing tasks. Also, many more commands can be placed within reach of one's hands because all of the keys on the keyboard are available for use during command mode operations.

TABLE 6. How to Access the vi Editor 
---------------------------------------------------------------------
Function      Prompt User   What User Types                            
              Sees                                                     
---------------------------------------------------------------------
                                                                       
Enter editor  $             vi filename RETURN                         
Exit editor                 :wq (write/quit) RETURN                    
                            or                                         
                            :q RETURN (if no changes have been made.)  
                            or                                         
                            :q! RETURN (quit without saving changes)   
                                                                       
                                                                       
              $                                                        
                                                                       
---------------------------------------------------------------------
You can access an online vi tutorial by editing the file /usr/local/doc/vitutor and the man page with the command man vi. No other local documentation is available, although there are books such as Learning the Vi Editor by Linda Lamb, published by O'Reilly and Associates, Inc. (Nutshell Handbook) on the market.

Uni-Xedit

Uni-Xedit is an editor that SLAC has licensed to ease the transition from VM to UNIX for those who are familiar with XEDIT on VM. It is available on the Suns and RS/6000s onsite. But, you may want to begin learning one of the native UNIX editors since those will be more generally available on all UNIX machines you will encounter.

TABLE 7. How to Access the Uni-Xedit Editor 
-----------------------------------------------------------------------
Function      Prompt User   What User Types                              
              Sees                                                       
-----------------------------------------------------------------------
                                                                         
Enter editor  $             xee filename RETURN                          
                            or for an X-Windows version:                 
                            xeg filename RETURN                          
Exit editor                 file RETURN                                  
                            or                                           
                            quit RETURN (if no changes have been made.)  
                            or                                           
                            qquit RETURN (quit without saving changes)   
                                                                         
                                                                         
              $                                                          
                                                                         
-----------------------------------------------------------------------

Other Editors

There are many other editors available, each of which has its adherents. Since choice of editors is a matter of personal preference, we list them here. However, there is no support from SCS for any of these editors, and you may have difficulty in getting help in their use.

TABLE 8. Other Editors at SLAC 
-----------------------------------------------------------------------------------------------------
nedit  A GUI editor developed by Fermilab that has some resemblence to popular Mac and PC editors.     
       Almost entirely mouse- and men- based.  Type man nedit to get started.                          
ne     A full-screen character editor resembling some PC editors.  Has menus but depends on control    
       keys for most tasks.                                                                            
xedit  A simple mouse-based editor for X (not a VM XEDIT clone).  Type man xedit to get started.       
axe    Another mouse-based editor for X, more sophisticated than xedit.  Type man axe to get started.  
                                                                                                       
-----------------------------------------------------------------------------------------------------
 
Table of Contents Next Chapter