summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-03-22 20:13:48 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-03-22 20:20:06 +1100
commite68dbeb7ebdd42a48e0a35ad436ef86be50569d7 (patch)
tree8e092cf0f8f18332928b55040c14ab8191fbba43
parent32ddf0c2960e1076c526b542332f8233d916e2dd (diff)
organise keybindings better
-rw-r--r--README.md4
-rw-r--r--docs/keybindings/Keybindings_en.md (renamed from docs/Keybindings_en.md)26
-rw-r--r--docs/keybindings/Keybindings_nl.md (renamed from docs/Keybindings_nl.md)0
-rw-r--r--docs/keybindings/Keybindings_pl.md (renamed from docs/Keybindings_pl.md)0
-rw-r--r--pkg/gui/status_panel.go2
-rw-r--r--scripts/generate_cheatsheet.go13
6 files changed, 28 insertions, 17 deletions
diff --git a/README.md b/README.md
index 83cd83e13..bcfb7d63f 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Jira? This is the app for you!
- [Installation](https://github.com/jesseduffield/lazygit#installation)
- [Usage](https://github.com/jesseduffield/lazygit#usage),
- [Keybindings](https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings_en.md)
+ [Keybindings](/docs/keybindings)
- [Cool Features](https://github.com/jesseduffield/lazygit#cool-features)
- [Contributing](https://github.com/jesseduffield/lazygit#contributing)
- [Video Tutorial](https://youtu.be/VDXvbHZYeKY)
@@ -104,7 +104,7 @@ whichever rc file you're using).
- Basic video tutorial [here](https://youtu.be/VDXvbHZYeKY).
- List of keybindings
- [here](/docs/Keybindings_en.md).
+ [here](/docs/keybindings).
## Cool features
diff --git a/docs/Keybindings_en.md b/docs/keybindings/Keybindings_en.md
index 108b6ba73..9d9d1471e 100644
--- a/docs/Keybindings_en.md
+++ b/docs/keybindings/Keybindings_en.md
@@ -91,6 +91,19 @@
<kbd>o</kbd>: open file
</pre>
+## Main (Merging)
+
+<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
+</pre>
+
## Main (Normal)
<pre>
@@ -109,16 +122,3 @@
<kbd>space</kbd>: stage line
<kbd>a</kbd>: stage hunk
</pre>
-
-## Main (Merging)
-
-<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
-</pre>
diff --git a/docs/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md
index dfa45df2c..dfa45df2c 100644
--- a/docs/Keybindings_nl.md
+++ b/docs/keybindings/Keybindings_nl.md
diff --git a/docs/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md
index 9e60e9657..9e60e9657 100644
--- a/docs/Keybindings_pl.md
+++ b/docs/keybindings/Keybindings_pl.md
diff --git a/pkg/gui/status_panel.go b/pkg/gui/status_panel.go
index 0ac9bd662..de1823a44 100644
--- a/pkg/gui/status_panel.go
+++ b/pkg/gui/status_panel.go
@@ -61,7 +61,7 @@ func (gui *Gui) handleStatusSelect(g *gocui.Gui, v *gocui.View) error {
[]string{
lazygitTitle(),
"Copyright (c) 2018 Jesse Duffield",
- "Keybindings: https://github.com/jesseduffield/lazygit/blob/master/docs/Keybindings.md",
+ "Keybindings: https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings",
"Config Options: https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md",
"Tutorial: https://youtu.be/VDXvbHZYeKY",
"Raise an Issue: https://github.com/jesseduffield/lazygit/issues",
diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go
index 529f37da8..7741c783f 100644
--- a/scripts/generate_cheatsheet.go
+++ b/scripts/generate_cheatsheet.go
@@ -31,7 +31,10 @@ func main() {
for _, lang := range langs {
os.Setenv("LC_ALL", lang)
mApp, _ := app.NewApp(mConfig)
- file, _ := os.Create("Keybindings_" + lang + ".md")
+ file, err := os.Create(getProjectRoot() + "/docs/keybindings/Keybindings_" + lang + ".md")
+ if err != nil {
+ panic(err)
+ }
bindingSections := getBindingSections(mApp)
content := formatSections(mApp, bindingSections)
@@ -126,3 +129,11 @@ func formatSections(mApp *app.App, bindingSections []*bindingSection) string {
return content
}
+
+func getProjectRoot() string {
+ dir, err := os.Getwd()
+ if err != nil {
+ panic(err)
+ }
+ return strings.Split(dir, "lazygit")[0] + "lazygit"
+}