Customizable and lightweight git front end tool. Included shell completions and many interesting looking options.
Go to file
Ido Abramovich 4d6bf04df2 update README.md
Former-commit-id: 8faab30e94
2018-08-02 14:13:37 +03:00
forgit.plugin.sh rename to use .sh 2018-08-02 14:13:23 +03:00
forgit.plugin.zsh Add ctrl-y keybinding on forgit::log. 2018-07-20 15:39:50 +08:00
LICENSE.txt Update License 2018-04-15 11:37:00 +08:00
README.md update README.md 2018-08-02 14:13:37 +03:00
screenshot-ga.png.REMOVED.git-id Update README 2017-11-24 00:25:17 +08:00
screenshot-gi.png.REMOVED.git-id Update README 2017-11-24 00:25:17 +08:00
screenshot-glo.png.REMOVED.git-id Update README 2017-11-24 00:25:17 +08:00

forgit

forgit is a utility tool for git taking advantage of fuzzy finder fzf.

Installation

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

Manually

Clone this repo somewhere and source the forgit.plugin.zsh at ~/.zshrc or source forgit.plugin.sh in ~/.bashrc.

Commands

ga

Interactive git add selector

screenshot

glo

Interactive git log browser

screenshot

gd

Interactive git diff browser

gcf

Interactive git checkout <file> selector

gclean

Interactive git clean selector

gi

Interactive .gitignore generator

screenshot

Default keybinds

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

Custom options

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%'
"

Tips

  • Hit q to Quit from full screen preview any time.
  • Install diff-so-fancy to have better diff output.
  • Commands like glo, gd, gcf and gclean 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++).

License

The MIT License (MIT)

Copyright (c) 2018 Wenxuan Zhang