update readme and help

develop 1.2.0
skanehira 5 years ago
parent 9cbf059a23
commit a38189612d

@ -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 |

@ -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)
}

Loading…
Cancel
Save