summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-02-29 09:17:19 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-02-29 17:41:16 +1100
commita0522ba93e5c514bbcfdf1a96fc9ee598374f7d7 (patch)
treeaa7c452eff1f3197785b9162a90efe1102006ad0
parent1a3d765c4cd685e2f503fa048037d70d1227776a (diff)
fix cheatsheet script to support different contextsv0.15.7
-rw-r--r--docs/keybindings/Keybindings_en.md184
-rw-r--r--docs/keybindings/Keybindings_nl.md188
-rw-r--r--docs/keybindings/Keybindings_pl.md190
-rw-r--r--pkg/gui/keybindings.go2
-rw-r--r--pkg/i18n/english.go62
-rw-r--r--scripts/generate_cheatsheet.go87
6 files changed, 516 insertions, 197 deletions
diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md
index ed7675796..f385b529b 100644
--- a/docs/keybindings/Keybindings_en.md
+++ b/docs/keybindings/Keybindings_en.md
@@ -1,50 +1,21 @@
-# Lazygit menu
+# Lazygit Keybindings
-## Global
+## Global Keybindings
<pre>
+ <kbd>pgup</kbd>: scroll up main panel (fn+up)
+ <kbd>pgdown</kbd>: scroll down main panel (fn+down)
<kbd>m</kbd>: view merge/rebase options
<kbd>ctrl+p</kbd>: view custom patch options
<kbd>P</kbd>: push
<kbd>p</kbd>: pull
- <kbd>R</kbd>: refres
+ <kbd>R</kbd>: refresh
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
- <kbd>_</kbd>: prev screen mode
+ <kbd>_</kbd>: prev screen mode
<kbd>:</kbd>: execute custom command
</pre>
-## Status
-
-<pre>
- <kbd>e</kbd>: edit config file
- <kbd>o</kbd>: open config file
- <kbd>u</kbd>: check for update
- <kbd>enter</kbd>: switch to a recent repo
-</pre>
-
-## Files
-
-<pre>
- <kbd>c</kbd>: commit changes
- <kbd>w</kbd>: commit changes without pre-commit hook
- <kbd>A</kbd>: amend last commit
- <kbd>C</kbd>: commit changes using git editor
- <kbd>space</kbd>: toggle staged
- <kbd>d</kbd>: view 'discard changes' options
- <kbd>e</kbd>: edit file
- <kbd>o</kbd>: open file
- <kbd>i</kbd>: add to .gitignore
- <kbd>r</kbd>: refresh files
- <kbd>s</kbd>: stash canges
- <kbd>S</kbd>: view stash options
- <kbd>a</kbd>: stage/unstage all
- <kbd>D</kbd>: view reset options
- <kbd>enter</kbd>: stage individual hunks/lines
- <kbd>f</kbd>: fetch
- <kbd>X</kbd>: execute custom command
-</pre>
-
-## Branches
+## Branches Panel (Branches Tab)
<pre>
<kbd>space</kbd>: checkout
@@ -53,14 +24,56 @@
<kbd>F</kbd>: force checkout
<kbd>n</kbd>: new branch
<kbd>d</kbd>: delete branch
- <kbd>r</kbd>: rebase branch
+ <kbd>r</kbd>: rebase checked-out branch onto this branch
<kbd>M</kbd>: merge into currently checked out branch
<kbd>i</kbd>: show git-flow options
<kbd>f</kbd>: fast-forward this branch from its upstream
<kbd>g</kbd>: view reset options
</pre>
-## Commits
+## Branches Panel (Remote Branches (in Remotes tab))
+
+<pre>
+ <kbd>esc</kbd>: return to remotes list
+ <kbd>g</kbd>: view reset options
+ <kbd>space</kbd>: checkout
+ <kbd>M</kbd>: merge into currently checked out branch
+ <kbd>d</kbd>: delete branch
+ <kbd>r</kbd>: rebase checked-out branch onto this branch
+ <kbd>u</kbd>: set as upstream of checked-out branch
+</pre>
+
+## Branches Panel (Remotes Tab)
+
+<pre>
+ <kbd>f</kbd>: fetch remote
+ <kbd>n</kbd>: add new remote
+ <kbd>d</kbd>: remove remote
+ <kbd>e</kbd>: edit remote
+</pre>
+
+## Branches Panel (Tags Tab)
+
+<pre>
+ <kbd>space</kbd>: checkout
+ <kbd>d</kbd>: delete tag
+ <kbd>P</kbd>: push tag
+ <kbd>n</kbd>: create tag
+ <kbd>g</kbd>: view reset options
+</pre>
+
+## Commit Files Panel
+
+<pre>
+ <kbd>esc</kbd>: go back
+ <kbd>c</kbd>: checkout file
+ <kbd>d</kbd>: discard this commit's changes to this file
+ <kbd>o</kbd>: open file
+ <kbd>space</kbd>: toggle file included in patch
+ <kbd>enter</kbd>: enter file to add selected lines to the patch
+</pre>
+
+## Commits Panel (Commits Tab)
<pre>
<kbd>s</kbd>: squash down
@@ -81,38 +94,76 @@
<kbd>C</kbd>: copy commit range (cherry-pick)
<kbd>v</kbd>: paste commits (cherry-pick)
<kbd>enter</kbd>: view commit's files
- <kbd>space</kbd>: select commit to diff with another commit
+ <kbd>space</kbd>: checkout commit
<kbd>i</kbd>: select commit to diff with another commit
<kbd>T</kbd>: tag commit
</pre>
-## Stash
+## Commits Panel (Reflog Tab)
<pre>
- <kbd>space</kbd>: apply
- <kbd>g</kbd>: pop
- <kbd>d</kbd>: drop
+ <kbd>space</kbd>: checkout commit
+ <kbd>g</kbd>: view reset options
</pre>
-## Commit files
+## Files Panel
<pre>
- <kbd>esc</kbd>: go back
- <kbd>c</kbd>: checkout file
- <kbd>d</kbd>: discard this commit's changes to this file
+ <kbd>c</kbd>: commit changes
+ <kbd>w</kbd>: commit changes without pre-commit hook
+ <kbd>A</kbd>: amend last commit
+ <kbd>C</kbd>: commit changes using git editor
+ <kbd>space</kbd>: toggle staged
+ <kbd>d</kbd>: view 'discard changes' options
+ <kbd>e</kbd>: edit file
<kbd>o</kbd>: open file
- <kbd>space</kbd>: toggle file included in patch
- <kbd>enter</kbd>: enter file to add selected lines to the patch
+ <kbd>i</kbd>: add to .gitignore
+ <kbd>r</kbd>: refresh files
+ <kbd>s</kbd>: stash changes
+ <kbd>S</kbd>: view stash options
+ <kbd>a</kbd>: stage/unstage all
+ <kbd>D</kbd>: view reset options
+ <kbd>enter</kbd>: stage individual hunks/lines
+ <kbd>f</kbd>: fetch
+ <kbd>g</kbd>: view upstream reset options
</pre>
-## Main (Normal)
+## Main Panel (Merging)
<pre>
- <kbd>PgDn</kbd>: scroll down (fn+up)
- <kbd>PgUp</kbd>: scroll up (fn+down)
+ <kbd>esc</kbd>: return to files panel
+ <kbd>space</kbd>: pick hunk
+ <kbd>b</kbd>: pick both hunks
+ <kbd>◄</kbd>: select previous conflict
+ <kbd>►</kbd>: select next conflict
+ <kbd>▲</kbd>: select top hunk
+ <kbd>▼</kbd>: select bottom hunk
+ <kbd>z</kbd>: undo
</pre>
-## Main (Staging)
+## Main Panel (Normal)
+
+<pre>
+ <kbd> ̄</kbd>: scroll down (fn+up)
+ <kbd>¦</kbd>: scroll up (fn+down)
+</pre>
+
+## Main Panel (Patch Building)
+
+<pre>
+ <kbd>esc</kbd>: exit line-by-line mode
+ <kbd>▲</kbd>: select previous line
+ <kbd>▼</kbd>: select next line
+ <kbd>◄</kbd>: select previous hunk
+ <kbd>►</kbd>: select next hunk
+ <kbd>space</kbd>: stage selection
+ <kbd>d</kbd>: reset selection
+ <kbd>v</kbd>: toggle drag select
+ <kbd>V</kbd>: toggle drag select
+ <kbd>a</kbd>: toggle select hunk
+</pre>
+
+## Main Panel (Staging)
<pre>
<kbd>esc</kbd>: return to files panel
@@ -123,26 +174,29 @@
<kbd>▼</kbd>: select next line
<kbd>◄</kbd>: select previous hunk
<kbd>►</kbd>: select next hunk
- <kbd>space</kbd>: stage line
<kbd>e</kbd>: edit file
<kbd>o</kbd>: open file
<kbd>v</kbd>: toggle drag select
<kbd>V</kbd>: toggle drag select
<kbd>a</kbd>: toggle select hunk
- <kbd>c</kbd>: commit chages
- <kbd>W</kbd>: commit changes without pre-commit hook
+ <kbd>c</kbd>: commit changes
+ <kbd>w</kbd>: commit changes without pre-commit hook
<kbd>C</kbd>: commit changes using git editor
</pre>
-## Main (Merging)
+## Stash Panel
<pre>
- <kbd>esc</kbd>: return to files panel
- <kbd>space</kbd>: pick hunk
- <kbd>b</kbd>: pick both hunks
- <kbd>◄</kbd>: select previous conflict
- <kbd>►</kbd>: select next conflict
- <kbd>▲</kbd>: select top hunk
- <kbd>▼</kbd>: select bottom hunk
- <kbd>z</kbd>: undo
+ <kbd>space</kbd>: apply
+ <kbd>g</kbd>: pop
+ <kbd>d</kbd>: drop
+</pre>
+
+## Status Panel
+
+<pre>
+ <kbd>e</kbd>: edit config file
+ <kbd>o</kbd>: open config file
+ <kbd>u</kbd>: check for update
+ <kbd>enter</kbd>: switch to a recent repo
</pre>
diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md
index fb0972ea6..0201252b1 100644
--- a/docs/keybindings/Keybindings_nl.md
+++ b/docs/keybindings/Keybindings_nl.md
@@ -1,46 +1,21 @@
-# Lazygit menu
+# Lazygit Keybindings
## Global
<pre>
+ <kbd>pgup</kbd>: scroll up main panel (fn+up)
+ <kbd>pgdown</kbd>: scroll down main panel (fn+down)
<kbd>m</kbd>: bekijk merge/rebase opties
+ <kbd>ctrl+p</kbd>: view custom patch options
<kbd>P</kbd>: push
<kbd>p</kbd>: pull
<kbd>R</kbd>: verversen
+ <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
+ <kbd>_</kbd>: prev screen mode
+ <kbd>:</kbd>: voor aangepast commando uit
</pre>
-## Status
-
-<pre>
- <kbd>e</kbd>: verander config file
- <kbd>o</kbd>: open config file
- <kbd>u</kbd>: check voor updates
- <kbd>s</kbd>: wissel naar een recente repo
-</pre>
-
-## Bestanden
-
-<pre>
- <kbd>c</kbd>: Commit veranderingen
- <kbd>w</kbd>: commit veranderingen zonder pre-commit hook
- <kbd>A</kbd>: wijzig laatste commit
- <kbd>C</kbd>: commit veranderingen met de git editor
- <kbd>space</kbd>: toggle staged
- <kbd>d</kbd>: bekijk 'veranderingen ongedaan maken' opties
- <kbd>e</kbd>: verander bestand
- <kbd>o</kbd>: open bestand
- <kbd>i</kbd>: voeg toe aan .gitignore
- <kbd>r</kbd>: refresh bestanden
- <kbd>S</kbd>: stash-bestanden
- <kbd>a</kbd>: toggle staged alle
- <kbd>t</kbd>: bewerkingen toevoegen
- <kbd>D</kbd>: bekijk reset opties
- <kbd>enter</kbd>: stage individuele hunks/lijnen
- <kbd>f</kbd>: fetch
- <kbd>X</kbd>: voor aangepast commando uit
-</pre>
-
-## Branches
+## Branches Panel (Branches Tab)
<pre>
<kbd>space</kbd>: uitchecken
@@ -51,10 +26,54 @@
<kbd>d</kbd>: verwijder branch
<kbd>r</kbd>: rebase branch
<kbd>M</kbd>: merge in met huidige checked out branch
+ <kbd>i</kbd>: show git-flow options
<kbd>f</kbd>: fast-forward this branch from its upstream
+ <kbd>g</kbd>: bekijk reset opties
</pre>
-## Commits
+## Branches Panel (Remote Branches (in Remotes tab))
+
+<pre>
+ <kbd>esc</kbd>: return to remotes list
+ <kbd>g</kbd>: bekijk reset opties
+ <kbd>space</kbd>: uitchecken
+ <kbd>M</kbd>: merge in met huidige checked out branch
+ <kbd>d</kbd>: verwijder branch
+ <kbd>r</kbd>: rebase branch
+ <kbd>u</kbd>: set as upstream of checked-out branch
+</pre>
+
+## Branches Panel (Remotes Tab)
+
+<pre>
+ <kbd>f</kbd>: fetch remote
+ <kbd>n</kbd>: add new remote
+ <kbd>d</kbd>: remove remote
+ <kbd>e</kbd>: edit remote
+</pre>
+
+## Branches Panel (Tags Tab)
+
+<pre>
+ <kbd>space</kbd>: uitchecken
+ <kbd>d</kbd>: delete tag
+ <kbd>P</kbd>: push tag
+ <kbd>n</kbd>: create tag
+ <kbd>g</kbd>: bekijk reset opties
+</pre>
+
+## Commit bestanden Panel
+
+<pre>
+ <kbd>esc</kbd>: ga terug
+ <kbd>c</kbd>: bestand uitchecken
+ <kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand
+ <kbd>o</kbd>: open bestand
+ <kbd>space</kbd>: toggle file included in patch
+ <kbd>enter</kbd>: enter file to add selected lines to the patch
+</pre>
+
+## Commits Panel (Commits Tab)
<pre>
<kbd>s</kbd>: squash beneden
@@ -75,54 +94,109 @@
<kbd>C</kbd>: kopiëer commit reeks (cherry-pick)
<kbd>v</kbd>: plak commits (cherry-pick)
<kbd>enter</kbd>: bekijk gecommite bestanden
- <kbd>space</kbd>: select commit to diff with another commit
+ <kbd>space</kbd>: checkout commit
+ <kbd>i</kbd>: select commit to diff with another commit
+ <kbd>T</kbd>: tag commit
</pre>
-## Stash
+## Commits Panel (Reflog Tab)
<pre>
- <kbd>space</kbd>: toepassen
- <kbd>g</kbd>: pop
- <kbd>d</kbd>: drop
+ <kbd>space</kbd>: checkout commit
+ <kbd>g</kbd>: bekijk reset opties
</pre>
-## Commit bestanden
+## Bestanden Panel
<pre>
- <kbd>esc</kbd>: ga terug
- <kbd>c</kbd>: bestand uitchecken
- <kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand
+ <kbd>c</kbd>: Commit veranderingen
+ <kbd>w</kbd>: commit veranderingen zonder pre-commit hook
+ <kbd>A</kbd>: wijzig laatste commit
+ <kbd>C</kbd>: commit veranderingen met de git editor
+ <kbd>space</kbd>: toggle staged
+ <kbd>d</kbd>: bekijk 'veranderingen ongedaan maken' opties
+ <kbd>e</kbd>: verander bestand
<kbd>o</kbd>: open bestand
+ <kbd>i</kbd>: voeg toe aan .gitignore
+ <kbd>r</kbd>: refresh bestanden
+ <kbd>s</kbd>: stash-bestanden
+ <kbd>S</kbd>: view stash options
+ <kbd>a</kbd>: toggle staged alle
+ <kbd>D</kbd>: bekijk reset opties
+ <kbd>enter</kbd>: stage individuele hunks/lijnen
+ <kbd>f</kbd>: fetch
+ <kbd>g</kbd>: view upstream reset options
</pre>
-## Hoofd (Stage Lines/Hunks)
+## Hoofd Panel (Merging)
<pre>
<kbd>esc</kbd>: ga terug naar het bestanden paneel
+ <kbd>space</kbd>: pick hunk
+ <kbd>b</kbd>: pick beide hunks
+ <kbd>◄</kbd>: selecteer voorgaand conflict
+ <kbd>►</kbd>: selecteer volgende conflict
+ <kbd>▲</kbd>: selecteer bovenste hunk
+ <kbd>▼</kbd>: selecteer onderste hunk
+ <kbd>z</kbd>: ongedaan maken
+</pre>
+
+## Hoofd Panel (Normaal)
+
+<pre>
+ <kbd> ̄</kbd>: scroll omlaag (fn+up)
+ <kbd>¦</kbd>: scroll omhoog (fn+down)
+</pre>
+
+## Hoofd Panel (Patch Building)
+
+<pre>
+ <kbd>esc</kbd>: exit line-by-line mode
<kbd>▲</kbd>: selecteer de vorige lijn
<kbd>▼</kbd>: selecteer de volgende lijn
<kbd>◄</kbd>: selecteer de vorige hunk
<kbd>►</kbd>: selecteer de volgende hunk
- <kbd>space</kbd>: stage lijn
- <kbd>a</kbd>: stage hunk
+ <kbd>space</kbd>: stage selection
+ <kbd>d</kbd>: reset selection
+ <kbd>v</kbd>: toggle drag select
+ <kbd>V</kbd>: toggle drag select
+ <kbd>a</kbd>: toggle select hunk
</pre>
-## Hoofd (Merging)
+## Hoofd Panel (Stage Lines/Hunks)
<pre>
<kbd>esc</kbd>: ga terug naar het bestanden paneel
- <kbd>space</kbd>: pick hunk
- <kbd>b</kbd>: pick beide hunks
- <kbd>◄</kbd>: selecteer voorgaand conflict
- <kbd>►</kbd>: selecteer volgende conflict
- <kbd>▲</kbd>: selecteer bovenste hunk
- <kbd>▼</kbd>: selecteer onderste hunk
- <kbd>z</kbd>: ongedaan maken
+ <kbd>space</kbd>: stage selection
+ <kbd>d</kbd>: reset selection
+ <kbd>tab</kbd>: switch to other panel
+ <kbd>▲</kbd>: selecteer de vorige lijn
+ <kbd>▼</kbd>: selecteer de volgende lijn
+ <kbd>◄</kbd>: selecteer de vorige hunk
+ <kbd>►</kbd>: selecteer de volgende hunk
+ <kbd>e</kbd>: verander bestand
+ <kbd>o</kbd>: open bestand
+ <kbd>v</kbd>: toggle drag select
+ <kbd>V</kbd>: toggle drag select
+ <kbd>a</kbd>: toggle select hunk
+ <kbd>c</kbd>: Commit veranderingen
+ <kbd>w</kbd>: commit veranderingen zonder pre-commit hook
+ <kbd>C</kbd>: commit veranderingen met de git editor
</pre>
-## Hoofd (Normaal)
+## Stash Panel
<pre>
- <kbd>PgDn</kbd>: scroll omlaag (fn+up)
- <kbd>PgUp</kbd>: scroll omhoog (fn+down)
+ <kbd>space</kbd>: toepassen
+ <kbd>g</kbd>: pop
+ <kbd>d</kbd>: drop
+</pre>
+
+## Status Panel
+
+<pre>
+ <kbd>e</kbd>: verander config file
+ <kbd>o</kbd>: open config file
+ <kbd>u</kbd>: check voor updates
+ <kbd>enter</kbd>: wissel naar een recente repo
</pre>
diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md
index 039d15089..539a24d45 100644
--- a/docs/keybindings/Keybindings_pl.md
+++ b/docs/keybindings/Keybindings_pl.md
@@ -1,46 +1,21 @@
-# Lazygit menu
+# Lazygit Keybindings
## Globalne
<pre>
+ <kbd>pgup</kbd>: scroll up main panel (fn+up)
+ <kbd>pgdown</kbd>: scroll down main panel (fn+down)
<kbd>m</kbd>: view merge/rebase options
+ <kbd>ctrl+p</kbd>: view custom patch options
<kbd>P</kbd>: push
<kbd>p</kbd>: pull
<kbd>R</kbd>: odśwież
+ <kbd>+</kbd>: next screen mode (normal/half/fullscreen)
+ <kbd>_</kbd>: prev screen mode
+ <kbd>:</kbd>: execute custom command
</pre>
-## Status
-
-<pre>
- <kbd>e</kbd>: edytuj plik konfiguracyjny
- <kbd>o</kbd>: otwórz plik konfiguracyjny
- <kbd>u</kbd>: sprawdź aktualizacje
- <kbd>s</kbd>: switch to a recent repo
-</pre>
-
-## Pliki
-
-<pre>
- <kbd>c</kbd>: commituj zmiany
- <kbd>w</kbd>: commit changes without pre-commit hook
- <kbd>A</kbd>: zmień ostatnie zatwierdzenie
- <kbd>C</kbd>: commituj zmiany używając edytora z gita
- <kbd>space</kbd>: przełącz zatwierdzenie
- <kbd>d</kbd>: view 'discard changes' options
- <kbd>e</kbd>: edytuj plik
- <kbd>o</kbd>: otwórz plik
- <kbd>i</kbd>: dodaj do .gitignore
- <kbd>r</kbd>: odśwież pliki
- <kbd>S</kbd>: przechowaj pliki
- <kbd>a</kbd>: przełącz wszystkie zatwierdzenia
- <kbd>t</kbd>: dodaj łatkę
- <kbd>D</kbd>: view reset options
- <kbd>enter</kbd>: zatwierdź pojedyncze linie
- <kbd>f</kbd>: fetch
- <kbd>X</kbd>: execute custom command
-</pre>
-
-## Gałęzie
+## Gałęzie Panel (Branches Tab)
<pre>
<kbd>space</kbd>: przełącz
@@ -51,10 +26,54 @@
<kbd>d</kbd>: usuń gałąź
<kbd>r</kbd>: rebase branch
<kbd>M</kbd>: scal do obecnej gałęzi
+ <kbd>i</kbd>: show git-flow options
<kbd>f</kbd>: fast-forward this branch from its upstream
+ <kbd>g</kbd>: view reset options
+</pre>
+
+## Gałęzie Panel (Remote Branches (in Remotes tab))
+
+<pre>
+ <kbd>esc</kbd>: return to remotes list
+ <kbd>g</kbd>: view reset options
+ <kbd>space</kbd>: przełącz
+ <kbd>M</kbd>: scal do obecnej gałęzi
+ <kbd>d</kbd>: usuń gałąź
+ <kbd>r</kbd>: rebase branch
+ <kbd>u</kbd>: set as upstream of checked-out branch
+</pre>
+
+## Gałęzie Panel (Remotes Tab)
+
+<pre>
+ <kbd>f</kbd>: fetch remote
+ <kbd>n</kbd>: add new remote
+ <kbd>d</kbd>: remove remote
+ <kbd>e</kbd>: edit remote
+</pre>
+
+## Gałęzie Panel (Tags Tab)
+
+<pre>
+ <kbd>space</kbd>: przełącz
+ <kbd>d</kbd>: delete tag
+ <kbd>P</kbd>: push tag
+ <kbd>n</kbd>: create tag
+ <kbd>g</kbd>: view reset options
</pre>
-## Commity
+## Commit files Panel
+
+<pre>
+ <kbd>esc</kbd>: go back
+ <kbd>c</kbd>: checkout file
+ <kbd>d</kbd>: discard this commit's changes to this file
+ <kbd>o</kbd>: otwórz plik
+ <kbd>space</kbd>: toggle file included in patch
+ <kbd>enter</kbd>: enter file to add selected lines to the patch
+</pre>
+
+## Commity Panel (Commits Tab)
<pre>
<kbd>s</kbd>: ściśnij w dół
@@ -75,54 +94,109 @@
<kbd>C</kbd>: copy commit range (cherry-pick)
<kbd>v</kbd>: paste commits (cherry-pick)
<kbd>enter</kbd>: view commit's files
- <kbd>space</kbd>: select commit to diff with another commit
+ <kbd>space</kbd>: checkout commit
+ <kbd>i</kbd>: select commit to diff with another commit
+ <kbd>T</kbd>: tag commit
</pre>
-## Schowek
+## Commity Panel (Reflog Tab)
<pre>
- <kbd>space</kbd>: zastosuj
- <kbd>g</kbd>: wyciągnij
- <kbd>d</kbd>: porzuć
+ <kbd>space</kbd>: checkout commit
+ <kbd>g</kbd>: view reset options
</pre>
-## Commit files
+## Pliki Panel
<pre>
- <kbd>esc</kbd>: go back
- <kbd>c</kbd>: checkout file
- <kbd>d</kbd>: discard this commit's changes to this file
+ <kbd>c</kbd>: commituj zmiany
+ <kbd>w</kbd>: commit changes without pre-commit hook
+ <kbd>A</kbd>: zmień ostatnie zatwierdzenie
+ <kbd>C</kbd>: commituj zmiany używając edytora z gita
+ <kbd>space</kbd>: przełącz zatwierdzenie
+ <kbd>d</kbd>: view 'discard changes' options
+ <kbd>e</kbd>: edytuj plik
<kbd>o</kbd>: otwórz plik
+ <kbd>i</kbd>: dodaj do .gitignore
+ <kbd>r</kbd>: odśwież pliki
+ <kbd>s</kbd>: przechowaj pliki
+ <kbd>S</kbd>: view stash options
+ <kbd>a</kbd>: przełącz wszystkie zatwierdzenia
+ <kbd>D</kbd>: view reset options
+ <kbd>enter</kbd>: zatwierdź pojedyncze linie
+ <kbd>f</kbd>: fetch
+ <kbd>g</kbd>: view upstream reset options
+</pre>
+
+## Main Panel (Merging)
+
+<pre>
+ <kbd>esc</kbd>: wróć do panelu plików
+ <kbd>space</kbd>: pick hunk
+ <kbd>b</kbd>: pick both hunks
+ <kbd>◄</kbd>: select previous conflict
+ <kbd>►</kbd>: select next conflict
+ <kbd>▲</kbd>: select top hunk
+ <kbd>▼</kbd>: select bottom hunk
+ <kbd>z</kbd>: undo
</pre>
-## Main (Normal)
+## Main Panel (Normal)
<pre>
- <kbd>PgDn</kbd>: scroll down (fn+up)
- <kbd>PgUp</kbd>: scroll up (fn+down)
+ <kbd> ̄</kbd>: scroll down (fn+up)
+ <kbd>¦</kbd>: scroll up (fn+down)
</pre>
-## Main (Zatwierdzanie)
+## Main Panel (Patch Building)
<pre>
- <kbd>esc</kbd>: wróć do panelu plików
+ <kbd>esc</kbd>: exit line-by-line mode
<kbd>▲</kbd>: select previous line
<kbd>▼</kbd>: select next line
<kbd>◄</kbd>: select previous hunk
<kbd>►</kbd>: select next hunk
- <kbd>space</kbd>: zatwierdź linię
- <kbd>a</kbd>: zatwierdź kawałek
+ <kbd>space</kbd>: stage selection
+ <kbd>d</kbd>: reset selection
+ <kbd>v</kbd>: toggle drag select
+ <kbd>V</kbd>: toggle drag select
+ <kbd>a</kbd>: toggle select hunk
</pre>
-## Main (Merging)
+## Main Panel (Zatwierdzanie)
<pre>
<kbd>esc</kbd>: wróć do panelu plików
- <kbd>space</kbd>: pick hunk
- <kbd>b</kbd>: pick both hunks
- <kbd>◄</kbd>: select previous conflict
- <kbd>►</kbd>: select next conflict
- <kbd>▲</kbd>: select top hunk
- <kbd>▼</kbd>: select bottom hunk
- <kbd>z</kbd>: undo
+ <kbd>space</kbd>: stage selection
+ <kbd>d</kbd>: reset selection
+ <kbd>tab</kbd>: switch to other panel
+ <kbd>▲</kbd>: select previous line
+ <kbd>▼</kbd>: select next line
+ <kbd>◄</kbd>: select previous hunk
+ <kbd>►</kbd>: select next hunk
+ <kbd>e</kbd>: edytuj plik
+ <kbd>o</kbd>: otwórz plik
+ <kbd>v</kbd>: toggle drag select
+ <kbd>V</kbd>: toggle drag select
+ <kbd>a</kbd>: toggle select hunk
+ <kbd>c</kbd>: commituj zmiany
+ <kbd>w</kbd>: commit changes without pre-commit hook
+ <kbd>C</kbd>: commituj zmiany używając edytora z gita
+</pre>
+
+## Schowek Panel
+
+<pre>
+ <kbd>space</kbd>: zastosuj
+ <kbd>g</kbd>: wyciągnij
+ <kbd>d</kbd>: porzuć
+</pre>
+
+## Status Panel
+
+<pre>
+ <kbd>e</kbd>: edytuj plik konfiguracyjny
+ <kbd>o</kbd>: otwórz plik konfiguracyjny
+ <kbd>u</kbd>: sprawdź aktualizacje
+ <kbd>enter</kbd>: switch to a recent repo
</pre>
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index d3a360874..62715d3b1 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -225,6 +225,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Modifier: gocui.ModNone,
Handler: gui.scrollUpMain,
Alternative: "fn+up",
+ Description: gui.Tr.SLocalize("scrollUpMainPanel"),
},
{
ViewName: "",
@@ -232,6 +233,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Modifier: gocui.ModNone,
Handler: gui.scrollDownMain,
Alternative: "fn+down",
+ Description: gui.Tr.SLocalize("scrollDownMainPanel"),
},
{
ViewName: "",
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index 2c6fed0af..55c08e920 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -565,6 +565,54 @@ func addEnglish(i18nObject *i18n.Bundle) error {
ID: "RebaseOptionsTitle",
Other: "Rebase Options",
}, &i18n.Message{
+ ID: "CommitMessageTitle",
+ Other: "Commit Message",
+ }, &i18n.Message{
+ ID: "Local-BranchesTitle",
+ Other: "Branches Tab",
+ }, &i18n.Message{
+ ID: "SearchTitle",
+ Other: "Search",
+ }, &i18n.Message{
+ ID: "TagsTitle",
+ Other: "Tags Tab",
+ }, &i18n.Message{
+ ID: "Branch-CommitsTitle",
+ Other: "Commits Tab",
+ }, &i18n.Message{
+ ID: "MenuTitle",
+ Other: "Menu",
+ }, &i18n.Message{
+ ID: "RemotesTitle",
+ Other: "Remotes Tab",
+ }, &i18n.Message{
+ ID: "CredentialsTitle",
+ Other: "Credentials",
+ }, &i18n.Message{
+ ID: "Remote-BranchesTitle",
+ Other: "Remote Branches (in Remotes tab)",
+ }, &i18n.Message{
+ ID: "Patch-BuildingTitle",
+ Other: "Patch Building",
+ }, &i18n.Message{
+ ID: "InformationTitle",
+ Other: "Information",
+ }, &i18n.Message{
+ ID: "SecondaryTitle",
+ Other: "Secondary",
+ }, &i18n.Message{
+ ID: "Reflog-CommitsTitle",
+ Other: "Reflog Tab",
+ }, &i18n.Message{
+ ID: "Title",
+ Other: "Title",
+ }, &i18n.Message{
+ ID: "GlobalTitle",
+ Other: "Global Keybindings",
+ }, &i18n.Message{
+ ID: "MerginTitle",
+ Other: "Mergin",
+ }, &i18n.Message{
ID: "ConflictsResolved",
Other: "all merge conflicts resolved. Continue?",
}, &i18n.Message{
@@ -652,6 +700,12 @@ func addEnglish(i18nObject *i18n.Bundle) error {
ID: "ScrollUp",
Other: "scroll up",
}, &i18n.Message{
+ ID: "scrollUpMainPanel",
+ Other: "scroll up main panel",
+ }, &i18n.Message{
+ ID: "scrollDownMainPanel",
+ Other: "scroll down main panel",
+ }, &i18n.Message{
ID: "AmendCommitTitle",
Other: "Amend Commit",
}, &i18n.Message{
@@ -692,7 +746,7 @@ func addEnglish(i18nObject *i18n.Bundle) error {
Other: "view commit's files",
}, &i18n.Message{
ID: "CommitFilesTitle",
- Other: "Commit files",
+ Other: "Commit Files",
}, &i18n.Message{
ID: "goBack",
Other: "go back",
@@ -951,6 +1005,12 @@ func addEnglish(i18nObject *i18n.Bundle) error {
}, &i18n.Message{
ID: "prevScreenMode",
Other: "prev screen mode",
+ }, &i18n.Message{
+ ID: "Panel",
+ Other: "Panel",
+ }, &i18n.Message{
+ ID: "Keybindings",
+ Other: "Keybindings",
},
)
}
diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go
index 56059d3bc..c5afdf5e9 100644
--- a/scripts/generate_cheatsheet.go
+++ b/scripts/generate_cheatsheet.go
@@ -12,6 +12,7 @@ import (
"fmt"
"log"
"os"
+ "sort"
"strings"
"github.com/jesseduffield/lazygit/pkg/app"
@@ -60,33 +61,87 @@ func formatTitle(title string) string {
func formatBinding(binding *gui.Binding) string {
if binding.Alternative != "" {
- return fmt.Sprintf(" <kbd>%s</kbd>: %s (%s)\n", binding.GetKey(), binding.Description, binding.Alternative)
+ return fmt.Sprintf(" <kbd>%s</kbd>: %s (%s)\n", gui.GetKeyDisplay(binding.Key), binding.Description, binding.Alternative)
}
- return fmt.Sprintf(" <kbd>%s</kbd>: %s\n", binding.GetKey(), binding.Description)
+ return fmt.Sprintf(" <kbd>%s</kbd>: %s\n", gui.GetKeyDisplay(binding.Key), binding.Description)
}
func getBindingSections(mApp *app.App) []*bindingSection {
bindingSections := []*bindingSection{}
- // TODO: add context-based keybindings
- for _, binding := range mApp.Gui.GetInitialKeybindings() {
- if binding.Description == "" {
- continue
+ bindings := mApp.Gui.GetInitialKeybindings()
+
+ type contextAndViewType struct {
+ context string
+ viewName string
+ }
+
+ contextAndViewBindingMap := map[contextAndViewType][]*gui.Binding{}
+
+ for _, binding := range bindings {
+ contexts := []string{}
+ if len(binding.Contexts) == 0 {
+ contexts = append(contexts, "")
+ } else {
+ for _, context := range binding.Contexts {
+ contexts = append(contexts, context)
+ }
}
- viewName := binding.ViewName
- if viewName == "" {
- viewName = "global"
+ for _, context := range contexts {
+ key := contextAndViewType{context: context, viewName: binding.ViewName}
+ existing := contextAndViewBindingMap[key]
+ if existing == nil {
+ contextAndViewBindingMap[key] = []*gui.Binding{binding}
+ } else {
+ contextAndViewBindingMap[key] = append(contextAndViewBindingMap[key], binding)
+ }
}
- title := localisedTitle(mApp, viewName)
+ }