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

Adzz Vi-Editor

This document is a cheat sheet for the VI editor, providing essential commands for saving, exiting, inserting text, searching, replacing, navigating, deleting, copying, and pasting. It includes shortcuts for various operations, such as moving around the document and changing text case. The cheat sheet serves as a quick reference for users to enhance their efficiency while using the VI editor.

Uploaded by

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

Adzz Vi-Editor

This document is a cheat sheet for the VI editor, providing essential commands for saving, exiting, inserting text, searching, replacing, navigating, deleting, copying, and pasting. It includes shortcuts for various operations, such as moving around the document and changing text case. The cheat sheet serves as a quick reference for users to enhance their efficiency while using the VI editor.

Uploaded by

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

VI Editor Cheat Sheet

by adzz via cheatography.com/30551/cs/9123/

Controls Inserting Text Searching (cont)

:w Save i Insert before cursor n Go to next match

:x or :wq Save & Exit I Insert before line N Go to previous match

:q Exit, is no changes a Append after cursor * Search for next instance of current word

:q! Exit, ignore any changes A Append after line # Search for last instance of current word

:set ic Ignore case while searching o Open a new line after current line
Replacing
:set noic Case-s​ens​itive searching O Open a new line before current line

:set nu Turn on line numbers r Replace one character :s/pt/​str​/flag Replace pattern with string

R Replace many characters :% Replace all old with new


Markers s/old/new

mc Set marker c on this line Deleting Text Flags

`c Go to beginning of marker c line x Delete character to the right of cursor g Replace all occurr​ences of
pattern
'c Go to first non-blank character of marker X Delete character to the left of cursor
c line c Confirm replaces
D Delete to the end of line
& Repeat last :s command
dd or Delete current line
Navigation
:d
Other
h or Move left :%d Delete all lines
 u Undo last change
:1,$d Delete lines from beginning of file to
j or Move down end of current line U Undo all changes to line

:x,yd Delete lines x through y J Join lines
k or Move up
ndw Delete the next n words nJ Join next n lines

ndb Delete the previous n words . Repeat last command
l or Move right
ndd Delete n lines starting with current > Indent

< De-indent
w Move to next word
Copy and Paste
W Move to next blank delimited word
Other Navigation
yy or :y Yank current line
b Move to the beginning of the word
y{motion} Yank {motion} text ( Move a sentence back
B Move to the beginning of the blank
delimited word p Put after the position or line ) Move a sentence forward

e Move to the end of the word P Put before the position or line { Move a paragraph back

E Move to the end of blank delimited } Move a paragraph forward

word Changing text


fc Move forward to c

0 Move to the beginning of the line C Change to end of the line Fc Move back to c

$ Move to the end of the line cc Change the whole line


Clean Up
1G or Move to the first line in file guu Lowercase line
:0 :g/^$/d Delete blank lines
gUU Uppercase line
G or Move to the last line in file ~ Toggle upper and lower case :%s/​​\s\+ Delete trailing white space
:$ $//
nG or Move to the nth line in file Searching :s/\s\+/ Delete all extra white space
:n /g between words
/string Search forward for string
% Move to associated (), {}, []
?string Search backwards for string

By adzz Published 15th September, 2016. Sponsored by ApolloPad.com


cheatography.com/adzz/ Last updated 16th September, 2016. Everyone has a novel in them. Finish Yours!
Page 1 of 1. https://apollopad.com

You might also like