     reversed = not @editor.getLastSelection().isReversed()
     for selection in @editor.getSelections()
       selection.setBufferRange(selection.getBufferRange(), {reversed})
+
+  # Search History
+  # -------------------------
+  pushSearchHistory: (search) -> # should be saveSearchHistory for consistency.
+    @globalVimState.searchHistory.unshift search
+
+  getSearchHistoryItem: (index = 0) ->
+    @globalVimState.searchHistory[index]
+
+  # Other
+  # -------------------------
+  # TODO: remove this method and bump the `vim-mode` service version number.
+  activateCommandMode: ->
+    Grim.deprecate("Use ::activateNormalMode instead")
+    @activateNormalMode()
+
+  ensureCursorIsWithinLine: (cursor) =>
+    return if @operationStack.isProcessing() or (not @isNormalMode())
+    # # [FIXME] I'm developping in buffer 'tryit.coffee'.
+    # # So disable auto-cursor modification especially for this bufffer temporarily.
+    # return if path.basename(@editor.getPath()) is 'tryit.coffee'
+
+    {goalColumn} = cursor
+    if cursor.isAtEndOfLine() and not cursor.isAtBeginningOfLine()
+      @operationStack.withLock -> # to ignore the cursor change (and recursion) caused by the next line
+        cursor.moveLeft()
+    cursor.goalColumn = goalColumn
 
   # Developper helpeing,
   # [FIXME] clean up needed and make it available only in dev-mode.

  onDidDestroy: (fn) ->
    @emitter.on('did-destroy', fn)

  # Private: Register multiple command handlers via an {Object} that maps
  # command names to command handler functions.
  #
  # Prefixes the given command names with 'vim-mode:' to reduce redundancy in
  # the provided object.
  registerCommands: (commands) ->
    for name, fn of commands
      do (fn) =>


  # Register operation command.
  # command-name is automatically mapped to correspoinding class.
  # e.g.
  #   join -> Join
  #   scroll-down -> ScrollDown
  registerOperationCommands: (kind, names) ->
    commands = {}
    for name in names
