-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.js
More file actions
33 lines (27 loc) · 807 Bytes
/
main.js
File metadata and controls
33 lines (27 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use babel";
const { CompositeDisposable } = require("atom");
const {
characterCommands,
recordCommand,
loadVmpCommands
} = require("./vim-mode-plus-macros");
module.exports = {
activate() {
// Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable
this.subscriptions = new CompositeDisposable();
this.subscriptions.add(
atom.commands.add("atom-workspace", characterCommands)
);
atom.commands.onDidDispatch(recordCommand);
},
deactivate() {
this.subscriptions.dispose();
},
consumeVim(service) {
const commands = loadVmpCommands(service);
for (const command of Object.values(commands)) {
command.commandPrefix = "vim-mode-plus-macros";
this.subscriptions.add(command.registerCommand());
}
}
};