Labels

[tip]Powerful stuff of VIM

Inserting the output of a command into the file.
This is done as follows :

:r! command

Example

:r! date

inserts a date stamp in the file
Fitering a region through a command
Filtering: what is it ?

Filtering a block of text through a command means executing the
command, using the selected text as input. This can be quite useful.
We give some examples to demonstrate.

To filter a region through a command, use 'v' to highlight that
region, then do the following : type

!command

and this will filter through command.

Example

!sort

will sort the selected text alphabetically.

No comments:

Post a Comment