Vi Cheat Sheet
Vi Cheat Sheet
O Opens a new line above the current line G Navigates to the last line of a file
/string Forwards lookup for a given string "ap Paste the line from buffer a
/string$ Forwards search string at line's end set ai Sets auto indention
Proceeds to the next occurrence of the
n set noai Unsets auto indention
searched string
Looks for the word he (rather than there, Shows lines with line numbers on the left side of
/\<he\> set nu
here, and so on) the screen
/pl[abc]ce Looks up the terms place, plbce, and plcce set sw Sets the width of a software tabstop
b Returns to the word's beginning CTRL+U Scrolls the screen up by half a page
e Goes to the end of the word CTRL+B Scrolls the screen up by a full page
Xyy Yanks X number of lines CTRL+E Scrolls the screen up by one line
num Shows the line number of the current line CTRL+Y Scrolls the screen down by one line
cw Changes word
Prepared By: Lamisa Musharrat Copyright ©2023 linuxsimply.com| All rights reserved.