mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02:00
fix cheatsheet script to support different contexts
This commit is contained in:
parent
1a3d765c4c
commit
a7508a5dfd
6 changed files with 537 additions and 218 deletions
|
@ -1,50 +1,21 @@
|
||||||
# Lazygit menu
|
# Lazygit Keybindings
|
||||||
|
|
||||||
## Global
|
## Global Keybindings
|
||||||
|
|
||||||
<pre>
|
<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>m</kbd>: view merge/rebase options
|
||||||
<kbd>ctrl+p</kbd>: view custom patch options
|
<kbd>ctrl+p</kbd>: view custom patch options
|
||||||
<kbd>P</kbd>: push
|
<kbd>P</kbd>: push
|
||||||
<kbd>p</kbd>: pull
|
<kbd>p</kbd>: pull
|
||||||
<kbd>R</kbd>: refres
|
<kbd>R</kbd>: refresh
|
||||||
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
<kbd>_</kbd>: prev screen mode
|
<kbd>_</kbd>: prev screen mode
|
||||||
<kbd>:</kbd>: execute custom command
|
<kbd>:</kbd>: execute custom command
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Status
|
## Branches Panel (Branches Tab)
|
||||||
|
|
||||||
<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
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>space</kbd>: checkout
|
<kbd>space</kbd>: checkout
|
||||||
|
@ -53,14 +24,56 @@
|
||||||
<kbd>F</kbd>: force checkout
|
<kbd>F</kbd>: force checkout
|
||||||
<kbd>n</kbd>: new branch
|
<kbd>n</kbd>: new branch
|
||||||
<kbd>d</kbd>: delete 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>M</kbd>: merge into currently checked out branch
|
||||||
<kbd>i</kbd>: show git-flow options
|
<kbd>i</kbd>: show git-flow options
|
||||||
<kbd>f</kbd>: fast-forward this branch from its upstream
|
<kbd>f</kbd>: fast-forward this branch from its upstream
|
||||||
<kbd>g</kbd>: view reset options
|
<kbd>g</kbd>: view reset options
|
||||||
</pre>
|
</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>
|
<pre>
|
||||||
<kbd>s</kbd>: squash down
|
<kbd>s</kbd>: squash down
|
||||||
|
@ -81,60 +94,41 @@
|
||||||
<kbd>C</kbd>: copy commit range (cherry-pick)
|
<kbd>C</kbd>: copy commit range (cherry-pick)
|
||||||
<kbd>v</kbd>: paste commits (cherry-pick)
|
<kbd>v</kbd>: paste commits (cherry-pick)
|
||||||
<kbd>enter</kbd>: view commit's files
|
<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>i</kbd>: select commit to diff with another commit
|
||||||
<kbd>T</kbd>: tag commit
|
<kbd>T</kbd>: tag commit
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Stash
|
## Commits Panel (Reflog Tab)
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>space</kbd>: apply
|
<kbd>space</kbd>: checkout commit
|
||||||
<kbd>g</kbd>: pop
|
<kbd>g</kbd>: view reset options
|
||||||
<kbd>d</kbd>: drop
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Commit files
|
## Files Panel
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>esc</kbd>: go back
|
<kbd>c</kbd>: commit changes
|
||||||
<kbd>c</kbd>: checkout file
|
<kbd>w</kbd>: commit changes without pre-commit hook
|
||||||
<kbd>d</kbd>: discard this commit's changes to this file
|
<kbd>A</kbd>: amend last commit
|
||||||
<kbd>o</kbd>: open file
|
<kbd>C</kbd>: commit changes using git editor
|
||||||
<kbd>space</kbd>: toggle file included in patch
|
<kbd>space</kbd>: toggle staged
|
||||||
<kbd>enter</kbd>: enter file to add selected lines to the patch
|
<kbd>d</kbd>: view 'discard changes' options
|
||||||
</pre>
|
|
||||||
|
|
||||||
## Main (Normal)
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
<kbd>PgDn</kbd>: scroll down (fn+up)
|
|
||||||
<kbd>PgUp</kbd>: scroll up (fn+down)
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
## Main (Staging)
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
<kbd>esc</kbd>: return to files panel
|
|
||||||
<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>space</kbd>: stage line
|
|
||||||
<kbd>e</kbd>: edit file
|
<kbd>e</kbd>: edit file
|
||||||
<kbd>o</kbd>: open file
|
<kbd>o</kbd>: open file
|
||||||
<kbd>v</kbd>: toggle drag select
|
<kbd>i</kbd>: add to .gitignore
|
||||||
<kbd>V</kbd>: toggle drag select
|
<kbd>r</kbd>: refresh files
|
||||||
<kbd>a</kbd>: toggle select hunk
|
<kbd>s</kbd>: stash changes
|
||||||
<kbd>c</kbd>: commit chages
|
<kbd>S</kbd>: view stash options
|
||||||
<kbd>W</kbd>: commit changes without pre-commit hook
|
<kbd>a</kbd>: stage/unstage all
|
||||||
<kbd>C</kbd>: commit changes using git editor
|
<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>
|
</pre>
|
||||||
|
|
||||||
## Main (Merging)
|
## Main Panel (Merging)
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>esc</kbd>: return to files panel
|
<kbd>esc</kbd>: return to files panel
|
||||||
|
@ -146,3 +140,63 @@
|
||||||
<kbd>▼</kbd>: select bottom hunk
|
<kbd>▼</kbd>: select bottom hunk
|
||||||
<kbd>z</kbd>: undo
|
<kbd>z</kbd>: undo
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
## 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
|
||||||
|
<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>: 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 changes
|
||||||
|
<kbd>w</kbd>: commit changes without pre-commit hook
|
||||||
|
<kbd>C</kbd>: commit changes using git editor
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
## Stash Panel
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<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>
|
||||||
|
|
|
@ -1,46 +1,21 @@
|
||||||
# Lazygit menu
|
# Lazygit Keybindings
|
||||||
|
|
||||||
## Global
|
## Global
|
||||||
|
|
||||||
<pre>
|
<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>m</kbd>: bekijk merge/rebase opties
|
||||||
|
<kbd>ctrl+p</kbd>: view custom patch options
|
||||||
<kbd>P</kbd>: push
|
<kbd>P</kbd>: push
|
||||||
<kbd>p</kbd>: pull
|
<kbd>p</kbd>: pull
|
||||||
<kbd>R</kbd>: verversen
|
<kbd>R</kbd>: verversen
|
||||||
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>:</kbd>: voor aangepast commando uit
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Status
|
## Branches Panel (Branches Tab)
|
||||||
|
|
||||||
<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
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>space</kbd>: uitchecken
|
<kbd>space</kbd>: uitchecken
|
||||||
|
@ -51,10 +26,54 @@
|
||||||
<kbd>d</kbd>: verwijder branch
|
<kbd>d</kbd>: verwijder branch
|
||||||
<kbd>r</kbd>: rebase branch
|
<kbd>r</kbd>: rebase branch
|
||||||
<kbd>M</kbd>: merge in met huidige checked out 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>f</kbd>: fast-forward this branch from its upstream
|
||||||
|
<kbd>g</kbd>: bekijk reset opties
|
||||||
</pre>
|
</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>
|
<pre>
|
||||||
<kbd>s</kbd>: squash beneden
|
<kbd>s</kbd>: squash beneden
|
||||||
|
@ -75,39 +94,41 @@
|
||||||
<kbd>C</kbd>: kopiëer commit reeks (cherry-pick)
|
<kbd>C</kbd>: kopiëer commit reeks (cherry-pick)
|
||||||
<kbd>v</kbd>: plak commits (cherry-pick)
|
<kbd>v</kbd>: plak commits (cherry-pick)
|
||||||
<kbd>enter</kbd>: bekijk gecommite bestanden
|
<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>
|
</pre>
|
||||||
|
|
||||||
## Stash
|
## Commits Panel (Reflog Tab)
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>space</kbd>: toepassen
|
<kbd>space</kbd>: checkout commit
|
||||||
<kbd>g</kbd>: pop
|
<kbd>g</kbd>: bekijk reset opties
|
||||||
<kbd>d</kbd>: drop
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Commit bestanden
|
## Bestanden Panel
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>esc</kbd>: ga terug
|
<kbd>c</kbd>: Commit veranderingen
|
||||||
<kbd>c</kbd>: bestand uitchecken
|
<kbd>w</kbd>: commit veranderingen zonder pre-commit hook
|
||||||
<kbd>d</kbd>: uitsluit deze commit zijn veranderingen aan dit bestand
|
<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>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>
|
</pre>
|
||||||
|
|
||||||
## Hoofd (Stage Lines/Hunks)
|
## Hoofd Panel (Merging)
|
||||||
|
|
||||||
<pre>
|
|
||||||
<kbd>esc</kbd>: ga terug naar het bestanden paneel
|
|
||||||
<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
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
## Hoofd (Merging)
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>esc</kbd>: ga terug naar het bestanden paneel
|
<kbd>esc</kbd>: ga terug naar het bestanden paneel
|
||||||
|
@ -120,9 +141,62 @@
|
||||||
<kbd>z</kbd>: ongedaan maken
|
<kbd>z</kbd>: ongedaan maken
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Hoofd (Normaal)
|
## Hoofd Panel (Normaal)
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>PgDn</kbd>: scroll omlaag (fn+up)
|
<kbd> ̄</kbd>: scroll omlaag (fn+up)
|
||||||
<kbd>PgUp</kbd>: scroll omhoog (fn+down)
|
<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 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 Panel (Stage Lines/Hunks)
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>esc</kbd>: ga terug naar het bestanden paneel
|
||||||
|
<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>
|
||||||
|
|
||||||
|
## Stash Panel
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<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>
|
</pre>
|
||||||
|
|
|
@ -1,46 +1,21 @@
|
||||||
# Lazygit menu
|
# Lazygit Keybindings
|
||||||
|
|
||||||
## Globalne
|
## Globalne
|
||||||
|
|
||||||
<pre>
|
<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>m</kbd>: view merge/rebase options
|
||||||
|
<kbd>ctrl+p</kbd>: view custom patch options
|
||||||
<kbd>P</kbd>: push
|
<kbd>P</kbd>: push
|
||||||
<kbd>p</kbd>: pull
|
<kbd>p</kbd>: pull
|
||||||
<kbd>R</kbd>: odśwież
|
<kbd>R</kbd>: odśwież
|
||||||
|
<kbd>+</kbd>: next screen mode (normal/half/fullscreen)
|
||||||
|
<kbd>_</kbd>: prev screen mode
|
||||||
|
<kbd>:</kbd>: execute custom command
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Status
|
## Gałęzie Panel (Branches Tab)
|
||||||
|
|
||||||
<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
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>space</kbd>: przełącz
|
<kbd>space</kbd>: przełącz
|
||||||
|
@ -51,10 +26,54 @@
|
||||||
<kbd>d</kbd>: usuń gałąź
|
<kbd>d</kbd>: usuń gałąź
|
||||||
<kbd>r</kbd>: rebase branch
|
<kbd>r</kbd>: rebase branch
|
||||||
<kbd>M</kbd>: scal do obecnej gałęzi
|
<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>f</kbd>: fast-forward this branch from its upstream
|
||||||
|
<kbd>g</kbd>: view reset options
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Commity
|
## 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>
|
||||||
|
|
||||||
|
## 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>
|
<pre>
|
||||||
<kbd>s</kbd>: ściśnij w dół
|
<kbd>s</kbd>: ściśnij w dół
|
||||||
|
@ -75,46 +94,41 @@
|
||||||
<kbd>C</kbd>: copy commit range (cherry-pick)
|
<kbd>C</kbd>: copy commit range (cherry-pick)
|
||||||
<kbd>v</kbd>: paste commits (cherry-pick)
|
<kbd>v</kbd>: paste commits (cherry-pick)
|
||||||
<kbd>enter</kbd>: view commit's files
|
<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>
|
</pre>
|
||||||
|
|
||||||
## Schowek
|
## Commity Panel (Reflog Tab)
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>space</kbd>: zastosuj
|
<kbd>space</kbd>: checkout commit
|
||||||
<kbd>g</kbd>: wyciągnij
|
<kbd>g</kbd>: view reset options
|
||||||
<kbd>d</kbd>: porzuć
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
## Commit files
|
## Pliki Panel
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>esc</kbd>: go back
|
<kbd>c</kbd>: commituj zmiany
|
||||||
<kbd>c</kbd>: checkout file
|
<kbd>w</kbd>: commit changes without pre-commit hook
|
||||||
<kbd>d</kbd>: discard this commit's changes to this file
|
<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>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>
|
</pre>
|
||||||
|
|
||||||
## Main (Normal)
|
## Main Panel (Merging)
|
||||||
|
|
||||||
<pre>
|
|
||||||
<kbd>PgDn</kbd>: scroll down (fn+up)
|
|
||||||
<kbd>PgUp</kbd>: scroll up (fn+down)
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
## Main (Zatwierdzanie)
|
|
||||||
|
|
||||||
<pre>
|
|
||||||
<kbd>esc</kbd>: wróć do panelu plików
|
|
||||||
<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
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
## Main (Merging)
|
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<kbd>esc</kbd>: wróć do panelu plików
|
<kbd>esc</kbd>: wróć do panelu plików
|
||||||
|
@ -126,3 +140,63 @@
|
||||||
<kbd>▼</kbd>: select bottom hunk
|
<kbd>▼</kbd>: select bottom hunk
|
||||||
<kbd>z</kbd>: undo
|
<kbd>z</kbd>: undo
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
## 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 (Zatwierdzanie)
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
<kbd>esc</kbd>: wróć do panelu plików
|
||||||
|
<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>
|
||||||
|
|
|
@ -225,6 +225,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.scrollUpMain,
|
Handler: gui.scrollUpMain,
|
||||||
Alternative: "fn+up",
|
Alternative: "fn+up",
|
||||||
|
Description: gui.Tr.SLocalize("scrollUpMainPanel"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "",
|
ViewName: "",
|
||||||
|
@ -232,6 +233,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.scrollDownMain,
|
Handler: gui.scrollDownMain,
|
||||||
Alternative: "fn+down",
|
Alternative: "fn+down",
|
||||||
|
Description: gui.Tr.SLocalize("scrollDownMainPanel"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
ViewName: "",
|
ViewName: "",
|
||||||
|
|
|
@ -564,6 +564,54 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "RebaseOptionsTitle",
|
ID: "RebaseOptionsTitle",
|
||||||
Other: "Rebase Options",
|
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{
|
}, &i18n.Message{
|
||||||
ID: "ConflictsResolved",
|
ID: "ConflictsResolved",
|
||||||
Other: "all merge conflicts resolved. Continue?",
|
Other: "all merge conflicts resolved. Continue?",
|
||||||
|
@ -651,6 +699,12 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "ScrollUp",
|
ID: "ScrollUp",
|
||||||
Other: "scroll up",
|
Other: "scroll up",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "scrollUpMainPanel",
|
||||||
|
Other: "scroll up main panel",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "scrollDownMainPanel",
|
||||||
|
Other: "scroll down main panel",
|
||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "AmendCommitTitle",
|
ID: "AmendCommitTitle",
|
||||||
Other: "Amend Commit",
|
Other: "Amend Commit",
|
||||||
|
@ -692,7 +746,7 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||||
Other: "view commit's files",
|
Other: "view commit's files",
|
||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "CommitFilesTitle",
|
ID: "CommitFilesTitle",
|
||||||
Other: "Commit files",
|
Other: "Commit Files",
|
||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "goBack",
|
ID: "goBack",
|
||||||
Other: "go back",
|
Other: "go back",
|
||||||
|
@ -951,6 +1005,12 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "prevScreenMode",
|
ID: "prevScreenMode",
|
||||||
Other: "prev screen mode",
|
Other: "prev screen mode",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "Panel",
|
||||||
|
Other: "Panel",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "Keybindings",
|
||||||
|
Other: "Keybindings",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/jesseduffield/lazygit/pkg/app"
|
"github.com/jesseduffield/lazygit/pkg/app"
|
||||||
|
@ -60,33 +61,87 @@ func formatTitle(title string) string {
|
||||||
|
|
||||||
func formatBinding(binding *gui.Binding) string {
|
func formatBinding(binding *gui.Binding) string {
|
||||||
if binding.Alternative != "" {
|
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 {
|
func getBindingSections(mApp *app.App) []*bindingSection {
|
||||||
bindingSections := []*bindingSection{}
|
bindingSections := []*bindingSection{}
|
||||||
|
|
||||||
// TODO: add context-based keybindings
|
bindings := mApp.Gui.GetInitialKeybindings()
|
||||||
for _, binding := range mApp.Gui.GetInitialKeybindings() {
|
|
||||||
if binding.Description == "" {
|
type contextAndViewType struct {
|
||||||
continue
|
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
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type groupedBindingsType struct {
|
||||||
|
contextAndView contextAndViewType
|
||||||
|
bindings []*gui.Binding
|
||||||
|
}
|
||||||
|
|
||||||
|
groupedBindings := make([]groupedBindingsType, len(contextAndViewBindingMap))
|
||||||
|
|
||||||
|
for contextAndView, contextBindings := range contextAndViewBindingMap {
|
||||||
|
groupedBindings = append(groupedBindings, groupedBindingsType{contextAndView: contextAndView, bindings: contextBindings})
|
||||||
|
}
|
||||||
|
|
||||||
|
sort.Slice(groupedBindings, func(i, j int) bool {
|
||||||
|
first := groupedBindings[i].contextAndView
|
||||||
|
second := groupedBindings[j].contextAndView
|
||||||
|
if first.viewName == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if second.viewName == "" {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return first.viewName < second.viewName || (first.viewName == second.viewName && first.context < second.context)
|
||||||
|
})
|
||||||
|
|
||||||
|
for _, group := range groupedBindings {
|
||||||
|
contextAndView := group.contextAndView
|
||||||
|
contextBindings := group.bindings
|
||||||
|
mApp.Log.Warn("viewname: " + contextAndView.viewName + ", context: " + contextAndView.context)
|
||||||
|
viewName := contextAndView.viewName
|
||||||
if viewName == "" {
|
if viewName == "" {
|
||||||
viewName = "global"
|
viewName = "global"
|
||||||
}
|
}
|
||||||
title := localisedTitle(mApp, viewName)
|
translatedView := localisedTitle(mApp, viewName)
|
||||||
|
var title string
|
||||||
bindingSections = addBinding(title, bindingSections, binding)
|
if contextAndView.context == "" {
|
||||||
}
|
addendum := " " + mApp.Tr.SLocalize("Panel")
|
||||||
|
if viewName == "global" {
|
||||||
for contextName, contextBindings := range mApp.Gui.GetContextMap() {
|
addendum = ""
|
||||||
translatedView := localisedTitle(mApp, contextBindings[0].ViewName)
|
}
|
||||||
translatedContextName := localisedTitle(mApp, contextName)
|
title = fmt.Sprintf("%s%s", translatedView, addendum)
|
||||||
title := fmt.Sprintf("%s (%s)", translatedView, translatedContextName)
|
} else {
|
||||||
|
translatedContextName := localisedTitle(mApp, contextAndView.context)
|
||||||
|
title = fmt.Sprintf("%s %s (%s)", translatedView, mApp.Tr.SLocalize("Panel"), translatedContextName)
|
||||||
|
}
|
||||||
|
|
||||||
for _, binding := range contextBindings {
|
for _, binding := range contextBindings {
|
||||||
bindingSections = addBinding(title, bindingSections, binding)
|
bindingSections = addBinding(title, bindingSections, binding)
|
||||||
|
@ -117,7 +172,7 @@ func addBinding(title string, bindingSections []*bindingSection, binding *gui.Bi
|
||||||
}
|
}
|
||||||
|
|
||||||
func formatSections(mApp *app.App, bindingSections []*bindingSection) string {
|
func formatSections(mApp *app.App, bindingSections []*bindingSection) string {
|
||||||
content := fmt.Sprintf("# Lazygit %s\n", mApp.Tr.SLocalize("menu"))
|
content := fmt.Sprintf("# Lazygit %s\n", mApp.Tr.SLocalize("Keybindings"))
|
||||||
|
|
||||||
for _, section := range bindingSections {
|
for _, section := range bindingSections {
|
||||||
content += formatTitle(section.title)
|
content += formatTitle(section.title)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue