diff options
author | Toby Vincent <tobyv13@gmail.com> | 2023-07-11 15:02:55 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2023-07-11 15:03:18 -0500 |
commit | 1c07314760639816d19ea71893186d8ef28967d8 (patch) | |
tree | 27c9a91573c1e0117f13c7d8b20ba616766bede1 /zk/.local/bin | |
parent | d4353d726755f28d0405fbb34499bdcc60adf3a6 (diff) |
fix(zk): use glow for fzf preview
Diffstat (limited to 'zk/.local/bin')
-rwxr-xr-x | zk/.local/bin/zkf | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zk/.local/bin/zkf b/zk/.local/bin/zkf index 70170fc..12a957a 100755 --- a/zk/.local/bin/zkf +++ b/zk/.local/bin/zkf @@ -1,13 +1,13 @@ #!/bin/sh if [ "$#" -eq 0 ]; then - # shellcheck disable=2046 set -- "$( - rg '#' "$ZK_NOTEBOOK_DIR" --type=markdown --with-filename --max-count=1 --no-line-number | - sed 's/# //' | + rg '^# (.*)$' "$ZK_NOTEBOOK_DIR" --type=markdown --max-count=1 --vimgrep --replace '$1' \ + --no-line-number --no-column | fzf-tmux "$FZF_TMUX_OPTS" -- --tac --print-query -d: --with-nth -1 \ - --preview-window='right,80,<80(up,75%,border-bottom)' \ - --preview="bat --color=always --style=plain -l=md -- {1}" | + --bind 'focus:transform-header(echo {1})' \ + --preview-window='right,100,<100(up,75%,border-bottom)' \ + --preview="glow -l -w 100 --style dark {1}" | tail -1 | cut -d: -f1 )" |