Skip to content

Commit 3f00348

Browse files
Add keybinding ctrl+y for copying stash ID in gss (#295)
1 parent 2b0cf3c commit 3f00348

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ Install `forgit` in just one click.
122122
| <kbd>Alt</kbd> - <kbd>W</kbd> | Toggle preview wrap |
123123
| <kbd>Ctrl</kbd> - <kbd>S</kbd> | Toggle sort |
124124
| <kbd>Ctrl</kbd> - <kbd>R</kbd> | Toggle selection |
125-
| <kbd>Ctrl</kbd> - <kbd>Y</kbd> | Copy commit hash* |
125+
| <kbd>Ctrl</kbd> - <kbd>Y</kbd> | Copy commit hash/stash ID*|
126126
| <kbd>Ctrl</kbd> - <kbd>K</kbd> / <kbd>P</kbd> | Selection move up |
127127
| <kbd>Ctrl</kbd> - <kbd>J</kbd> / <kbd>N</kbd> | Selection move down |
128128
| <kbd>Alt</kbd> - <kbd>K</kbd> / <kbd>P</kbd> | Preview move up |
129129
| <kbd>Alt</kbd> - <kbd>J</kbd> / <kbd>N</kbd> | Preview move down |
130130

131-
\* Available when the selection contains a commit hash.
131+
\* Available when the selection contains a commit hash or a stash ID.
132132
For linux users `FORGIT_COPY_CMD` should be set to make copy work. Example: `FORGIT_COPY_CMD='xclip -selection clipboard'`.
133133

134134
### ⚙ Options

bin/git-forgit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ _forgit_stash_show() {
217217
opts="
218218
$FORGIT_FZF_DEFAULT_OPTS
219219
+s +m -0 --tiebreak=index --bind=\"enter:execute($cmd | $_forgit_enter_pager)\"
220+
--bind=\"ctrl-y:execute-silent(echo {} | cut -d: -f1 | tr -d '[:space:]' | ${FORGIT_COPY_CMD:-pbcopy})\"
220221
--preview=\"$cmd\"
221222
$FORGIT_STASH_FZF_OPTS
222223
"

0 commit comments

Comments
 (0)