diff --git a/README.md b/README.md index 2c66737..242b189 100644 --- a/README.md +++ b/README.md @@ -122,13 +122,13 @@ Install `forgit` in just one click. | Alt - W | Toggle preview wrap | | Ctrl - S | Toggle sort | | Ctrl - R | Toggle selection | -| Ctrl - Y | Copy commit hash* | +| Ctrl - Y | Copy commit hash/stash ID*| | 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. +\* Available when the selection contains a commit hash or a stash ID. For linux users `FORGIT_COPY_CMD` should be set to make copy work. Example: `FORGIT_COPY_CMD='xclip -selection clipboard'`. ### ⚙ Options diff --git a/bin/git-forgit b/bin/git-forgit index 952028e..c101e06 100755 --- a/bin/git-forgit +++ b/bin/git-forgit @@ -217,6 +217,7 @@ _forgit_stash_show() { opts=" $FORGIT_FZF_DEFAULT_OPTS +s +m -0 --tiebreak=index --bind=\"enter:execute($cmd | $_forgit_enter_pager)\" + --bind=\"ctrl-y:execute-silent(echo {} | cut -d: -f1 | tr -d '[:space:]' | ${FORGIT_COPY_CMD:-pbcopy})\" --preview=\"$cmd\" $FORGIT_STASH_FZF_OPTS "