Switch lines
- Step 1: Position the cursor on the line you want to move.
- Step 2: Type
ddto cut the entire line. - Step 3: Move the cursor to the desired position.
- Step 4: Type
pto paste the line below the current line, or typePto paste the line above the current line.
Example:
- To move line 2 to line 4:
- Navigate to line 2.
- Type
dd(line is cut). - Navigate to line 4.
- Type
p(line is pasted below line 4).
Save the file
- Step 1:press "esc"
- Step 2: Type "
:w",to write changes. - Step 3: Type "
:wq", to write and quit.
Undo
- Step 1:press "esc"
- Step 2: Type "
:u"
Open a Terminal Inside Vim
Enter Command Mode: Press
Escto ensure you're in normal mode.Open the Terminal: Type the following command and press
Enter: ":term"To write press "i"
When done type "exit" press enter
Then press "esc" to close the buffer.
Comments
Post a Comment