Add Alt+Up/Down key bindings

This commit is contained in:
Simon Ser 2020-08-03 15:49:30 +02:00
parent 6c93bd13d1
commit aaa33d7f36
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -36,6 +36,39 @@ export const keybindings = [
} }
}, },
}, },
{
key: "ArrowUp",
altKey: true,
description: "Jump to the previous buffer",
execute: (app) => {
var prev = null;
for (var buf of app.state.buffers.values()) {
if (app.state.activeBuffer == buf.name) {
if (prev) {
app.switchBuffer(prev.name);
}
break;
}
prev = buf;
}
},
},
{
key: "ArrowDown",
altKey: true,
description: "Jump to the next buffer",
execute: (app) => {
var found = false;
for (var buf of app.state.buffers.values()) {
if (found) {
app.switchBuffer(buf.name);
break;
} else if (app.state.activeBuffer == buf.name) {
found = true;
}
}
},
},
]; ];
export function setup(app) { export function setup(app) {