mirror of
https://github.com/Brandon-Rozek/website.git
synced 2024-11-10 03:00:35 -05:00
25 lines
345 B
Markdown
25 lines
345 B
Markdown
---
|
|
title: "Terminal Output in Vim"
|
|
date: 2021-06-18T16:22:30-04:00
|
|
draft: false
|
|
tags: []
|
|
---
|
|
|
|
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]`
|
|
|