]> Sergey Matveev's repositories - mmc.git/commitdiff
Quick file display
authorSergey Matveev <stargrave@stargrave.org>
Sun, 12 Mar 2023 17:03:26 +0000 (20:03 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 12 Mar 2023 17:03:26 +0000 (20:03 +0300)
cmd/catfile [new file with mode: 0755]
cmd/newwin
cmd/start
cmd/tmux.conf
doc/arch.texi
doc/usage.texi

diff --git a/cmd/catfile b/cmd/catfile
new file mode 100755 (executable)
index 0000000..19c89c8
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+sel=`find . -not -type d | fzf`
+[ -n "$sel" ]
+if [ -p $sel ]; then fmt < $sel ; else cat $sel ; fi
+read foo
index 01af462ebb0760f329694a90a32606bc1d0a5669..47c5529ba3e1885a7b2aa76a2d6208038e32ff52 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh -ex
+#!/bin/sh -e
 
 cmd="$(dirname "$(realpath -- "$0")")"
 what="$1"
index 173aef1298602f6290054fe5fbf8b9fddc5052be..b5e33f91f7d0a8ae454bb8f872e3ef656ff72340 100755 (executable)
--- a/cmd/start
+++ b/cmd/start
@@ -7,7 +7,7 @@ $TMUX has-session -t mmc 2>/dev/null && exit
 mkdir -p users
 rm -f debug users/status
 mkfifo debug users/status
-[ -s tmux.conf ] || sed "s#NEWWIN#$cmd/newwin#" < "$cmd"/tmux.conf > tmux.conf
+[ -s tmux.conf ] || sed "s#NEWWIN#$cmd/newwin# ; s#CATFILE#$cmd/catfile#" < "$cmd"/tmux.conf > tmux.conf
 $TMUX -f tmux.conf new-session -d -n ROOT -s mmc "cat debug | tai64n | tai64nlocal"
 $TMUX split-window -h 'while : ; do cat users/status | spc -e grn,"^O:.*" -e cya,"^A:.*" ; sleep 5 ; clear ; done'
 $TMUX split-window -v "$cmd/mmc/mmc -debug debug -user-status users/status -newwin $cmd/newwin -notify $cmd/notify | tai64n | tai64nlocal"
index 89cb09168478fa4bb4e818636764076521744b58..fc5faceed853a46981a3a6a6419b7ba48a634af6 100644 (file)
@@ -20,6 +20,7 @@ set-window-option -g window-status-last-style "bg=cyan"
 bind-key Q kill-session
 bind-key c new-window NEWWIN
 bind-key d kill-window
+bind-key S new-window CATFILE
 
 bind-key -n C-PgUp previous-window
 bind-key -n C-PgDn next-window
index efc624bb7bdaa00f1ce0f1c78b95843e88662923..15f5cd48ef36c4ea766d7c4f1aa3f9a96252ee7b 100644 (file)
@@ -12,6 +12,8 @@ cmd/start
     R tail -f debug | tai64n
     R for { cat users/status ; sleep 5 }
     R fzf **(/) | cmd/newwin
+    R cmd/catfile
+      R fzf **(.) | fmt
     R cmd/mmc | tai64n
      F users/status
      F users/.../{id,email,name,|in,out.rec,|status,last}
index 9b26e01a5be3cc0d7312078a14258c74949a7d3c..870fae1b28853db71b3bf636c33de74f97532140 100644 (file)
@@ -39,6 +39,9 @@ prefix is prepended. If message contains appended files, then
 
 @item By pressing @code{Prefix+d} you will close the window.
 
+@item By pressing @code{Prefix+S}, list of available files is shown
+inside @command{fzf}, just to quickly display it.
+
 @item Status change and typing notifications are shown as a short-lived
 message at the bottom of the screen.