This document provides a list of basic commands for using the vi text editor. It includes commands for opening files, switching modes, saving, quitting, navigating, and editing text. The commands are essential for efficient text manipulation within the vi editor.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views
vi editor commands
This document provides a list of basic commands for using the vi text editor. It includes commands for opening files, switching modes, saving, quitting, navigating, and editing text. The commands are essential for efficient text manipulation within the vi editor.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
$ vi <filename> — Open or edit a file.
i — Switch to Insert mode.
Esc — Switch to Command mode. :w — Save and continue editing. :wq or ZZ — Save and quit/exit vi. :q! — Quit vi and do not save changes. line. o — Open a new line under the current line. O — Open a new line above the current line. A — Append to the end of the line. a — Append after the cursor’s current position. I — Insert text at the beginning of the current line. b — Go to the beginning of the word. e — Go to the end of the word. x — Delete a single character. dd — Delete an entire line. Xdd — Delete X number of lines. Xyy — Yank X number of lines. G — Go to the last line in a file. XG — Go to line X in a file. gg — Go to the first line in a file. :num — Display the current line’s line number. h — Move left one character. j — Move down one line. k — Move up one line. l — Move right one character. • yy — Yank (copy) a line of text p — Paste a line of yanked text below the current