From d9c0458ba0a32560e7df6ee202555d5247705207 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 24 Aug 2022 13:11:25 +0900 Subject: [PATCH] Use ALT-{A,E} instead of CTRL-{A,E} Aren't we all too used to using CTRL-A and CTRL-E to move cursor around? --- fzf-git.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fzf-git.sh b/fzf-git.sh index 8f15fdc..17f11e3 100644 --- a/fzf-git.sh +++ b/fzf-git.sh @@ -32,7 +32,7 @@ if [[ $# -eq 1 ]]; then } case "$1" in branches) - echo $'CTRL-O (open in browser) ╱ CTRL-A (show all branches)\n' + echo $'CTRL-O (open in browser) ╱ ALT-A (show all branches)\n' branches ;; all-branches) @@ -40,11 +40,11 @@ if [[ $# -eq 1 ]]; then branches -a ;; refs) - echo $'CTRL-O (open in browser) ╱ CTRL-E (examine in editor) ╱ CTRL-A (show all refs)\n' + echo $'CTRL-O (open in browser) ╱ ALT-E (examine in editor) ╱ ALT-A (show all refs)\n' refs 'grep -v ^refs/remotes' ;; all-refs) - echo $'CTRL-O (open in browser) ╱ CTRL-E (examine in editor)\n' + echo $'CTRL-O (open in browser) ╱ ALT-E (examine in editor)\n' refs 'cat' ;; *) exit 1 ;; @@ -134,9 +134,9 @@ _fzf_git_files() { git ls-files | grep -vf <(git status -s | grep '^[^?]' | cut -c4-) | sed 's/^/ /') | _fzf_git_fzf -m --ansi --nth 2..,.. \ --prompt '📁 Files> ' \ - --header $'CTRL-O (open in browser) ╱ CTRL-E (open in editor)\n\n' \ + --header $'CTRL-O (open in browser) ╱ ALT-E (open in editor)\n\n' \ --bind "ctrl-o:execute-silent:bash $__fzf_git file {-1}" \ - --bind "ctrl-e:execute:${EDITOR:-vim} {-1} > /dev/tty" \ + --bind "alt-e:execute:${EDITOR:-vim} {-1} > /dev/tty" \ --preview "git diff --no-ext-diff --color=always -- {-1} | sed 1,4d; $_fzf_git_cat {-1}" "$@" | cut -c4- | sed 's/.* -> //' } @@ -153,7 +153,7 @@ _fzf_git_branches() { --no-hscroll \ --bind 'ctrl-/:change-preview-window(down,70%|hidden|)' \ --bind "ctrl-o:execute-silent:bash $__fzf_git branch {}" \ - --bind "ctrl-a:change-prompt(🌳 All branches> )+reload:bash \"$__fzf_git\" all-branches" \ + --bind "alt-a:change-prompt(🌳 All branches> )+reload:bash \"$__fzf_git\" all-branches" \ --preview 'git log --oneline --graph --date=short --color=always --pretty="format:%C(auto)%cd %h%d %s" $(sed s/^..// <<< {} | cut -d" " -f1)' "$@" | sed 's/^..//' | cut -d' ' -f1 } @@ -215,8 +215,8 @@ _fzf_git_each_ref() { --no-hscroll \ --bind 'ctrl-/:change-preview-window(down,70%|hidden|)' \ --bind "ctrl-o:execute-silent:bash $__fzf_git {1} {2}" \ - --bind "ctrl-e:execute:${EDITOR:-vim} <(git show {2}) > /dev/tty" \ - --bind "ctrl-a:change-prompt(🍀 Every ref> )+reload:bash \"$__fzf_git\" all-refs" \ + --bind "alt-e:execute:${EDITOR:-vim} <(git show {2}) > /dev/tty" \ + --bind "alt-a:change-prompt(🍀 Every ref> )+reload:bash \"$__fzf_git\" all-refs" \ --preview 'git log --oneline --graph --date=short --color=always --pretty="format:%C(auto)%cd %h%d %s" {2}' "$@" | awk '{print $2}' }