forgit
is a utility tool for git taking advantage of fuzzy finder fzf.
Make sure you have fzf
installed.
for zplug (Recommend)
zplug 'wfxr/forgit', defer:1
for zgen
zgen load wfxr/forgit
for antigen
antigen bundle wfxr/forgit
zsh
Clone this repo and source forgit.plugin.zsh
in ~/.zshrc
.
bash
Clone this repo and source forgit.plugin.sh
in ~/.bashrc
.
Interactive git add
selector
Interactive git log
browser
Interactive .gitignore
generator
Interactive git diff
browser
Interactive git checkout <file>
selector
Interactive git clean
selector
Keybind | Action |
---|---|
<Enter> |
Confirm |
<Tab> |
Toggle mark |
<C-k/p> |
Selection up |
<C-j/n> |
Selection down |
<A-k/p> |
Preview up |
<A-j/n> |
Preview down |
<A-w> |
Toggle preview wrap |
<?> |
Toggle preview window |
<C-r> |
Toggle selection |
<C-s> |
Toggle sort |
You can change the default aliases by defining these variables below.
# Define them before sourcing the plugin if you don't use any plugin manager.
forgit_log=glo
forgit_diff=gd
forgit_add=ga
forgit_ignore=gi
forgit_restore=gcf
forgit_clean=gclean
You can add custom fzf options for forgit
, including keybinds, layout, etc.
(No need to repeat the options already defined in FZF_DEFAULT_OPTS
)
FORGIT_FZF_DEFAULT_OPTS="
--exact
--border
--cycle
--reverse
--height '80%'
"
- Hit
q
to Quit from full screen preview any time. - Install
diff-so-fancy
to have betterdiff
output. - Commands like
glo
,gd
,gcf
andgclean
accept path arguments to restrain the items listed in fzf(eg,glo main.go test.go
,gclean output/
). - Call
gi
with arguments to get wanted.gitignore
contents directly(eg,gi c++
).
The MIT License (MIT)
Copyright (c) 2018 Wenxuan Zhang