website/content/blog/terminaloutputvim.md

26 lines
385 B
Markdown
Raw Normal View History

2021-06-18 20:03:57 -04:00
---
2023-02-18 21:37:22 -05:00
date: 2021-06-18 20:22:30
2021-06-18 20:03:57 -04:00
draft: false
2023-01-05 14:04:45 -05:00
medium_enabled: true
2023-02-18 21:37:22 -05:00
medium_post_id: fba948955d22
tags: []
title: Terminal Output in Vim
2021-06-18 20:03:57 -04:00
---
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')]"
```
2023-02-18 21:37:22 -05:00
Outputs: `[2021-06-18 16:13:19]`