anchor.diff:                  if editor.Text.[endOfWord] = ' ' then editor.FindCurrentWordEnd (endOfWord+1) - 1 else endOfWord
               editor.Caret.Offset, endOfWord
           | BackwardToEndOfWord -> editor.Caret.Offset, editor.FindPrevWordOffset editor.Caret.Offset |> editor.FindCurrentWordEnd
  +        | HalfPageUp -> 
  +            let visibleLineCount = getVisibleLineCount editor
  +            let halfwayUp = Math.Max(1, editor.Caret.Line - visibleLineCount / 2)
  +            editor.Caret.Offset, editor.GetLine(halfwayUp).Offset
  +        | HalfPageDown -> 
  +            let visibleLineCount = getVisibleLineCount editor
  +            let halfwayDown = Math.Min(editor.Document.LineCount, editor.Caret.Line + visibleLineCount / 2)
  +            editor.Caret.Offset, editor.GetLine(halfwayDown).Offset
           | _ -> 0,0
   
   type XSVim() =
  
positive.code: 
      let findCharRange (editor:TextEditorData) startChar endChar =
          findCharBackwards editor startChar, findCharForwards editor endChar
  
      let getRange (editor:TextEditorData) motion =
          let line = editor.GetLine editor.Caret.Line
  
negative.code:     let handleKeyPress state (keyPress:KeyDescriptor) editorData =
          let newKeys =
              match state.mode, keyPress.KeyChar with
              | NormalMode, c when keyPress.ModifierKeys = ModifierKeys.Control ->
                  state.keys @ [sprintf "<C-%c>" c]
              | NormalMode, c when keyPress.KeyChar <> '\000' -> state.keys @ [c |> string]
              | InsertMode, c when keyPress.KeyChar = '\000' ->
                  match keyPress.SpecialKey with
  