diff --git a/scripts/kks-buffers b/scripts/kks-buffers index 89a5495..b99d480 100755 --- a/scripts/kks-buffers +++ b/scripts/kks-buffers @@ -4,11 +4,13 @@ # # requires: # - fzf (https://github.com/junegunn/fzf) -# - highlight (faster than bat) (https://gitlab.com/saalen/highlight) +# - highlight (faster than bat, change to your liking) (https://gitlab.com/saalen/highlight) + +preview_cmd="highlight --line-range=1-100 -t 4 --force -O ansi -" kks get %val[buflist] | grep -F "$*" | - fzf --height 100% --prompt 'buf> ' --preview 'kks cat -b {} | highlight --line-range=1-100 --force -O ansi' \ + fzf --height 100% --prompt 'buf> ' --preview "kks cat -b {} | $preview_cmd" \ --header="[c-x] delete, [c-t] new scratch" \ --bind="ctrl-x:execute-silent(kks send -b {} delete-buffer)+reload(kks get %val[buflist])" \ --bind="ctrl-t:execute-silent(kks send edit -scratch {q})+reload(kks get %val[buflist])" | diff --git a/scripts/kks-files b/scripts/kks-files index 782ee89..3e42ec8 100755 --- a/scripts/kks-files +++ b/scripts/kks-files @@ -5,10 +5,12 @@ # requires: # - fd (https://github.com/sharkdp/fd) # - fzf (https://github.com/junegunn/fzf) -# - highlight (faster than bat) (https://gitlab.com/saalen/highlight) +# - highlight (faster than bat, change to your liking) (https://gitlab.com/saalen/highlight) + +preview_cmd="highlight --line-range=1-100 -t 4 --force -O ansi" fd --type file . "$@" | - fzf --multi --height 100% --prompt 'files> ' --preview 'highlight --line-range=1-100 --force -O ansi {}' | + fzf --multi --height 100% --prompt 'files> ' --preview "$preview_cmd {}" | while read -r file; do kks edit "$file" done diff --git a/scripts/kks-mru b/scripts/kks-mru index 82e9e3f..d1141d0 100755 --- a/scripts/kks-mru +++ b/scripts/kks-mru @@ -15,5 +15,7 @@ # } # } -(fzf --height 100% --prompt 'mru> ' --preview 'highlight --line-range=1-100 --force -O ansi {}' | +preview_cmd="highlight --line-range=1-100 -t 4 --force -O ansi" + +(fzf --height 100% --prompt 'mru> ' --preview "$preview_cmd {}" | xargs -r kks edit) < ~/.cache/kak-mru