~/Blog

Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Terminal Output in Vim

Published on

Updated on

Warning: This post has not been modified for over 2 years. For technical posts, make sure that it is still relevant.

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]

Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter

Published a response to this? :