]> git.r.bdr.sh - rbdr/dotfiles/blame - atom/packages/vim-surround/lib/vim-surround.coffee
Adds atom packages
[rbdr/dotfiles] / atom / packages / vim-surround / lib / vim-surround.coffee
CommitLineData
24c7594d
BB
1{CompositeDisposable} = require 'atom'
2
3Surround = require './command/surround'
4Delete = require './command/delete'
5Change = require './command/change'
6
7module.exports =
8 config:
9 pairs:
10 type: 'array'
11 default: ['()', '{}', '[]', '""', "''"]
12 items:
13 type: 'string'
14 changeSurroundCommand:
15 type: 'string'
16 default: 'c s'
17 deleteSurroundCommand:
18 type: 'string'
19 default: 'd s'
20 surroundCommand:
21 type: 'string'
22 default: 's'
455f099b
BB
23 deleteCommand:
24 type: 'string'
25 default: 'd s'
24c7594d
BB
26
27 activate: (state) ->
28 @commandClasses = [
29 Surround, Delete, Change
30 ]
31
32 @configLoop = atom.config.observe 'vim-surround', (config) =>
33 @disposables.dispose() if @disposables?
34 @disposables = new CompositeDisposable
35
36 @commands = []
37
38 for cls in @commandClasses
39 command = new cls config
40 @commands.push command
41 @disposables.add command.disposables
42
455f099b
BB
43 consumeVimMode: (vimMode) -> @vimMode = vimMode
44
45 deactivate: () -> @disposables.dispose()