diff --git a/README.md b/README.md index 0dff725..5f830c2 100644 --- a/README.md +++ b/README.md @@ -29,30 +29,31 @@ $ tson -url http://gorilla/likes/json ## Keybinding ### JSON tree -| key | description | -|--------|--------------------------------| -| j | move down | -| k | move up | -| g | move to the top | -| G | move to the bottom | -| ctrl-f | page up | -| ctrl-b | page down | -| h | hide current node | -| H | collaspe value nodes | -| l | expand current node | -| L | expand all nodes | -| r | read from file | -| s | save to file | -| a | add new node | -| A | add new value | -| d | clear children nodes | -| Enter | edit node | -| / | search nodes | -| ? | show helps | -| space | expand/collaspe children nodes | -| ctrl-j | move to next parent node | -| ctrk-k | move to next previous node | -| ctrl-c | exit tson | +| key | description | +|--------|---------------------------------------------| +| j | move down | +| k | move up | +| g | move to the top | +| G | move to the bottom | +| ctrl-f | page up | +| ctrl-b | page down | +| h | hide current node | +| H | collaspe value nodes | +| l | expand current node | +| L | expand all nodes | +| r | read from file | +| s | save to file | +| a | add new node | +| A | add new value | +| d | clear children nodes | +| e | edit json with $EDITOR(only when use --url) | +| Enter | edit node | +| / | search nodes | +| ? | show helps | +| space | expand/collaspe children nodes | +| ctrl-j | move to next parent node | +| ctrk-k | move to next previous node | +| ctrl-c | exit tson | ### help | key | description | diff --git a/gui/navi.go b/gui/navi.go index 773e666..0ef20b6 100644 --- a/gui/navi.go +++ b/gui/navi.go @@ -38,6 +38,7 @@ var ( addNewNode = fmt.Sprintf(RedColor, "a", " add new node") addNewValue = fmt.Sprintf(RedColor, "A", " add new value") clearChildrenNodes = fmt.Sprintf(RedColor, "d", " clear children nodes") + editNodes = fmt.Sprintf(RedColor, "e", " edit json with $EDITOR(only when use --url)") editNodeValue = fmt.Sprintf(RedColor, "Enter", "edit current node") searchNodes = fmt.Sprintf(RedColor, "/", " search nodes") toggleExpandNodes = fmt.Sprintf(RedColor, "space", " expand/collaspe nodes") @@ -45,7 +46,7 @@ var ( movePreParentNode = fmt.Sprintf(RedColor, "ctrl-k", "move to previous parent node") treeNavi = strings.Join([]string{hideNode, collaspeAllNode, expandNode, expandAllNode, readFile, saveFile, addNewNode, addNewValue, clearChildrenNodes, editNodeValue, searchNodes, - moveNextParentNode, movePreParentNode}, "\n") + moveNextParentNode, movePreParentNode, editNodes}, "\n") ) type Navi struct { @@ -60,7 +61,7 @@ func NewNavi() *Navi { } func (n *Navi) UpdateView() { - navi := strings.Join([]string{"", defaultNavi, "", treeNavi}, "\n") + navi := strings.Join([]string{defaultNavi, "", treeNavi}, "\n") n.SetText(navi) }