dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | README | LICENSE

commit 0ca53be167a7c5d711b668074501b43362848460 (patch)
parent b3e80152c8dbe9ea641ff4754af271fb57c7d21b
Author: Alex Karle <alex@alexkarle.com>
Date:   Wed, 31 Aug 2022 10:25:00 -0400

acme: Add `Note` script, `gv` for current file history

Note is a nice way to just jot down some thoughts in my notes
repo. It starts a new buffer with a default name and a date for the
note, making it easy to edit the name before a Put.

While reviewing a PR in acme, I found I wanted per-file git log history,
which is what gv is! I've also modified gbl to blame the current file,
if no argument is given, which is much easier than having to pass an arg.

Diffstat:
Abin/acme-scripts/Note | 3+++
Mbin/acme-scripts/gbl | 7+------
Mbin/acme-scripts/glo | 2+-
Mbin/acme-scripts/gls | 2+-
Abin/acme-scripts/gv | 4++++
5 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bin/acme-scripts/Note b/bin/acme-scripts/Note @@ -0,0 +1,3 @@ +#!/bin/sh +name=${1:-scratch-$(/usr/bin/date +%F).txt} +(date; echo) | plumb -i -d edit -a "action=showdata filename=$HOME/notes/$name" diff --git a/bin/acme-scripts/gbl b/bin/acme-scripts/gbl @@ -1,9 +1,4 @@ #!/bin/sh # git blame, in acme! -if [ -z "$1" ]; then - echo "usage: gbl FILE" 1>&2 - exit 1 -fi - -file=$1 +file=${1:-$samfile} git blame --date="short" "$file" | plumb -i -d edit -a "action=showdata filename=$file:BLAME" diff --git a/bin/acme-scripts/glo b/bin/acme-scripts/glo @@ -1,2 +1,2 @@ #!/bin/sh -exec gl --oneline +exec gl --oneline "$@" diff --git a/bin/acme-scripts/gls b/bin/acme-scripts/gls @@ -1,2 +1,2 @@ #!/bin/sh -exec gl --stat +exec gl --stat "$@" diff --git a/bin/acme-scripts/gv b/bin/acme-scripts/gv @@ -0,0 +1,4 @@ +#!/bin/sh +# gv -- imitation of :GV! vim plugin +file=${1:-$samfile} +glo -- "$file"