Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| # GIT heart FZF | |
| # ------------- | |
| is_in_git_repo() { | |
| git rev-parse HEAD > /dev/null 2>&1 | |
| } | |
| fzf-down() { | |
| fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@" | |
| } |
| # fshow - git commit browser (enter for show, ctrl-d for diff, ` toggles sort) | |
| fshow() { | |
| local out shas sha q k | |
| while out=$( | |
| git log --graph --color=always \ | |
| --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | | |
| fzf --ansi --multi --no-sort --reverse --query="$q" \ | |
| --print-query --expect=ctrl-d --toggle-sort=\`); do | |
| q=$(head -1 <<< "$out") | |
| k=$(head -2 <<< "$out" | tail -1) |