       else
         [key[0], @parseKeySequence(key[1..])...]
 
-  parseCustomKeyMappings: (customKeyMappings) ->
-    for line in BgUtils.parseLines customKeyMappings
-      tokens = line.split /\s+/
-      switch tokens[0]
-        when "map"
-          [ _, key, command, optionList... ] = tokens
-          keySequence = @parseKeySequence key
-          if command? and @availableCommands[command]
-            key = keySequence.join ""
-            BgUtils.log "mapping [\"#{keySequence.join '", "'}\"] to #{command}"
-            @mapKeyToCommand { key, command, keySequence, options: @parseCommandOptions command, optionList }
-          else
-            BgUtils.log "skipping [\"#{keySequence.join '", "'}\"] for #{command} -- something is not right"
-
-        when "unmap"
-          if tokens.length == 2
-            keySequence = @parseKeySequence tokens[1]
-            key = keySequence.join ""
-            BgUtils.log "Unmapping #{key}"
-            delete @keyToCommandRegistry[key]
-
-        when "unmapAll"
-          @keyToCommandRegistry = {}
-
-        when "mapkey"
-          if tokens.length == 3
-            fromChar = @parseKeySequence tokens[1]
-            toChar = @parseKeySequence tokens[2]
-            @mapKeyRegistry[fromChar[0]] = toChar[0] if fromChar.length == toChar.length == 1
-
-    # Push the key mapping for passNextKey into Settings so that it's available in the front end for insert
-    # mode.  We exclude single-key mappings (that is, printable keys) because when users press printable keys
-    # in insert mode they expect the character to be input, not to be droppped into some special Vimium
-    # mode.
-    Settings.set "passNextKeyKeys",
-      (key for own key of @keyToCommandRegistry when @keyToCommandRegistry[key].command == "passNextKey" and 1 < key.length)
-
   # Command options follow command mappings, and are of one of two forms:
   #   key=value     - a value
   #   key           - a flag


    options

  clearKeyMappingsAndSetDefaults: ->
    @keyToCommandRegistry = {}
    @mapKeyRegistry = {}
    for own key, command of defaultKeyMappings
      keySequence = @parseKeySequence key
      key = keySequence.join ""
      @mapKeyToCommand { key, command, keySequence }

  # This generates a nested key-to-command mapping structure. There is an example in mode_key_handler.coffee.
  generateKeyStateMapping: ->
    keyStateMapping = {}
    for own keys, registryEntry of @keyToCommandRegistry
      currentMapping = keyStateMapping

        else
          currentMapping[key] = extend {}, registryEntry
          # We don't need these properties in the content scripts.
          delete currentMapping[key][prop] for prop in ["keySequence", "description"]
    chrome.storage.local.set normalModeKeyStateMapping: keyStateMapping

  # An ordered listing of all available commands, grouped by type. This is the order they will
