From 4aad3e292d9b34bad85c8f0294796f90036dcbbc Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sun, 11 Sep 2022 00:10:17 -0400 Subject: [PATCH] acme: Add Bhist/Bls commands to track/navigate Del'd buffers One of the things I've noticed missing from Vim is the buffer list. I can :q a file but still get back to it quickly by using :b . The acme version of this feels like just logging the files as I open them and then spitting out that log and navigating it with the plumber! --- bin/acme-scripts/Bhist | 7 +++++++ bin/acme-scripts/Bls | 4 ++++ 2 files changed, 11 insertions(+) create mode 100755 bin/acme-scripts/Bhist create mode 100755 bin/acme-scripts/Bls diff --git a/bin/acme-scripts/Bhist b/bin/acme-scripts/Bhist new file mode 100755 index 0000000..ed2315c --- /dev/null +++ b/bin/acme-scripts/Bhist @@ -0,0 +1,7 @@ +#!/bin/sh +# Bhist -- capture buffer history +set -e +mkdir -p "$HOME/.cache/acme" +echo "Bhist start: $(date)" >> "$HOME/.cache/acme/buffer_history.txt" +9p read acme/log | grep '^[0-9]* new' \ + | sed -l 's/^[0-9]* new//' >> "$HOME/.cache/acme/buffer_history.txt" diff --git a/bin/acme-scripts/Bls b/bin/acme-scripts/Bls new file mode 100755 index 0000000..2453878 --- /dev/null +++ b/bin/acme-scripts/Bls @@ -0,0 +1,4 @@ +#!/bin/sh +# Bls -- list buffer history +tail -r "$HOME/.cache/acme/buffer_history.txt" | uniq \ + | plumb -i -d edit -a 'action=showdata filename=+BufferHistory' -- libgit2 1.1.1