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 ## Keybinding
### JSON tree ### JSON tree
| key | description | | key | description |
|--------|--------------------------------| |--------|---------------------------------------------|
| j | move down | | j | move down |
| k | move up | | k | move up |
| g | move to the top | | g | move to the top |
| G | move to the bottom | | G | move to the bottom |
| ctrl-f | page up | | ctrl-f | page up |
| ctrl-b | page down | | ctrl-b | page down |
| h | hide current node | | h | hide current node |
| H | collaspe value nodes | | H | collaspe value nodes |
| l | expand current node | | l | expand current node |
| L | expand all nodes | | L | expand all nodes |
| r | read from file | | r | read from file |
| s | save to file | | s | save to file |
| a | add new node | | a | add new node |
| A | add new value | | A | add new value |
| d | clear children nodes | | d | clear children nodes |
| Enter | edit node | | e | edit json with $EDITOR(only when use --url) |
| / | search nodes | | Enter | edit node |
| ? | show helps | | / | search nodes |
| space | expand/collaspe children nodes | | ? | show helps |
| ctrl-j | move to next parent node | | space | expand/collaspe children nodes |
| ctrk-k | move to next previous node | | ctrl-j | move to next parent node |
| ctrl-c | exit tson | | ctrk-k | move to next previous node |
| ctrl-c | exit tson |
### help ### help
| key | description | | key | description |

@ -38,6 +38,7 @@ var (
addNewNode = fmt.Sprintf(RedColor, "a", " add new node") addNewNode = fmt.Sprintf(RedColor, "a", " add new node")
addNewValue = fmt.Sprintf(RedColor, "A", " add new value") addNewValue = fmt.Sprintf(RedColor, "A", " add new value")
clearChildrenNodes = fmt.Sprintf(RedColor, "d", " clear children nodes") 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") editNodeValue = fmt.Sprintf(RedColor, "Enter", "edit current node")
searchNodes = fmt.Sprintf(RedColor, "/", " search nodes") searchNodes = fmt.Sprintf(RedColor, "/", " search nodes")
toggleExpandNodes = fmt.Sprintf(RedColor, "space", " expand/collaspe 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") movePreParentNode = fmt.Sprintf(RedColor, "ctrl-k", "move to previous parent node")
treeNavi = strings.Join([]string{hideNode, collaspeAllNode, expandNode, expandAllNode, treeNavi = strings.Join([]string{hideNode, collaspeAllNode, expandNode, expandAllNode,
readFile, saveFile, addNewNode, addNewValue, clearChildrenNodes, editNodeValue, searchNodes, readFile, saveFile, addNewNode, addNewValue, clearChildrenNodes, editNodeValue, searchNodes,
moveNextParentNode, movePreParentNode}, "\n") moveNextParentNode, movePreParentNode, editNodes}, "\n")
) )
type Navi struct { type Navi struct {
@ -60,7 +61,7 @@ func NewNavi() *Navi {
} }
func (n *Navi) UpdateView() { func (n *Navi) UpdateView() {
navi := strings.Join([]string{"", defaultNavi, "", treeNavi}, "\n") navi := strings.Join([]string{defaultNavi, "", treeNavi}, "\n")
n.SetText(navi) n.SetText(navi)
} }

Loading…
Cancel
Save