 class SelectOccurrenceInAll extends SelectOccurrence
   @extend()
   target: "All"
+
+class ConvertRangeMarkerToSelection extends Select
+  @extend()
+  flashTarget: false
+  target: "ARangeMarker"
+  execute: ->
+    super
+    @vimState.clearRangeMarkers()
+
+
+# Range Marker
+# =========================
+class CreateRangeMarker extends Operator
+  @extend()
+  keepCursorPosition: true
+  flashTarget: false
+
+  mutateSelection: (selection) ->
+    @vimState.addRangeMarkersForRanges([selection.getBufferRange()])
+    if selection.isLastSelection()
+      @restorePoint(selection)
+    else
+      selection.destroy()
+
+class ToggleRangeMarker extends CreateRangeMarker
+  @extend()
+  getRangeMarkerAtCursor: ->
+    point = @editor.getCursorBufferPosition()
+
+    containsPoint = (rangeMarker, point) ->
+      rangeMarker.getBufferRange().containsPoint(point, exclusive)
+
+    exclusive = false
+    for rangeMarker in @vimState.getRangeMarkers() when containsPoint(rangeMarker, point)
+      return rangeMarker
+
+  initialize: ->
+    rangeMarker = @getRangeMarkerAtCursor()
+    if rangeMarker?
+      rangeMarker.destroy()
+      @vimState.removeRangeMarker(rangeMarker)
+      @abort()
+
+class ToggleRangeMarkerOnInnerWord extends ToggleRangeMarker
+  @extend()
+  target: 'InnerWord'
 
 # Delete
 # ================================


  execute: ->
    @selectTarget()
    if canChangeMode()
      submode = swrap.detectVisualModeSubmode(@editor)
      @activateModeIfNecessary('visual', submode)


  mutateSelection: (selection) ->
    swrap(selection).expandOverLine()
    super

# Yank
# =========================
class Yank extends Operator
  @extend()
  hover: icon: ':yank:', emoji: ':clipboard:'
  trackChange: true
  stayOnLinewise: true

  mutateSelection: (selection) ->
    @setTextToRegisterForSelection(selection)
    @restorePoint(selection)

class YankLine extends Yank
  @extend()
  target: 'MoveToRelativeLine'

  mutateSelection: (selection) ->
    if @isMode('visual')
      swrap(selection).expandOverLine()
      swrap(selection).preserveCharacterwise()
    super

class YankToLastCharacterOfLine extends Yank
  @extend()
  target: 'MoveToLastCharacterOfLine'

# TransformString
# ================================
