0% found this document useful (0 votes)
64 views

Vi Commands

The document provides an overview of commands for the Vi text editor. It summarizes basic movement commands like h, l, w, b, 0, ^, and $ to move the cursor left, right, to words, lines, and between characters. It also covers commands for entering, deleting, and changing text including a, i, !, ", dd, cc, x, and $. Additionally, it mentions commands for moving through the history file, searching, toggling case, running commands, and character finding.

Uploaded by

gowri1111
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Vi Commands

The document provides an overview of commands for the Vi text editor. It summarizes basic movement commands like h, l, w, b, 0, ^, and $ to move the cursor left, right, to words, lines, and between characters. It also covers commands for entering, deleting, and changing text including a, i, !, ", dd, cc, x, and $. Additionally, it mentions commands for moving through the history file, searching, toggling case, running commands, and character finding.

Uploaded by

gowri1111
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Vi commands

Simple Control Mode Commands


h Move left one character l Move right one character w Move right one word b Move left one word W Move to beginning of next non-blank word B Move to beginning of preceding nonblank word e Move to end of current word E Move to end of current non-blank word 0 Move to beginning of line ^ Move to first non-blank character in line $ Move to end of line

Entering and Changing Text


Text inserted before current character (insert) a Text inserted after current character (append) Text inserted at beginning of line ! Text inserted at end of line " Text overwrites existing text

#eletion Commands
dh dl db dw dB dW d$ d0 Delete one character backwards Delete one character forwards Delete one word backwards Delete one word forwards Delete one non-blank word backwards Delete one non-blank word forwards Delete to end of line Delete to beginning of line

#eletion Commands
# Equivalent to d$ (delete to end of line) dd Equivalent to d$ (delete entire line) C Equivalent to c$ (delete to end of line! enter input "ode) cc Equivalent to c$ (delete entire line! enter input "ode) $ Equivalent to dh (delete character backwards) x Equivalent to dl (delete character forwards)

Mo%ing !ro&nd in the 'istor( )ile , or * Move backward one line - or . Move forward one line # Move to line given b$ repeat count /string %earch backward for string 0string %earch forward for string n &epeat search in sa"e direction as previous 1 &epeat search in opposite direction of previous Miscellaneo&s Commands 4 'nvert ((twiddle() case of current character(s)) 5 *ppend last word of previous co""and! enter input "ode) %&un the fc co""and on the current line (actuall$! run the co""and fc -e $+,'%-*./-$+ED'T0&/-vi11)2 usuall$ this "eans run the full vi on the current line) ctrl*6%tart a new line and redraw the7ctd889

Character*+inding Commands
+x Move right to next occurrence of x )x Move left to previous occurrence of x tx Move right to next occurrence of x! then back one space Tx Move left to previous occurrence of x! then forward one space 2 &edo last character-finding co""and 3 &edo last character-finding co""and in opposite direction

7888ctd9current line on it2 good for when $our screen beco"es garbled) : 3repend 4 (co""ent character) to the line and send it to the histor$ file25678 useful for saving a co""and to be executed later without having to ret$pe it) ;x 'nsert expansion of alias 9x (see below))

You might also like