Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A JavaScript Vim simulator for demonstrations

tree: 48716188af

Fetching latest commit…

Cannot retrieve the latest commit at this time

README.md

Vimulator

Vimulator is a Vim simulator for teaching and demonstrating Vim. It has a subset of normal mode commands, and an insert mode.

Supported commands

Motions

  • h: Move left
  • j: Move down
  • k: Move up
  • l: Move right
  • 0: Move to the start of the line (before leading whitespace)
  • ^: Move to the start of the line (after leading whitespace)
  • $: Move to the end of the line
  • w: Move to the next word
  • W: Move to the next WORD
  • e: Move to the next word ending
  • E: Move to the next WORD ending
  • b: Move back to the previous word
  • B: Move back to the previous WORD
  • gg: Move to the first line of the file (or a specific line, if a count is given)
  • G: Move to the last line of the file (or a specific line, if a count is given)
  • + or Return: Move to the start of the next line (after leading whitespace)
  • -: Move to the start of the previous line (after leading whitespace)

Insertion

  • a: Append text after the cursor
  • A: Append text at the end of the line
  • i: Insert text before the cursor
  • I: Insert text at the start of the line (after leading whitespace)
  • gI: Insert text at the start of the line (before leading whitespace)
  • o: Open the next line
  • O: Open the previous line
  • s: Substitute characters under the cursor
  • S: Substitute to the end of the line

Operators

  • c, cc and C: Change text
  • d, dd and D: Delete text

Operators work with all of the motions listed above, and the following text objects:

  • ib and ab: Inside or around parentheses

Line search

  • f: Find the next occurrence of a chracter
  • F: Find the previous occurrence of a chracter
  • t: Find the character before the next occurrence of a character
  • T: Find the character after the previous ocurrence of a chracter
  • ;: Repeat the last line search
  • ,: Repeat the last line search, reversing the direction

Edits

  • r: Replace the character under the cursor
  • x: Delete the character under the cursor
  • X: Delete the character before the cursor
  • .: Repeat the last edit

License

Vimulator is licensed under the MIT license.

Something went wrong with that request. Please try again.