website/content/blog/terminaloutputvim.md

385 B

date draft medium_enabled medium_post_id tags title
2021-06-18 20:22:30 false true fba948955d22
Terminal Output in Vim

In Vim you can output the result of a command below your cursor by using :r!.

Examples:

Hello World

:r! echo Hello World

The current timestamp

:r! echo "[$(date '+\%Y-\%m-\%d \%H:\%M:\%S')]"

Outputs: [2021-06-18 16:13:19]