OSU Computational Physics - Landau Research Group (nacse) -
Next 7.B: Other Editors   Up 7: Editing Files  Prev 7.A.2: Making Changes  Contents

Basic

§ 7.A.3: Saving and Exiting in vi


As with most editors, vi does actually change your file when as you enter the modifications. Instead, you work with a copy of your original file, and the modified copy replaces the original when you save the file.

In vi there are a number of ways (subcommands) to save files:

Because changes are permanent until you save (write) your file, if you make a major mistake while editing your file, it may be easier to abandon your editing and start again with the original file:

The exclamation point means really do it! Otherwise, vi tries to save you grief and won't let you quit until after you write.

Especially at first, a good idea is to save a temporary version of the file (just in case you did something useful with your editing, but are not sure):

We have only just brushed the surface of vi commands. If you would like to know more about the vi editor, there are command summaries available at " UNIXhelp for Users" and " Scientist's and Engineer's Guide to Workstations". You may also to use vi's own tutorial by typing :learn vi while in command mode.

Now let's look some more modern editors in the next section.


Next 7.B: Other Editors   Up 7: Editing Files  Prev 7.A.2: Making Changes  Contents

Comments and questions to CP-unix@physics.orst.edu.