summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md8
-rwxr-xr-xrc/connect/commands/:cat7
2 files changed, 14 insertions, 1 deletions
diff --git a/README.md b/README.md
index f32607a..2c5f594 100644
--- a/README.md
+++ b/README.md
@@ -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