This is the simplest Linux editor that I have seen. In order to start the program, just type “
emacs” at the command prompt:
If you want to start a new file, but also specify the name of the file, then use the following format of the command (make sure that you do not already have a file named “filename” in your current directory):
If you want to open an existing file, use the same format as above, but make sure that a file named “filename” already exists in your current directory.
Once in the program, you can use the menus at the top of the window to perform certain tasks. Please note that “Save Buffer…” is the item that you select from the “Files” menu in order to save your work.
To start a vi session, just type:
To start a new file, use the following command:
The command above will start a new file, called “filename“, as long as there is not a file already with that name in the current directory. If you want to open an existing file, called “filename“, use the same command above.
There are no menus in vi, so all the commands are entered using the keyboard. Following is a list of some of the most common commands in vi:
:q! + Enter key
|Closes the program without saving changes
:w + Enter key
:wq + Enter key
|Saves changes and then closes the program
|Moves the cursor one space to the right
|Moves the cursor one space to the left
|Moves the cursor down one line
|Moves the cursor up one line
|Inserts text at the cursor’s position
|Inserts text one space after the cursor’s position (appends text)
|Takes you out of input mode (always takes you to command mode)
|Deletes the character at the cursor’s position
|Deletes the current line
Y (Shift + y)
|Copies the current line
|Pastes text after the cursor’s position
P (Shift + p)
|Pastes text before the cursor’s position
|Searches forward through the file for searchstringto find the next occurrence of searchstring, press the
For the commands that are preceded by a “:” (colon), or a “/” (forward slash), the commands that you type will appear at the bottom left of your window. For more information about vi and its commands, check out the man pages.
Last revised May 9, 2002.