File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 2
2
"name" : " nemacs" ,
3
3
"displayName" : " nemacs" ,
4
4
"description" : " Minimal emacs keys extension for VSCode with better mark/region support" ,
5
- "version" : " 1.0.1 " ,
5
+ "version" : " 1.0.2 " ,
6
6
"repository" : {
7
7
"type" : " git" ,
8
8
"url" : " https://github.com/naturalethic/nemacs.git"
48
48
{
49
49
"command" : " nemacs.cursorEnd" ,
50
50
"title" : " Cursor End"
51
+ },
52
+ {
53
+ "command" : " nemacs.killLine" ,
54
+ "title" : " Kill Line"
51
55
}
52
56
],
53
57
"keybindings" : [
339
343
{ "key" : " cmd+;" ,
340
344
"command" : " editor.action.commentLine" ,
341
345
"when" : " editorTextFocus"
346
+ },
347
+ {
348
+ "key" : " ctrl+k" ,
349
+ "command" : " nemacs.killLine" ,
350
+ "when" : " editorTextFocus"
342
351
}
343
352
]
344
353
},
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ export function activate(context: ExtensionContext) {
10
10
nemacs . cursorMove ( cmd )
11
11
} ) )
12
12
}
13
+ context . subscriptions . push ( commands . registerCommand ( 'nemacs.killLine' , ( ) => {
14
+ nemacs . killLine ( )
15
+ } ) )
13
16
context . subscriptions . push ( nemacs )
14
17
}
15
18
@@ -52,6 +55,16 @@ class Nemacs {
52
55
commands . executeCommand ( 'cancelSelection' )
53
56
}
54
57
58
+ public killLine ( ) {
59
+ let sel = window . activeTextEditor . selection
60
+ let line = window . activeTextEditor . document . lineAt ( sel . active . line )
61
+ if ( line . range . end . character == sel . active . character ) {
62
+ commands . executeCommand ( 'deleteRight' )
63
+ } else {
64
+ commands . executeCommand ( 'deleteAllRight' )
65
+ }
66
+ }
67
+
55
68
dispose ( ) {
56
69
this . disposable . dispose ( )
57
70
}
You can’t perform that action at this time.
0 commit comments