commit
c870a5110c
2 changed files with 28 additions and 0 deletions
@ -0,0 +1,4 @@
|
||||
shlr - grep and preview shlogs |
||||
forked from /home/hannu/bin/shlr |
||||
@hannu : thanks for fzf preview trick |
||||
|
@ -0,0 +1,24 @@
|
||||
#!/bin/sh |
||||
|
||||
# shlr - grep and preview shlogs |
||||
# forked from /home/hannu/bin/shlr |
||||
# @hannu : thanks for fzf preview trick |
||||
|
||||
LESS="-cK" |
||||
|
||||
if [ $1 ] |
||||
then |
||||
grep --directories=skip --files-with-matches --null "$@" /home/*/.shlog/* \ |
||||
| xargs --null --no-run-if-empty stat -c "%y %n" \ |
||||
| sort -r \ |
||||
| cut -d ' ' -f4- \ |
||||
| fzf \ |
||||
--preview 'head -100 {}' \ |
||||
--preview-window=down:80%:wrap \ |
||||
--bind "enter:execute(${PAGER:-less} {})" |
||||
else |
||||
ls -t /home/*/.shlog/* | fzf \ |
||||
--preview 'head -100 {}' \ |
||||
--preview-window=down:80%:wrap \ |
||||
--bind "enter:execute(${PAGER:-less} {})" |
||||
fi |
Loading…
Reference in new issue