vim {} motions
This commit is contained in:
parent
1d04dcf5c9
commit
e00da55c92
1 changed files with 20 additions and 1 deletions
|
|
@ -598,6 +598,25 @@ module.exports = {
|
||||||
|
|
||||||
return match;
|
return match;
|
||||||
}),
|
}),
|
||||||
|
"{": new Motion(function(ed) {
|
||||||
|
var session = ed.session;
|
||||||
|
var row = session.selection.lead.row;
|
||||||
|
while(row > 0 && !/\S/.test(session.getLine(row)))
|
||||||
|
row--;
|
||||||
|
while(/\S/.test(session.getLine(row)))
|
||||||
|
row--;
|
||||||
|
return {column: 0, row: row};
|
||||||
|
}),
|
||||||
|
"}": new Motion(function(ed) {
|
||||||
|
var session = ed.session;
|
||||||
|
var l = session.getLength();
|
||||||
|
var row = session.selection.lead.row;
|
||||||
|
while(row < l && !/\S/.test(session.getLine(row)))
|
||||||
|
row++;
|
||||||
|
while(/\S/.test(session.getLine(row)))
|
||||||
|
row++;
|
||||||
|
return {column: 0, row: row};
|
||||||
|
}),
|
||||||
"ctrl-d": {
|
"ctrl-d": {
|
||||||
nav: function(editor, range, count, param) {
|
nav: function(editor, range, count, param) {
|
||||||
editor.selection.clearSelection();
|
editor.selection.clearSelection();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue