The solutions for exercise 03&04 of MIT.Missing-semester(2020)
Lecture 03. Editors (Vim)
Complete
vimtutor. Note: it looks best in a 80x24 (80 columns by 24 lines) terminal window.
It is a tutorial for beginners of vim. I will just put some notes which are not mentioned in course here.
-
Ucommand: When we pressuin normal mode, we can undo the last command. WhatUdoes is fixing a whole line. -
Ctrl + G: show your location in the file and the file status. Type the linenumber you want to go, then pressG, then you are there.- To search for a phrase in the backward direction, use
?instead of/.
- To search for a phrase in the backward direction, use
-
Type
:!followed by an external command to execute that command. -
Select text to write
- Use visual mode to select text
- type
:w <type_filename_here - You can also type
:!lsto verify this
-
To insert the contents of a file, type
:rFILENAME- Furthermore, You can also read the output of an external command. For example,
:r !lsreads the output of the ls command
- Furthermore, You can also read the output of an external command. For example,
-
Type a capital
Rto replace more than one character.