123456789101112131415161718192021222324252627 |
- #!/bin/sh --
- set -ue
- # deps:
- # vim
- # bat
- # sk (skim)
- # rg (ripgrep)
- # shellcheck disable=2016
- cmd='"${EDITOR:-vim}" -c "normal $(printf %d {2})Gzz" -- {1}'
- interactive=
- [ "${1:-}" ] || interactive=-i
- SHELL=/bin/sh exec sk ${interactive} \
- --ansi \
- --reverse \
- --height=30 \
- --delimiter=: \
- --cmd-prompt='rg: ' \
- --cmd-query="${*:-}" \
- --preview-window='+{2}-/2' \
- --bind="enter:execute[${cmd}]" \
- --preview='bat -H {2} -n --color=always -- {1}' \
- --cmd="rg --color=always --no-binary --no-ignore -n {}"
|