Skip to Content
Learning the vi and Vim Editors, 7th Edition
book

Learning the vi and Vim Editors, 7th Edition

by Arnold Robbins, Elbert Hannah, Linda Lamb
July 2008
Beginner
492 pages
16h
English
O'Reilly Media, Inc.
Content preview from Learning the vi and Vim Editors, 7th Edition

Problems Saving Files

  • You try to write your file, but you get one of the following messages:

      File exists
      File file exists - use w!
      [Existing file]
      File is read only

    Type :w! file to overwrite the existing file, or type :w newfile to save the edited version in a new file.

  • You want to write a file, but you don’t have write permission for it. You get the message “Permission denied.”

    Use :w newfile to write out the buffer into a new file. If you have write permission for the directory, you can use mv to replace the original version with your copy of it. If you don’t have write permission for the directory, type :w pathname/file to write out the buffer to a directory in which you do have write permission (such as your home directory, or /tmp).

  • You try to write your file, but you get a message telling you that the file system is full.

    Type :!rm junkfile to delete a (large) unneeded file and free some space. (Starting an ex command line with an exclamation point gives you access to Unix.)

    Or type :!df to see whether there’s any space on another file system. If there is, choose a directory on that file system and write your file to it with :w pathname. (df is the Unix command to check a disk’s free space.)

  • The system puts you into open mode and tells you that the file system is full.

    The disk with vi’s temporary files is filled up. Type :!ls /tmp to see whether there are any files you can remove to gain some disk space.[76] If there are, create a temporary Unix shell from which you can remove files ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 8th Edition

Learning the vi and Vim Editors, 8th Edition

Arnold Robbins, Elbert Hannah
Vim Masterclass

Vim Masterclass

Jason Cannon
Mastering Vim

Mastering Vim

Ruslan Osipov

Publisher Resources

ISBN: 9780596529833Errata Page