Within the command, the operator defines the action to be taken, which generally involved changing of deleting text in some way. Here is a quick summary of the available operators:
Command | Action |
---|---|
c | change operator |
d | delete operator |
y | yank operator |
~ | swap case (if `tildeop` is set) |
g~ | swap case |
gu | change to lowercase |
gU | change to uppercase |
! | filter through an external program |
= | filter through 'equalprg' or C-indenting if empty |
gq | text formatting |
gw | text formatting with no cursor movement |
g? | ROT13 encoding |
> | shift text right |
< | shift text left |
zf | define a fold |
Some operators are so commonly used that Vim allows an entire command to be comprised of just the operator. When an operator is repeated twice, then that operation is performed over the current line of text. Here are few common examples:
Command | Action |
---|---|
yy | Yank the current line |
cc | Delete the current line then enter INSERT mode |
dd | Delete the current line |