Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Vi Editor Cheat Sheet, Cheat Sheet of Advanced Computer Programming

Movement Commands, Editing Commands, Invoking vi, Exit and Save Commands

Typology: Cheat Sheet

2020/2021

Uploaded on 04/26/2021

shashwat_pr43
shashwat_pr43 🇺🇸

4.5

(15)

233 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Vi Editor Cheat Sheet
Movement Commands
Character
h, j, k, lLeft, down, up, right
Text
w, W, b, BForward, backward by word
e, E End of word
(, )Beginning of next, previous sentence
{, }Beginning of next, previous paragraph
[[, ]] Beginning of next, previous section
Lines
0, $First, last position of current line
^First non-blank character of current line
+, -First character of next, previous line
HTop line of screen
MMiddle line of screen
LLast line of screen
nH, nLLine n from top, bottom of screen
Scrolling
[Ctrl]F, [Ctrl]B Scroll forward, backward one screen
[Ctrl]D, [Ctrl]U Scroll down, up one-half screen
[Ctrl]E, [Ctrl]Y Show one more line at bottom, top of window
z[Enter] Scroll until line with cursor is at top of screen
z. Scroll until line with cursor is at middle of screen
z- Scroll until line with cursor is at bottom of screen
Searches
/pattern Search forward for pattern
?pattern Search backward for pattern
n, NRepeat last search in same, opposite direction
/, ?Repeat previous search forward, backward
fxsearch forward for character x in current line
Fxsearch backward for character x in current line
txsearch forward for character before x in current line
Txsearch backward for character after x in current line
;Repeat previous current-line search
,Repeat previous current-line search in opposite direction
Line Number
[Ctrl]GDisplay current line number
nGMove to line number n
GMove to last line in file
:nmove to line number n
Marking Position
mxMark current position as x
`xMove cursor to x
`` Return to previous mark or context
'xMove to beginning of line containing mark x
'' Return to beggining of line containing previous mark
Editing Commands
Insert
i, aInsert text before, after cursor
I, AInsert text at beginning, end of line
o, OOpen new line for text below, above cursor
Change
rReplace with next typed characer
pf2