From 64c93ae585f505961a104a83d7b31453bbd35711 Mon Sep 17 00:00:00 2001 From: Wenxuan Zhang Date: Wed, 5 Aug 2020 11:12:10 +0800 Subject: [PATCH] docs: add descriptions. close #102 --- README.md | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 3c5536c..d1e3b76 100644 --- a/README.md +++ b/README.md @@ -76,19 +76,23 @@ source (curl -sSL git.io/forgit.fish | psub) ### ⌨ Keybinds -| Key | Action | -| :-------------------------------------------: | -------------------------| -| Enter | Confirm | -| Tab | Toggle mark and move up | -| Shift - Tab | Toggle mark and move down| -| ? | Toggle preview window | -| Alt - W | Toggle preview wrap | -| Ctrl - S | Toggle sort | -| Ctrl - R | Toggle selection | -| Ctrl - K / P | Selection move up | -| Ctrl - J / N | Selection move down | -| Alt - K / P | Preview move up | -| Alt - J / N | Preview move down | +| Key | Action | +| :-------------------------------------------: | ------------------------- | +| Enter | Confirm | +| Tab | Toggle mark and move up | +| Shift - Tab | Toggle mark and move down | +| ? | Toggle preview window | +| Alt - W | Toggle preview wrap | +| Ctrl - S | Toggle sort | +| Ctrl - R | Toggle selection | +| Ctrl - Y | Copy commit hash* | +| Ctrl - K / P | Selection move up | +| Ctrl - J / N | Selection move down | +| Alt - K / P | Preview move up | +| Alt - J / N | Preview move down | + +\* Available when the selection contains a commit hash. +For linux users `FORGIT_COPY_CMD` should be set to make copy work. Example: `FORGIT_COPY_CMD='xclip -selection clipboard'`. ### ⚙ Options @@ -140,10 +144,14 @@ Complete loading order of fzf options is: **Example** ``` -# adds a keybind to drop the selected stash but do not quit fzf +# ctrl-d to drop the selected stash but do not quit fzf FORGIT_STASH_FZF_OPTS=' --bind="ctrl-d:reload(git stash drop $(cut -d: -f1 <<<{}) 1>/dev/null && git stash list)" ' +# ctrl-e to view the logs in a vim buffer +FORGIT_LOG_FZF_OPTS=' +--bind="ctrl-e:execute(echo {} |grep -Eo [a-f0-9]+ |head -1 |xargs git show |vim -)" +' ``` ### 📦 Optional dependencies