Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
50 Cards in this Set
- Front
- Back
vi syntax to open an already existing file by typing |
vi filename |
|
vi Modes
|
vi has two modes:
command mode - the letters of the keyboard perform editing functions. To enter command mode, press the escape key. insert mode - the letters you type form words and sentences. Unlike many word processors, vi starts up in command mode |
|
In order to begin entering text in this empty file, you must change from command mode to insert mode. To do this, type
|
i
|
|
Moving the Cursor
|
h - left one space |
|
Deleting Characters
To delete a character from a file To remove four characters To delete the character before the cursor |
To del a character from a file - x
To remove four characters - 4x To delete the character beofre the cursor - X |
|
Deleting Words
To delete a word To delete three words |
To delete a word - dw
To delete three words - 3dw |
|
Deleting Lines
To delete a whole line, type To delete two lines, type To delete from the cursor position to the end of the line type |
To delete a whole line, type - dd
To delete two lines - 2dd To delete from the cursor position to the end of the line type - D |
|
Replacing Character
To replace one character with another: |
Move the cursor to the character to be replaced.
Type r Type the replacement character |
|
Replacing Lines
To change text from the cursor position to the end of the line: |
Type C (uppercase). |
|
Inserting Text
To insert text in a line: |
Position the cursor where the new text should go. |
|
Appending Text
To add text to the end of a line: |
Position the cursor on the last letter of the line.
Type a Enter the new text. |
|
To insert a blank line above the current line, type
|
O (uppercase)
|
|
Joining Lines
To join two lines together: To join three lines together: |
Put the cursor on the first line to be joined.
Type J ---------------------------------------------------------- Put the cursor on the first line to be joined. Type 3J |
|
Undoing
To undo your most recent edit, type To undo all the edits on a single line, type |
To undo your most recent edit, type - u
To undo all the edits on a single line, type - U |
|
Moving Around in a File
forward word by word backward word by word to end of line to beginning of line to top line of screen to middle line of screen |
forward word by word - w
backward word by word - b to end of line - $ to beginning of line - 0 to top line of screen - H to middle line of screen - M |
|
Moving Around in a File
to last line of screen to last line of file to first line of file scroll forward one screen scroll backward one screen scroll down one-half screen scroll up one-half screen |
to last line of screen - L
to last line of file - G to first line of file - 1G scroll forward one screen - Ctrl+f scroll backward one screen - Ctrl+b scroll down one-half screen - Ctrl+d scroll up one-half screen - Ctrl+u |
|
Moving by Searching
To move quickly by searching for text, while in command mode: -------------------------------- To repeat the search in a forward direction, type To repeat the search in a backward direction, type |
Type / (slash).
Enter the text to search for. Press . ------------------- To repeat the search in a forward direction, type - n To repeat the search in a backward direction, type - N |
|
To save the file and quit vi, type
|
To save the file and quit vi, type - zz
|
|
To save the edits you have made, but leave vi running and your file open:
|
Press .
Type :w Press |
|
To quit vi, and discard any changes your have made since last saving:
|
Press . |
|
discard changes and quit file
How to close the editor |
:q!
:q |
|
start vi |
$ vi |
|
vi is different from many editors, in that it has two main modes of operation: |
command mode, and insert mode. |
|
When you first load the editor, you will be placed into command mode. To switch into insert mode, simply press the |
i key |
|
When you have finished typing, you may return to command mode. This is done by pressing your |
'Esc' |
|
save file |
:w |
|
To move the cursor around the screen, you must be in command mode. |
h - Cursor left |
|
how to delete a character |
in cmd mode use |
|
delete a line |
d |
|
move forward 1 word |
w |
|
move to beginning of current sentence |
( |
|
move to start of current line |
0 |
|
first character of next line |
+ |
|
Top line of current screen |
H |
|
Forward 1 screen |
Ctrl-F |
|
search for text forward |
/text |
|
repeat previous search in forward direction |
n |
|
Append to end of current line |
A |
|
Insert tab |
Ctrl-I |
|
Delete current line |
Ctrl-U |
|
insert buffer after cursor |
p |
|
undo last change |
u |
|
delete current cursor position |
X |
|
repeat last change |
- |
|
Copy current line to new buffer |
y |
|
write file |
:w |
|
Quit |
:q |
|
Quit, only writing file if changed |
ZZ |
|
Reload file from disk (revert to previous saved version) |
:e! |
|
Insert file after cursor |
:r file |