mirror of
https://github.com/antonmedv/fx
synced 2024-11-03 15:40:12 +00:00
Add vim motions to box.key (j/k/h/l)
This commit is contained in:
parent
b63088e94c
commit
f892e8869d
4
docs.md
4
docs.md
@ -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:
|
||||
|
8
fx.js
8
fx.js
@ -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…
Reference in New Issue
Block a user