0% found this document useful (0 votes)
61 views1 page

Moving Within A File: Keystrokes Action

This document summarizes common keyboard shortcuts for navigating and editing text in Vim. Some key actions include inserting text with i, a, or A; deleting text with dd, dw, or x; changing case with ~; and saving and closing files with Shift+zz, :w, :q or :wq. Navigation within a file can be done with the arrow keys, k, j, h, or l. Insert mode is used for adding text while command mode is used for navigation and editing.

Uploaded by

Ravi Lathwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views1 page

Moving Within A File: Keystrokes Action

This document summarizes common keyboard shortcuts for navigating and editing text in Vim. Some key actions include inserting text with i, a, or A; deleting text with dd, dw, or x; changing case with ~; and saving and closing files with Shift+zz, :w, :q or :wq. Navigation within a file can be done with the arrow keys, k, j, h, or l. Insert mode is used for adding text while command mode is used for navigation and editing.

Uploaded by

Ravi Lathwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Keystrokes Action

i Insert at cursor (goes into insert mode)


a Write after cursor (goes into insert mode)
A Write at the end of line (goes into insert mode)
ESC Terminate insert mode
u Undo last change
U Undo all changes to the entire line
o Open a new line (goes into insert mode)
dd Delete line
3dd Delete 3 lines.
D Delete contents of line after the cursor
Delete contents of a line after the cursor and insert new text. Press ESC key to end
C
insertion.
dw Delete word
4dw Delete 4 words
cw Change word
x Delete character at the cursor
r Replace character
R Overwrite characters from cursor onward
s Substitute one character under cursor continue to insert
S Substitute entire line and begin to insert at the beginning of the line
~ Change case of individual character
You can also enter the insert mode by pressing a, A, o, as required.

Moving within a file


You can also use the arrow keys on the keyboard.
Keystroke Use
k Move cursor up
j Move cursor down
h Move cursor left
l Move cursor right

Saving and Closing the file


You should be in the command mode to exit the editor and save changes to the file.
Keystroke Use
Shift+zz Save the file and quit
:w Save the file but keep it open
:q Quit without saving
:wq Save the file and quit

You might also like