       @config[name].order = i
 
     # Automatically infer and inject `type` of each config parameter.
-    for key, object of @config
-      object.type = switch
-        when Number.isInteger(object.default) then 'integer'
-        when typeof(object.default) is 'boolean' then 'boolean'
-        when typeof(object.default) is 'string' then 'string'
-        when Array.isArray(object.default) then 'array'
+    # skip if value which aleady have `type` field.
+    # Also translate bare `boolean` value to {default: `boolean`} object
+    for key in Object.keys(@config)
+      if typeof(@config[key]) is 'boolean'
+        @config[key] = {default: @config[key]}
+      unless (value = @config[key]).type?
+        value.type = inferType(value.default)
 
   get: (param) ->
     if param is 'defaultRegister'

  useSmartcaseForSearchCurrentWord:
    default: false
    description: 'For `*` and `#`. Override `ignoreCaseForSearchCurrentWord`'
  highlightSearch:
    default: false
  highlightSearchExcludeScopes:
    default: []
    items: type: 'string'
    description: 'Suppress highlightSearch when any of these classes are present in the editor'
  incrementalSearch:
    default: false
  incrementalSearchVisitDirection:
    default: 'absolute'
    enum: ['absolute', 'relative']

    atom.config.observe "#{@scope}.#{param}", fn

module.exports = new Settings 'vim-mode-plus',
  setCursorToStartOfChangeOnUndoRedo: true
  groupChangesWhenLeavingInsertMode: true
  useClipboardAsDefaultRegister: false
  startInInsertMode: false
  startInInsertModeScopes:
    default: []
    items: type: 'string'
    description: 'Start in insert-mode whan editorElement matches scope'
  clearMultipleCursorsOnEscapeInsertMode: false
  autoSelectPersistentSelectionOnOperate: true
  wrapLeftRightMotion: false
  numberRegex:
    default: '-?[0-9]+'
    description: 'Used to find number in ctrl-a/ctrl-x. To ignore "-"(minus) char in string like "identifier-1" use "(?:\\B-)?[0-9]+"'
