Basic Ex commands
You issue Ex commands using the Vim command line, accessed through : in normal mode. Many of the commands that you use on a day-to-day basis might be inherited Ex commands.
To show you how ubiquitous they are: if you know how to write a buffer to a file in Vim (hint: :w), congratulations! You’ve been using Ex commands all along. To be precise, :w is an Ex command that is usually used to write the contents of the buffer to a file.
There are lots of Ex commands — far too many to enumerate here — but here are a few that are useful time and time again:
- :print, or just :p for short, is used to print a line to Vim’s output
- :move, or just :m for short, is used to move a line/range from a source to a target
- :copy, or just :t for short, is used to copy a line/range from a source to a target
- :delete, or just :d for short, is used to delete a line/range
- :yank, or just :y for short, is used to yank a line/range to a register
- :put is used to put the contents of a register
Give this a try in the editor. Work through the checklist below: for each of the labeled lines, put your cursor on it and run the command it asks for.