Wiki

by yszheda

View project onGitHub

Tip 27: Meet Vim's Command Line

Return to the top: <<Practical Vim>>

Ex Commands That Operate on the Text in a Buffer

Command Effect
:[range]delete [x] Delete specified lines [into register x]
:[range]yank [x] Yank specified lines [into register x]
:[line]put [x] Put the text from register x after the specified line
:[range]copy {address} Copy the specified lines to below the line specified by {address}
:[range]move {address} Move the specified lines to below the line specified by {address}
:[range]join Join the specified lines
:[range]normal {commands} Execute Normal mode {commands} on each specified line
:[range]substitute/{pattern}/{string}/[flags] Replace occurrences of {pattern} with {string} on each specified lines
:[range]global/{pattern}/[cmd] Execute the Ex command [cmd] on all specified lines where the {pattern} matches

References:

# If you open the file in vim,
# then you can \"ayy@a the next line to execute the vim command: 
:h ex-c`md-index

Ex Commands Strike Far and Wide