sbib improve and rg bool
This commit is contained in:
22
f
22
f
@@ -4,7 +4,8 @@ if [ "$1" == "-h" ] ; then
|
||||
f - fuzzy preview and open text files or pdfs
|
||||
usage:
|
||||
f
|
||||
f p
|
||||
f p #then type <enter> to preview
|
||||
f p #then type <ctrl-s> to save pdf with spdf.sh
|
||||
|
||||
depends:
|
||||
fzf
|
||||
@@ -18,6 +19,8 @@ fi
|
||||
|
||||
set -e #exit if an error
|
||||
|
||||
#todo: simplify.
|
||||
|
||||
if [ "$1" == "p" ]; then
|
||||
|
||||
ls *.pdf | fzf --preview 'pdftotext -l 2 -nopgbrk -q {1} -' \
|
||||
@@ -28,14 +31,21 @@ fi
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
#FZF_DEFAULT_COMMAND=rg -i --files --glob "!.git/*"
|
||||
# fzf --delimiter : --preview 'less {1}' \
|
||||
fzf --delimiter : --preview 'bat --color=always --style=numbers --line-range=:500 {}' \
|
||||
--preview-window=up:70% --bind "enter:execute-silent(gvim {1} &)"
|
||||
fzf --delimiter : --preview 'bat --color always --style=numbers --line-range=:500 {1}' \
|
||||
--preview-window=up:70% --bind "enter:execute(xdg-open {1})"
|
||||
# --preview-window=up:70% --bind "enter:execute($VISUAL {1})"
|
||||
|
||||
# fzf --delimiter : --preview 'bat --color=always --style=numbers --line-range=:500 {}' \
|
||||
|
||||
# --preview-window=up:70% --bind "enter:execute-silent(gvim {1} &)"
|
||||
|
||||
else
|
||||
# rg $1 | fzf --delimiter : --preview 'less {1}' \
|
||||
# todo: replace this with a series elif blocks mapping selective previews and downstream application bindings to a set of desired filetypes
|
||||
ls *.$1 | fzf --delimiter : --preview 'bat --color=always --style=numbers --line-range=:500 {}' \
|
||||
--preview-window=up:70% --bind "enter:execute-silent(gvim {1} &)"
|
||||
#use xdg-mime, filetype info for opening
|
||||
ls *$1 | fzf --delimiter : --preview 'bat --color always --style=numbers --line-range=:500 {1}' \
|
||||
--preview-window=up:70% --bind "enter:execute(xdg-open {1})"
|
||||
|
||||
# --preview-window=up:70% --bind "enter:execute-silent(gvim {1} &)"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user