diff options
-rw-r--r-- | lib/common.nix | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/common.nix b/lib/common.nix index a16d2da..a46dbc2 100644 --- a/lib/common.nix +++ b/lib/common.nix @@ -383,7 +383,10 @@ in { fzf_down() { fzf --height 50% --min-height 20 --border \ - --bind 'ctrl-/:change-preview-window(hidden|90%|)' "$@" + --bind 'ctrl-/:change-preview-window(hidden|90%|)' \ + --bind 'pgup:preview-page-up' \ + --bind 'pgdn:preview-page-down' \ + "$@" } _gf() { @@ -394,6 +397,12 @@ in { cut -c4- | sed 's/.* -> //' } + _gp() { + is_in_git_repo || return + stg series | + fzf_down -m --ansi --preview 'stg show -O --color=always {2}' + } + _gb() { is_in_git_repo || return git branch -a --color=always | grep -v '/HEAD\s' | sort | @@ -429,6 +438,7 @@ in { } bind '"\er": redraw-current-line' bind '"\C-g\C-f": "$(_gf)\e\C-e\er"' + bind '"\C-g\C-p": "$(_gp)\e\C-e\er"' bind '"\C-g\C-b": "$(_gb)\e\C-e\er"' bind '"\C-g\C-t": "$(_gt)\e\C-e\er"' bind '"\C-g\C-h": "$(_gh)\e\C-e\er"' |