   copy: (text) ->
     super @clipboardContents = text
 
+  installFindMode: ->
+    previousFindRange = null
+
+    executeFind = (findBackwards) =>
+      query = getFindModeQuery()
+      if query
+        caseSensitive = Utils.hasUpperCase query
+        @protectClipboard =>
+          initialRange = @selection.getRangeAt(0).cloneRange()
+          direction = @getDirection()
+          which = if direction == forward then "start" else "end"
+
+          if previousFindRange
+            @selection.removeAllRanges()
+            @selection.addRange previousFindRange
+
+          window.find query, caseSensitive, findBackwards, true, false, true, false
+          previousFindRange = newFindRange = @selection.getRangeAt(0).cloneRange()
+
+          range = document.createRange()
+          range.setStart initialRange["#{which}Container"], initialRange["#{which}Offset"]
+          range.setEnd newFindRange.endContainer, newFindRange.endOffset
+          @selection.removeAllRanges()
+          @selection.addRange range
+
+          if @getDirection() == backward or @selection.toString().length == 0
+            range.setStart newFindRange.startContainer, newFindRange.startOffset
+            @selection.removeAllRanges()
+            @selection.addRange range
+
+    extend @movements,
+      "n": -> executeFind false
+      "N": -> executeFind true
+
 class VisualLineMode extends VisualMode
   constructor: (options = {}) ->
+    options.name = "visual/line"
     super options
     @selectLine() unless @selection?.type == "None"
 


# To do:
# - better implementation of `o`
# - caret mode
# - find operations (needs better implementation?)

enterInsertMode = ->
  new InsertMode { badge: "I", blurOnEscape: false }

      extend @commands,
        "d": -> @yank deleteFromDocument: true
        "c": -> @yank(); enterInsertMode()
    else
      @installFindMode()

    @clipboardContents = ""
    @paste (text) => @clipboardContents = text
