Changes

From Amahi Wiki
Jump to: navigation, search
New page: == This page is somewhat of a tutorial on how to use the command line text editor "vi". Its pretty simple once you read over this. == = Open up a file with vi = To open a text file to ed...
== This page is somewhat of a tutorial on how to use the command line text editor "vi". Its pretty simple once you read over this. ==

= Open up a file with vi =

To open a text file to edit with vi type the following into your terminal:

<code>vi file</code>

= Have the ability to add/delete text from the file =

To insert text into the file you just opened, just hit the "i" key on your keyboard and start editing.

= Saving a file =

To save a file, hit the "Esc" key on your keyboard and then type the following:

<code>:wq</code>

The <code>w</code> is for "write" or "save", and the <code>q</code> is for "quit" to quit vi.

= Oops I messed up, how do I revert my changes? =

Sometimes you will mess up when editing a file and not remember where you went wrong, so you want to start over, its simple, follow the command to exit editor mode (hit your "Esc" key on the keyboard) and type the following:

<code>:q!</code>

The <code>q</code> tells vi to quit and <code>!</code> tell it to "quit without saving".


<strong>If I have missed anything, feel free to edit this wiki page, but please leave the current in tact.</strong>
304

edits