diff options
author | David Morgan <djm_uk@protonmail.com> | 2021-01-06 14:04:11 +0000 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2021-01-06 14:04:11 +0000 |
commit | a2629cfd8c142ee7dcc22a28020e3556628535b0 (patch) | |
tree | 7d9c37cdec211dd2fd5ddaa2894933b0f0bfcc17 /fzf-git/key-binding.zsh | |
parent | 782c3991d8ff830820a2b2c0e84de9204e9dff33 (diff) | |
download | dotfiles-a2629cfd8c142ee7dcc22a28020e3556628535b0.tar.gz |
Add zsh/zprezto, starship and neovim config
Diffstat (limited to 'fzf-git/key-binding.zsh')
-rw-r--r-- | fzf-git/key-binding.zsh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fzf-git/key-binding.zsh b/fzf-git/key-binding.zsh new file mode 100644 index 0000000..b2d00c5 --- /dev/null +++ b/fzf-git/key-binding.zsh @@ -0,0 +1,17 @@ +join-lines() { + local item + while read item; do + echo -n "${(q)item} " + done +} + +bind-git-helper() { + local c + for c in $@; do + eval "fzf-g$c-widget() { local result=\$(_g$c | join-lines); zle reset-prompt; LBUFFER+=\$result }" + eval "zle -N fzf-g$c-widget" + eval "bindkey '^g^$c' fzf-g$c-widget" + done +} +bind-git-helper f b t r h +unset -f bind-git-helper |