wc: word count | : allows you to chain commands
gcc -o
what is the difference between the linker and compiler?
Vim Commands
i This command enters insert mode. You are able to edit the file in this mode.
esc This key enters normal mode. You are able to navigate the file easily in this mode.
! This command exits the editor, Discarding any changes you have made.
dw This command deletes a word. But the cursor needs to be placed at the start of the word for the whole word to be deleted.
d$ This command deletes to the end of the line from where your cursor is.
Many commands that change text are made from an operator and a motion.
The format for a delete command with the d delete operator is as follows:
.Where:
d - is the delete operator.
motion - is what the operator will operate on (listed below).
A short list of motions:
w - until the start of the next word, EXCLUDING its first character.
e - to the end of the current word, INCLUDING the last character.
$ - to the end of the line, INCLUDING the last character.
Thus typing de will delete from the cursor to the end of the word.
NOTE: Pressing just the motion while in Normal mode without an operator will move the cursor as specified.
You can insert a count before the motion in the command to repeat a motion a certain number of times:
operator number motion: Eg: d3w (This command deletes the next three words and moves the cursor to the first character of the next word.)
dd This command is Useful. It deletes the whole line.
Undo Commands:
To undo previous actions, type: u (lowercase u)
To undo all the changes on a line, type: U (capital U)
To undo the undo's, type: CTRL-R
0 This is zero btw. This command is Useful because it moves to the beginning of the line.
p This is the put command. You can place any previously deleted text after the cursor, or if a line is deleted it will go below the line you are on.
r Press this command to replace the character your cursor is on. Then type the character you want it to be replaced with.
ce This command uses the change operator c and deletes from your cursor to the end of the word and enters insert mode so you can type what you want to change it with.
The change operator works with the same motions as delete
Motions: $(to the end of the line), e(to the end of the word), w(to the start of the next word)
format for change is:
c number motion
G This command moves you to the bottom of the file.
gg This command moves you to the start of the file.
If you type in a line number then press G, your cursor will be moved to that line.
The search Command: Type / to search for a phrase. The slash and your cursor will appear at the bottom of the screen. To search from the bottom of the file upwards type ?. To search for the same phrase again from top to bottom press n. To search for the same phrase again from bottom to top press N. To go back from where you came from press CTRL-O. CTRL-I goes forward.
Matching Parentheses Search:
% This command takes you between matching parentheses, square brackets, and curly brackets. This command is super useful for debugging.
The SUBSTITUTE Command:
**:/
gg = G (formats your code nicely)