Skip to content

Commit a9953d1

Browse files
committed
Redefined mappings for 'bigH/git-fuzzy' because default don't work out of the box
1 parent 53eacb7 commit a9953d1

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

zsh/.zshenv

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export LESS="-MR+Gg"
2020
# by PATHs set in "/etc/paths"
2121
# NOTE: first, make sure to remove this logic from "/etc/zprofile".
2222
if [ -x /usr/libexec/path_helper ]; then
23-
eval `/usr/libexec/path_helper -s`
23+
eval `/usr/libexec/path_helper -s`
2424
fi
2525

2626
# launch ssh-agent is not running yet
@@ -171,7 +171,6 @@ export NNN_PLUG="$NNN_PLUG_1;$NNN_PLUG_2"
171171
# default: bzip2, (g)zip, tar. Other formats are supported through 'atool'
172172
export NNN_ARCHIVE="\\.(7z|a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|rar|rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)$"
173173

174-
# TODO: NNN, live preview same to fzf
175174
# Special shortcut reference to the config file that contains selection
176175
# Use this to refer selected files when entering shell(!) or command prompt (])
177176
export NSEL=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
@@ -192,6 +191,23 @@ export GF_GREP_COLOR='38;5;234;48;5;214'
192191
# make the "git fuzzy diff" preview 60% wide
193192
export GF_HORIZONTAL_PREVIEW_PERCENT_CALCULATION='60'
194193

195-
# redefine all mappings since it does not work in uppercase
196-
export GIT_FUZZY_STATUS_ADD_KEY="alt-w"
194+
# 'git fuzzy'
195+
# NOTE: have to redefine all these mappings since it does not work out of the box
196+
# when shorcut is defined in uppercase, like "Alt-W"
197+
export GIT_FUZZY_BRANCH_WORKING_COPY_KEY="ctrl-p"
198+
export GIT_FUZZY_BRANCH_MERGE_BASE_KEY="alt-p"
199+
export GIT_FUZZY_BRANCH_COMMIT_LOG_KEY="alt-l"
200+
export GIT_FUZZY_BRANCH_CHECKOUT_FILE_KEY="alt-f"
201+
export GIT_FUZZY_BRANCH_CHECKOUT_KEY="alt-b"
202+
export GIT_FUZZY_BRANCH_DELETE_BRANCH_KEY="alt-d"
203+
204+
export GIT_FUZZY_LOG_WORKING_COPY_KEY="ctrl-p"
205+
export GIT_FUZZY_MERGE_BASE_KEY="alt-p"
206+
export GIT_FUZZY_LOG_COMMIT_KEY="alt-d"
207+
208+
export GIT_FUZZY_STATUS_ADD_KEY="alt-s"
209+
export GIT_FUZZY_STATUS_EDIT_KEY="alt-e"
210+
export GIT_FUZZY_STATUS_COMMIT_KEY="alt-c"
211+
export GIT_FUZZY_STATUS_RESET_KEY="alt-r"
212+
export GIT_FUZZY_STATUS_DISCARD_KEY="alt-u"
197213

zsh/scripts/git.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ alias gce="git commit --amend --reuse-message HEAD"
112112

113113
# git checkout
114114

115+
alias gfb="git fuzzy branch"
116+
115117
# Without arguments, shows all branch to choose from in fzf, with "git log" preview
116118
# With arguments, acts as a bare "git checkout"
117119
function gco() {

0 commit comments

Comments
 (0)