home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Learning the vi Editor

Learning the vi EditorSearch this book
Previous: C.2 Alphabetical List of Commands Appendix D Next: D.2 Problems Saving Files

D. Problem Checklist

This appendix consolidates the problem checklists that are provided throughout the text. Here they are presented in one place for ease of reference.

D.1 Problems Opening Files

  • When you invoke vi , the message [open mode] appears.

    Your terminal type is probably incorrectly identified. Quit the editing session immediately by typing :q and ask your system administrator to provide an adequate terminal type setting.

  • You see one of the following messages:

    Visual needs addressable cursor or upline capability
    Bad termcap entry
    Termcap entry too long
    :  Unknown terminal type
    Block device required
    Not a typewriter

    Your terminal type is either undefined, or there's probably something wrong with your termcap or terminfo entry. Enter :q to quit. Then ask your system administrator to select a terminal type for your environment.

  • A [new file] message appears when you think a file already exists.

    You are probably in the wrong directory. Enter :q to quit. Then check to see that you are in the correct directory for that file (enter pwd at the UNIX prompt). If you are in the right directory, check the list of files in the directory (with ls ) to see whether the file exists under a slightly different name.

  • You invoke vi , but you get a colon prompt (indicating that you're in ex line-editing mode).

    You probably typed an interrupt before vi could draw the screen. Enter vi by typing vi at the ex prompt ( : ).

  • One of the following messages appears:

    [Read only]
    File is read only
    Permission denied

    "Read only" means that you can only look at the file; you cannot save any changes you make. You may have invoked vi in view mode (with view or vi -R ), or you do not have write permission for the file. See the section "Problems Saving Files" below.

  • One of the following messages appears:

    Bad file number
    Block special file
    Character special file
    Non-ascii file

    The file you've called up to edit is not a regular text file.

  • When you type :q because of one of the above difficulties, the message appears:

    No write since last change (:quit! overrides).

    You have modified the file without realizing it. Type :q! to leave vi . Your changes from this session will not be saved in the file.

Previous: C.2 Alphabetical List of Commands Learning the vi Editor Next: D.2 Problems Saving Files
C.2 Alphabetical List of Commands Book Index D.2 Problems Saving Files

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System