   destroy: =>
     @subscriptions.dispose()
 
+  excludePairs: (excludePairs) ->
+    if excludePairs.length
+      for excludePair in excludePairs
+        pairArray = excludePair.split ':'
+        @startPairMatches = _.omit(@startPairMatches, pairArray[0])
+        @endPairMatches = _.omit(@endPairMatches, pairArray[1])
+
+  addPairs: (addPairs) ->
+    if addPairs.length
+      for addPair in addPairs
+        pairArray = addPair.split ':'
+        newStartPair = {}
+        newStartPair[pairArray[0]] = pairArray[1]
+        @startPairMatches = _.extend(@startPairMatches, newStartPair)
+        newEndPair = {}
+        newEndPair[pairArray[1]] = pairArray[0]
+        @endPairMatches = _.extend(@endPairMatches, newEndPair)
+
+  updatePairs: () ->
+    @excludePairs(@getScopedSetting('bracket-matcher.excludePairs'))
+    @addPairs(@getScopedSetting('bracket-matcher.addPairs'))
+
+  getScopedSetting: (key) ->
+    atom.config.get(key, scope: @editor.getLastCursor().getScopeDescriptor())
+
   subscribeToCursor: ->
     cursor = @editor.getLastCursor()
     return unless cursor?

    return unless @editor.getLastSelection().isEmpty()
    return if @editor.isFoldedAtCursorRow()

    {position, currentPair, matchingPair} = @findCurrentPair(startPairMatches)
    if position
      matchPosition = @findMatchingEndPair(position, currentPair, matchingPair)
    else
      {position, currentPair, matchingPair} = @findCurrentPair(endPairMatches)
      if position
        matchPosition = @findMatchingStartPair(position, matchingPair, currentPair)



  findAnyStartPair: (cursorPosition) ->
    scanRange = new Range([0, 0], cursorPosition)
    startPair = _.escapeRegExp(_.keys(@startPairMatches).join(''))
    endPair = _.escapeRegExp(_.keys(@endPairMatches).join(''))
    combinedRegExp = new RegExp("[#{startPair}#{endPair}]", 'g')
    startPairRegExp = new RegExp("[#{startPair}]", 'g')
    endPairRegExp = new RegExp("[#{endPair}]", 'g')
