Section 3.20. Editing a File: vim


[Page 61 (continued)]

3.20. Editing a File: vim

At this point, I edited the "heart.ver2" file using an editor called vim. The way that the vim editor works is described later in this chapter, together with information about another editor called emacs. For the time being, assume that I edited "heart.ver2" to look like this:

$ vim heart.ver2                      ...edit the file. ... editing session takes place here. $ cat heart.ver2                      ...list the file. I hear her breathing, I'm surrounded by the sound. Floating in this secret place, I never shall be found. She pushed me into the daylight, I had to leave my home. But I am a survivor, And I'll make it on my own. $ _ 



[Page 62]

After creating five versions of my song's lyrics, my work was done. I moved back to my home directory and created a subdirectory called "lyrics.final" in which to store the final version of my lyrics. I also renamed the original "lyrics" directory to "lyrics.draft," which I felt was a better name.

$ cd                        ...move back to my home directory. $ mkdir lyrics.final        ...make the final lyrics directory. $ mv lyrics lyrics.draft    ...rename the old lyrics dir. $ _ 


The final version of my lyrics was stored in a file called "heart.ver5" in the "lyrics.draft" directory, which I then copied into a file called "heart.final" in the "lyrics.final" directory:

$ cp lyrics.draft/heart.ver5 lyrics.final/heart.final $ _ 





Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net