Customizable and lightweight git front end tool. Included shell completions and many interesting looking options.
Go to file
Wenxuan b9100a95da
Merge pull request #11 from doronbehar/ctrl-aliases
Document env var FORGIT_NO_ALIASES
2018-11-07 10:23:36 +08:00
forgit.plugin.sh Check $FORGIT_NO_ALIASES in bash script as well 2018-10-30 18:35:27 +02:00
forgit.plugin.zsh Enable not defining aliases at all 2018-10-30 16:21:28 +02:00
LICENSE.txt Update License 2018-04-15 11:37:00 +08:00
README.md Document env var FORGIT_NO_ALIASES 2018-11-05 22:21:29 +02:00

forgit

License: MIT

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

zsh

Clone this repo and source forgit.plugin.zsh in ~/.zshrc.

bash

Clone this repo and source forgit.plugin.sh in ~/.bashrc.

Commands

ga

Interactive git add selector

screenshot

glo

Interactive git log viewer

screenshot

gi

Interactive .gitignore generator

screenshot

gd

Interactive git diff viewer

gcf

Interactive git checkout <file> selector

gss

Interactive git stash viewer

gclean

Interactive git clean selector

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
forgit_stash_show=gss

Or you can set $FORGIT_NO_ALIASES so no aliases will be created at all.

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