diff options
| author | Mathieu Ablasou <alexherbo2@gmail.com> | 2020-10-21 15:22:10 +0200 |
|---|---|---|
| committer | Mathieu Ablasou <alexherbo2@gmail.com> | 2020-10-21 15:55:51 +0200 |
| commit | 60bcac481b71daf3f096a2b75e495af1631d7a1b (patch) | |
| tree | 5b91aff790eca22ca1f02296186bfcb40c5aaf5a | |
| parent | 4038539cf6e3b19bd4e435dd5181e91e64f06e0f (diff) | |
Add a :cat command
| -rw-r--r-- | README.md | 8 | ||||
| -rwxr-xr-x | rc/connect/commands/:cat | 7 |
2 files changed, 14 insertions, 1 deletions
@@ -105,12 +105,18 @@ We just provide the nicety to have a `dolphin` command from Kakoune. ## Example 5 -**Terminal** – Render with [Glow] the current buffer: +**Terminal** – Render with [Glow] the current file or buffer content: ``` sh glow `:it` ``` +``` sh +:cat | glow - +``` + +The latter outputs the buffer content, which is useful when the file is not saved. + [Glow]: https://github.com/charmbracelet/glow ### Example 6 diff --git a/rc/connect/commands/:cat b/rc/connect/commands/:cat new file mode 100755 index 0000000..378a44a --- /dev/null +++ b/rc/connect/commands/:cat @@ -0,0 +1,7 @@ +#!/bin/sh + +# Get the current buffer content. +mkfifo buffer.fifo +trap 'rm buffer.fifo' EXIT +:send write buffer.fifo +cat buffer.fifo |
