Add keybinding ctrl+y for copying stash ID in gss (#295)

This commit is contained in:
Tim 2023-03-18 16:35:18 +01:00 committed by GitHub
parent 2b0cf3c4af
commit 3f00348d5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -122,13 +122,13 @@ Install `forgit` in just one click.
| <kbd>Alt</kbd> - <kbd>W</kbd> | Toggle preview wrap |
| <kbd>Ctrl</kbd> - <kbd>S</kbd> | Toggle sort |
| <kbd>Ctrl</kbd> - <kbd>R</kbd> | Toggle selection |
| <kbd>Ctrl</kbd> - <kbd>Y</kbd> | Copy commit hash* |
| <kbd>Ctrl</kbd> - <kbd>Y</kbd> | Copy commit hash/stash ID*|
| <kbd>Ctrl</kbd> - <kbd>K</kbd> / <kbd>P</kbd> | Selection move up |
| <kbd>Ctrl</kbd> - <kbd>J</kbd> / <kbd>N</kbd> | Selection move down |
| <kbd>Alt</kbd> - <kbd>K</kbd> / <kbd>P</kbd> | Preview move up |
| <kbd>Alt</kbd> - <kbd>J</kbd> / <kbd>N</kbd> | 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

View file

@ -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
"