diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2024-01-28 08:20:51 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-28 08:20:51 +1100 |
commit | 9bf3063457bb888b45d26923d52947314d2a218d (patch) | |
tree | c248ea926268ecd1e844d924fac438c6f1701edd | |
parent | cb1b13e95e09232cced846d167dae6cb21ba696e (diff) | |
parent | 7bddf532235cc67d847fd70d8f709b6401737936 (diff) |
Add loads of tooltips (#3269)
- **PR Description**
This is cherry-picked from
https://github.com/jesseduffield/lazygit/pull/3203. That PR both adds
tooltips and adds keybinding suggestions, and the latter part is having
some concurrency issues that I want to properly fix before merging.
- **Please check if the PR fulfills these requirements**
* [x] Cheatsheets are up-to-date (run `go generate ./...`)
* [x] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [x] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [x] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [x] Docs (specifically `docs/Config.md`) have been updated if
necessary
* [x] You've read through your own file changes for silly mistakes etc
<!--
Be sure to name your PR with an imperative e.g. 'Add worktrees view'
see https://github.com/jesseduffield/lazygit/releases/tag/v0.40.0 for
examples
-->
44 files changed, 3832 insertions, 3503 deletions
diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index be109f5ca..693c56359 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -6,356 +6,358 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_ ## Global keybindings -<pre> - <kbd><c-r></kbd>: Switch to a recent repo - <kbd><pgup></kbd>: Scroll up main panel (fn+up/shift+k) - <kbd><pgdown></kbd>: Scroll down main panel (fn+down/shift+j) - <kbd>@</kbd>: Open command log menu - <kbd>}</kbd>: Increase the size of the context shown around changes in the diff view - <kbd>{</kbd>: Decrease the size of the context shown around changes in the diff view - <kbd>:</kbd>: Execute custom command - <kbd><c-p></kbd>: View custom patch options - <kbd>m</kbd>: View merge/rebase options - <kbd>R</kbd>: Refresh - <kbd>+</kbd>: Next screen mode (normal/half/fullscreen) - <kbd>_</kbd>: Prev screen mode - <kbd>?</kbd>: Open menu - <kbd><c-s></kbd>: View filter-by-path options - <kbd>W</kbd>: Open diff menu - <kbd><c-e></kbd>: Open diff menu - <kbd><c-w></kbd>: Toggle whether or not whitespace changes are shown in the diff view - <kbd>z</kbd>: Undo - <kbd><c-z></kbd>: Redo - <kbd>P</kbd>: Push - <kbd>p</kbd>: Pull -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <c-r> `` | Switch to a recent repo | | +| `` <pgup> (fn+up/shift+k) `` | Scroll up main window | | +| `` <pgdown> (fn+down/shift+j) `` | Scroll down main window | | +| `` @ `` | View command log options | View options for the command log e.g. show/hide the command log and focus the command log. | +| `` P `` | Push | Push the current branch to its upstream branch. If no upstream is configured, you will be prompted to configure an upstream branch. | +| `` p `` | Pull | Pull changes from the remote for the current branch. If no upstream is configured, you will be prompted to configure an upstream branch. | +| `` } `` | Increase diff context size | Increase the amount of the context shown around changes in the diff view. | +| `` { `` | Decrease diff context size | Decrease the amount of the context shown around changes in the diff view. | +| `` : `` | Execute custom command | Bring up a prompt where you can enter a shell command to execute. Not to be confused with pre-configured custom commands. | +| `` <c-p> `` | View custom patch options | | +| `` m `` | View merge/rebase options | View options to abort/continue/skip the current merge/rebase. | +| `` R `` | Refresh | Refresh the git state (i.e. run `git status`, `git branch`, etc in background to update the contents of panels). This does not run `git fetch`. | +| `` + `` | Next screen mode (normal/half/fullscreen) | | +| `` _ `` | Prev screen mode | | +| `` ? `` | Open keybindings menu | | +| `` <c-s> `` | View filter-by-path options | View options for filtering the commit log by a file path, so that only commits relating to that path are shown. | +| `` W `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` <c-e> `` | View diffing options | View options relating to diffing two refs e.g. diffing against selected ref, entering ref to diff against, and reversing the diff direction. | +| `` q `` | Quit | | +| `` <esc> `` | Cancel | | +| `` <c-w> `` | Toggle whitespace | Toggle whether or not whitespace changes are shown in the diff view. | +| `` z `` | Undo | The reflog will be used to determine what git command to run to undo the last git command. This does not include changes to the working tree; only commits are taken into consideration. | +| `` <c-z> `` | Redo | The reflog will be used to determine what git command to run to redo the last git command. This does not include changes to the working tree; only commits are taken into consideration. | ## List panel navigation -<pre> - <kbd>,</kbd>: Previous page - <kbd>.</kbd>: Next page - <kbd><</kbd>: Scroll to top - <kbd>></kbd>: Scroll to bottom - <kbd>v</kbd>: Toggle range select - <kbd><s-down></kbd>: Range select down - <kbd><s-up></kbd>: Range select up - <kbd>/</kbd>: Search the current view by text - <kbd>H</kbd>: Scroll left - <kbd>L</kbd>: Scroll right - <kbd>]</kbd>: Next tab - <kbd>[</kbd>: Previous tab -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` , `` | Previous page | | +| `` . `` | Next page | | +| `` < `` | Scroll to top | | +| `` > `` | Scroll to bottom | | +| `` v `` | Toggle range select | | +| `` <s-down> `` | Range select down | | +| `` <s-up> `` | Range select up | | +| `` / `` | Search the current view by text | | +| `` H `` | Scroll left | | +| `` L `` | Scroll right | | +| `` ] `` | Next tab | | +| `` [ `` | Previous tab | | ## Commit files -<pre> - <kbd><c-o></kbd>: Copy the committed file name to the clipboard - <kbd>c</kbd>: Checkout file - <kbd>d</kbd>: Discard this commit's changes to this file - <kbd>o</kbd>: Open file - <kbd>e</kbd>: Edit file - <kbd><c-t></kbd>: Open external diff tool (git difftool) - <kbd><space></kbd>: Toggle file included in patch - <kbd>a</kbd>: Toggle all files included in patch - <kbd><enter></kbd>: Enter file to add selected lines to the patch (or toggle directory collapsed) - <kbd>`</kbd>: Toggle file tree view - <kbd>/</kbd>: Search the current view by text -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <c-o> `` | Copy path to clipboard | | +| `` c `` | Checkout | Checkout file. This replaces the file in your working tree with the version from the selected commit. | +| `` d `` | Remove | Discard this commit's changes to this file. This runs an interactive rebase in the background, so you may get a merge conflict if a later commit also changes this file. | +| `` o `` | Open file | Open file in default application. | +| `` e `` | Edit | Open file in external editor. | +| `` <c-t> `` | Open external diff tool (git difftool) | | +| `` <space> `` | Toggle file included in patch | Toggle whether the file is included in the custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. | +| `` a `` | Toggle all files | Add/remove all commit's files to custom patch. See https://github.com/jesseduffield/lazygit#rebase-magic-custom-patches. | +| `` <enter> `` | Enter file / Toggle directory collapsed | If a file is selected, enter the file so that you can add/remove individual lines to the custom patch. If a directory is selected, toggle the directory. | +| `` ` `` | Toggle file tree view | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. | +| `` / `` | Search the current view by text | | ## Commit summary -<pre> - <kbd><enter></kbd>: Confirm - <kbd><esc></kbd>: Close -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <enter> `` | Confirm | | +| `` <esc> `` | Close | | ## Commits -<pre> - <kbd><c-o></kbd>: Copy commit SHA to clipboard - <kbd><c-r></kbd>: Reset cherry-picked (copied) commits selection - <kbd>b</kbd>: View bisect options - <kbd>s</kbd>: Squash down - <kbd>f</kbd>: Fixup commit - <kbd>r</kbd>: Reword commit - <kbd>R</kbd>: Reword commit with editor - <kbd>d</kbd>: Delete commit - <kbd>e</kbd>: Edit commit - <kbd>i</kbd>: Start interactive rebase - <kbd>p</kbd>: Pick commit (when mid-rebase) - <kbd>F</kbd>: Create fixup commit for this commit - <kbd>S</kbd>: Squash all 'fixup!' commits above selected commit (autosquash) - <kbd><c-j></kbd>: Move commit down one - <kbd><c-k></kbd>: Move commit up one - <kbd>V</kbd>: Paste commits (cherry-pick) - <kbd>B</kbd>: Mark commit as base commit for rebase - <kbd>A</kbd>: Amend commit with staged changes - <kbd>a</kbd>: Set/Reset commit author - <kbd>t</kbd>: Revert commit - <kbd>T</kbd>: Tag commit - <kbd><c-l></kbd>: Open log menu - <kbd>w</kbd>: View worktree options - <kbd><space></kbd>: Checkout commit - <kbd>y</kbd>: Copy commit attribute - <kbd>o</kbd>: Open commit in browser - <kbd>n</kbd>: Create new branch off of commit - <kbd>g</kbd>: View reset options - <kbd>C</kbd>: Copy commit (cherry-pick) - <kbd><c-t></kbd>: Open external diff tool (git difftool) - <kbd><enter></kbd>: View selected item's files - <kbd>/</kbd>: Search the current view by text -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <c-o> `` | Copy commit SHA to clipboard | | +| `` <c-r> `` | Reset copied (cherry-picked) commits selection | | +| `` b `` | View bisect options | | +| `` s `` | Squash | Squash the selected commit into the commit below it. The selected commit's message will be appended to the commit below it. | +| `` f `` | Fixup | Meld the selected commit into the commit below it. Similar to fixup, but the selected commit's message will be discarded. | +| `` r `` | Reword | Reword the selected commit's message. | +| `` R `` | Reword with editor | | +| `` d `` | Drop | Drop the selected commit. This will remove the commit from the branch via a rebase. If the commit makes changes that later commits depend on, you may need to resolve merge conflicts. | +| `` e `` | Edit (start interactive rebase) | Edit the selected commit. Use this to start an interactive rebase from the selected commit. When already mid-rebase, this will mark the selected commit for editing, which means that upon continuing the rebase, the rebase will pause at the selected commit to allow you to make changes. | +| `` i `` | Start interactive rebase | Start an interactive rebase for the commits on your branch. This will include all commits from the HEAD commit down to the first merge commit or main branch commit. +If you would instead like to start an interactive rebase from the selected commit, press `e`. | +| `` p `` | Pick | Mark the selected commit to be picked (when mid-rebase). This means that the commit will be retained upon continuing the rebase. | +| `` F `` | Create fixup commit | Create 'fixup!' commit for the selected commit. Later on, you can press `S` on this same commit to apply all above fixup commits. | +| `` S `` | Apply fixup commits | Squash all 'fixup!' commits above selected commit (autosquash). | +| `` <c-j> `` | Move commit down one | | +| `` <c-k> `` | Move commit up one | | +| `` V `` | Paste (cherry-pick) | | +| `` B `` | Mark as base commit for rebase | Select a base commit for the next rebase. When you rebase onto a branch, only commits above the base commit will be brought across. This uses the `git rebase --onto` command. | +| `` A `` | Amend | Amend commit with staged changes. If the selected commit is the HEAD commit, this will perform `git commit --amend`. Otherwise the commit will be amended via a rebase. | +| `` a `` | Amend commit attribute | Set/Reset commit author or set co-author. | +| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. | +| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. | +| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. | +| `` <space> `` | Checkout | Checkout the selected commit as a detached HEAD. | +| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). | +| `` o `` | Open commit in browser | | +| `` n `` | Create new branch off of commit | | +| `` g `` | Reset | View reset options (soft/mixed/hard) for resetting onto selected item. | +| `` C `` | Copy (cherry-pick) | Mark commit as copied. Then, within the local commits view, you can press `V` to paste (cherry-pick) the copied commit(s) into your checked out branch. At any time you can press `<esc>` to cancel the selection. | +| `` <c-t> `` | Open external diff tool (git difftool) | | +| `` <enter> `` | View files | | +| `` w `` | View worktree options | | +| `` / `` | Search the current view by text | | ## Confirmation panel -<pre> - <kbd><enter></kbd>: Confirm - <kbd><esc></kbd>: Close/Cancel -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <enter> `` | Confirm | | +| `` <esc> `` | Close/Cancel | | ## Files -<pre> - <kbd><c-o></kbd>: Copy the file name to the clipboard - <kbd><space></kbd>: Toggle staged - <kbd><c-b></kbd>: Filter files by status - <kbd>y</kbd>: Copy to clipboard - <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><c-f></kbd>: Find base commit for fixup - <kbd>e</kbd>: Edit file - <kbd>o</kbd>: Open file - <kbd>i</kbd>: Ignore or exclude file - <kbd>r</kbd>: Refresh files - <kbd>s</kbd>: Stash all changes - <kbd>S</kbd>: View stash options - <kbd>a</kbd>: Stage/unstage all - <kbd><enter></kbd>: Stage individual hunks/lines for file, or collapse/expand for directory - <kbd>d</kbd>: View 'discard changes' options - <kbd>g</kbd>: View upstream reset options - <kbd>D</kbd>: View reset options - <kbd>`</kbd>: Toggle file tree view - <kbd><c-t></kbd>: Open external diff tool (git difftool) - <kbd>M</kbd>: Open external merge tool (git mergetool) - <kbd>f</kbd>: Fetch - <kbd>/</kbd>: Search the current view by text -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <c-o> `` | Copy path to clipboard | | +| `` <space> `` | Stage | Toggle staged for selected file. | +| `` <c-b> `` | Filter files by status | | +| `` y `` | Copy to clipboard | | +| `` c `` | Commit | Commit staged changes. | +| `` w `` | Commit changes without pre-commit hook | | +| `` A `` | Amend last commit | | +| `` C `` | Commit changes using git editor | | +| `` <c-f> `` | Find base commit for fixup | Find the commit that your current changes are building upon, for the sake of amending/fixing up the commit. This spares you from having to look through your branch's commits one-by-one to see which commit should be amended/fixed up. See docs: <https://github.com/jesseduffield/lazygit/tree/master/docs/Fixup_Commits.md> | +| `` e `` | Edit | Open file in external editor. | +| `` o `` | Open file | Open file in default application. | +| `` i `` | Ignore or exclude file | | +| `` r `` | Refresh files | | +| `` s `` | Stash | Stash all changes. For other variations of stashing, use the view stash options keybinding. | +| `` S `` | View stash options | View stash options (e.g. stash all, stash staged, stash unstaged). | +| `` a `` | Stage all | Toggle staged/unstaged for all files in working tree. | +| `` <enter> `` | Stage lines / Collapse directory | If the selected item is a file, focus the staging view so you can stage individual hunks/lines. If the selected item is a directory, collapse/expand it. | +| `` d `` | Discard | View options for discarding changes to the selected file. | +| `` g `` | View upstream reset options | | +| `` D `` | Reset | View reset options for working tree (e.g. nuking the working tree). | +| `` ` `` | Toggle file tree view | Toggle file view between flat and tree layout. Flat layout shows all file paths in a single list, tree layout groups files by directory. | +| `` <c-t> `` | Open external diff tool (git difftool) | | +| `` M `` | Open external merge tool | Run `git mergetool`. | +| `` f `` | Fetch | Fetch changes from remote. | +| `` / `` | Search the current view by text | | ## Local branches -<pre> - <kbd><c-o></kbd>: Copy branch name to clipboard - <kbd>i</kbd>: Show git-flow options - <kbd><space></kbd>: Checkout - <kbd>n</kbd>: New branch - <kbd>o</kbd>: Create pull request - <kbd>O</kbd>: Create pull request options - <kbd><c-y></kbd>: Copy pull request URL to clipboard - <kbd>c</kbd>: Checkout by name, enter '-' to switch to last - <kbd>F</kbd>: Force checkout - <kbd>d</kbd>: View delete options - <kbd>r</kbd>: Rebase checked-out branch onto this branch - <kbd>M</kbd>: Merge into currently checked out branch - <kbd>f</kbd>: Fast-forward this branch from its upstream - <kbd>T</kbd>: Create tag - <kbd>s</kbd>: Sort order - <kbd>g</kbd>: View reset options - <kbd>R</kbd>: Rename branch - <kbd>u</kbd>: View upstream options - <kbd>w</kbd>: View worktree options - <kbd><enter></kbd>: View commits - <kbd>/</kbd>: Filter the current view by text -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <c-o> `` | Copy branch name to clipboard | | +| `` i `` | Show git-flow options | | +| `` <space> `` | Checkout | Checkout selected item. | +| `` n `` | New branch | | +| `` o `` | Create pull request | | +| `` O `` | View create pull request options | | +| `` <c-y> `` | Copy pull request URL to clipboard | | +| `` c `` | Checkout by name | Checkout by name. In the input box you can enter '-' to switch to the last branch. | +| `` F `` | Force checkout | Force checkout selected branch. This will discard all local changes in your working directory before checking out the selected branch. | +| `` d `` | Delete | View delete options for local/remote branch. | +| `` r `` | Rebase | Rebase the checked-out branch onto the selected branch. | +| `` M `` | Merge | Merge selected branch into currently checked out branch. | +| `` f `` | Fast-forward | Fast-forward selected branch from its upstream. | +| `` T `` | New tag | | +| `` s `` | Sort order | | +| `` g `` | Reset | | +| `` R `` | Rename branch | | +| `` u `` | View upstream options | View options relating to the branch's upstream e.g. setting/unsetting the upstream and resetting to the upstream. | +| `` <enter> `` | View commits | | +| `` w `` | View worktree options | | +| `` / `` | Filter the current view by text | | ## Main panel (merging) -<pre> - <kbd>e</kbd>: Edit file - <kbd>o</kbd>: Open file - <kbd><left></kbd>: Select previous conflict - <kbd><right></kbd>: Select next conflict - <kbd><up></kbd>: Select previous hunk - <kbd><down></kbd>: Select next hunk - <kbd>z</kbd>: Undo - <kbd>M</kbd>: Open external merge tool (git mergetool) - <kbd><space></kbd>: Pick hunk - <kbd>b</kbd>: Pick all hunks - <kbd><esc></kbd>: Return to files panel -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <space> `` | Pick hunk | | +| `` b `` | Pick all hunks | | +| `` <up> `` | Previous hunk | | +| `` <down> `` | Next hunk | | +| `` <left> `` | Previous conflict | | +| `` <right> `` | Next conflict | | +| `` z `` | Undo | Undo last merge conflict resolution. | +| `` e `` | Edit file | Open file in external editor. | +| `` o `` | Open file | Open file in default application. | +| `` M `` | Open external merge tool | Run `git mergetool`. | +| `` <esc> `` | Return to files panel | | ## Main panel (normal) -<pre> - <kbd>mouse wheel down</kbd>: Scroll down (fn+up) - <kbd>mouse wheel up</kbd>: Scroll up (fn+down) -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` mouse wheel down (fn+up) `` | Scroll down | | +| `` mouse wheel up (fn+down) `` | Scroll up | | ## Main panel (patch building) -<pre> - <kbd><left></kbd>: Select previous hunk - <kbd><right></kbd>: Select next hunk - <kbd>v</kbd>: Toggle range select - <kbd>a</kbd>: Toggle select hunk - <kbd><c-o></kbd>: Copy the selected text to the clipboard - <kbd>o</kbd>: Open file - <kbd>e</kbd>: Edit file - <kbd><space></kbd>: Add/Remove line(s) to patch - <kbd><esc></kbd>: Exit custom patch builder - <kbd>/</kbd>: Search the current view by text -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <left> `` | Go to previous hunk | | +| `` <right> `` | Go to next hunk | | +| `` v `` | Toggle range select | | +| `` a `` | Select hunk | Toggle hunk selection mode. | +| `` <c-o> `` | Copy selected text to clipboard | | +| `` o `` | Open file | Open file in default application. | +| `` e `` | Edit file | Open file in external editor. | +| `` <space> `` | Toggle lines in patch | | +| `` <esc> `` | Exit custom patch builder | | +| `` / `` | Search the current view by text | | ## Main panel (staging) -<pre> - <kbd><left></kbd>: Select previous hunk - <kbd><right></kbd>: Select next hunk - <kbd>v</kbd>: Toggle range select - <kbd>a</kbd>: Toggle select hunk - <kbd><c-o></kbd>: Copy the selected text to the clipboard - <kbd>o</kbd>: Open file - <kbd>e</kbd>: Edit file - <kbd><esc></kbd>: Return to files panel - <kbd><tab></kbd>: Switch to other panel (staged/unstaged changes) - <kbd><space></kbd>: Toggle line staged / unstaged - <kbd>d</kbd>: Discard change (git reset) - <kbd>E</kbd>: Edit hunk - <kbd>c</kbd>: Commit changes - <kbd>w</kbd>: Commit changes without pre-commit hook - <kbd>C</kbd>: Commit changes using git editor - <kbd>/</kbd>: Search the current view by text -</pre> +| Key | Action | Info | +|-----|--------|-------------| +| `` <left> `` | Go to previous hunk | | +| `` <right> `` | Go to next hunk | | +| `` v `` | Toggle range select | | +| `` a `` | Select hunk | Toggle hunk selection mode. | +| `` <c-o> `` | Copy selected text to clipboard | | +| `` <space> `` | Stage | Toggle selection staged / unstaged. | +| `` d `` | Discard | When unstaged change is selected, discard the change using `git reset`. When staged change is selected, unstage the change. | +| `` o `` | Open file | Open file in default application. | +| `` e `` | Edit file | Open file in external editor. | +| `` <esc> `` | Return to files panel | | +| `` <tab> `` | Switch view | Switch to other view (staged/unstaged changes). | +| `` E `` | Edit hunk | Edit selected hunk in external editor. | +| `` c `` | Commit | Commit staged changes. | +| `` w `` | Commit changes without pre-commit hook | | +| `` C `` | Commit changes using git editor | | +| `` / `` | Search the current view by text | | |