forgit is a utility tool for git taking advantage of fuzzy finder fzf.
Make sure you have fzf installed.
Run following command in your shell to try forgit without installing(for both bash and zsh):
source <(curl -Ss https://raw.githubusercontent.com/wfxr/forgit/master/forgit.plugin.zsh)zplug 'wfxr/forgit'zgen load wfxr/forgitantigen bundle wfxr/forgitDownload and source forgit.plugin.zsh or forgit.plugin.sh in your shell config.
Interactive git add selector
Interactive git log viewer
Interactive .gitignore generator
Interactive git diff viewer
Interactive git checkout <file> selector
Interactive git stash viewer
Interactive git clean selector
| Keybind | Action |
|---|---|
| Enter | Confirm |
| Tab | Toggle mark |
| ? | Toggle preview window |
| Ctrl - S | Toggle sort |
| Ctrl - R | Toggle selection |
| Alt - W | Toggle preview wrap |
| Ctrl - K / P | Selection up |
| Ctrl - J / N | Selection down |
| Alt - K / P | Preview up |
| Alt - J / N | Preview down |
You can change the default aliases by defining these variables below.
(To disable all aliases, Set the FORGIT_NO_ALIASES flag.)
# 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
forgit_stash_show=gssYou 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%'
"-
diff-so-fancy: Improve thegit diffoutput. -
bat: Syntex highlight forgitignore. -
emoji-cli: Emoji support forgit log.
- Hit
qto quit from full screen preview any time. - Commands like
glo,gd,gcfandgcleanaccept path arguments to restrain the items listed in fzf(eg,glo main.go test.go,gclean output/). - Call
giwith arguments to get the wanted.gitignorecontents directly(eg,gi cmake c++).
MIT (c) Wenxuan Zhang