From 320d028e7aecbddc65aa03bc17bf6d9b6e5fc95d Mon Sep 17 00:00:00 2001 From: mazunki Date: Fri, 31 Dec 2021 09:17:16 +0100 Subject: [PATCH] updated install instructions to modern usage of Go, added the c as a shortcut to toggle collapse/expand --- README.md | 3 ++- jsonui.go | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d28355..5a07d35 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ ![](img/jsonui.gif) ## Install -`go get -u github.com/gulyasm/jsonui` +`go install github.com/gulyasm/jsonui@latest` +Binary will be installed into `${GOPATH}/bin`, where `GOPATH` defaults to `~/go`. Make sure the bin directory is in your `$PATH`. ## Binary Releases [Binary releases are availabe](https://github.com/gulyasm/jsonui/releases) diff --git a/jsonui.go b/jsonui.go index 1f6fa0d..5d4dc5e 100644 --- a/jsonui.go +++ b/jsonui.go @@ -120,6 +120,9 @@ func main() { if err := g.SetKeybinding(treeView, 'e', gocui.ModNone, toggleExpand); err != nil { log.Panicln(err) } + if err := g.SetKeybinding(treeView, 'c', gocui.ModNone, toggleExpand); err != nil { + log.Panicln(err) + } if err := g.SetKeybinding(treeView, 'E', gocui.ModNone, expandAll); err != nil { log.Panicln(err) } @@ -147,7 +150,8 @@ j/ArrowDown ═ Move a line down k/ArrowUp ═ Move a line up J/PageDown ═ Move 15 line down K/PageUp ═ Move 15 line up -e ═ Toggle expend/collapse node +e ═ Toggle expand/collapse node +c ═ Toggle expand/collapse node E ═ Expand all nodes C ═ Collapse all nodes q/ctrl+c ═ Exit