Add vim motions to box.key (j/k/h/l)

js-version
Alex 6 years ago committed by Anton Medvedev
parent b63088e94c
commit f892e8869d

@ -163,8 +163,8 @@ Next commands available in interactive mode:
| `q` or `Esc` or `Ctrl`+`c` | Exit |
| `e`/`E` | Expand/Collapse all |
| `g`/`G` | Goto top/bottom |
| `up`/`down` | Move cursor up/down |
| `left`/`right` | Expand/Collapse |
| `up`/`down` or `k/j` | Move cursor up/down |
| `left`/`right` or `h/l` | Expand/Collapse |
| `.` | Edit filter |
These commands are available when editing the filter:

@ -164,7 +164,7 @@ module.exports = function start(filename, source) {
render()
})
box.key('up', function () {
box.key(['up', 'k'], function () {
program.showCursor()
const [n] = getLine(program.y)
@ -184,7 +184,7 @@ module.exports = function start(filename, source) {
}
})
box.key('down', function () {
box.key(['down', 'j'], function () {
program.showCursor()
const [n] = getLine(program.y)
@ -204,7 +204,7 @@ module.exports = function start(filename, source) {
}
})
box.key('right', function () {
box.key(['right', 'l'], function () {
const [n, line] = getLine(program.y)
program.showCursor()
program.cursorPos(program.y, line.search(/\S/))
@ -215,7 +215,7 @@ module.exports = function start(filename, source) {
}
})
box.key('left', function () {
box.key(['left', 'h'], function () {
const [n, line] = getLine(program.y)
program.showCursor()
program.cursorPos(program.y, line.search(/\S/))

Loading…
Cancel
Save