Vim keybindings for Light Table
JavaScript Clojure

Vim for Light Table

A thin wrapper around CodeMirror's vim mode that integrates it into Light Table.

For additional Vim-like functionality, see the guide for Vim Users.


Install the Vim plugin using the Plugin Manager. Vim keybindings only take effect on new files. Existing files will need to be reopened.

Mapping Keys

To map keys to normal mode, place them in a keymap under a or :editor.keys.vim.normal tag. These tags differ in what key combos are available, how keys are referred to and what they can map to. :editor.keys.vim.normal is for standard LightTable keybindings that support standard modifier-key combos e.g. ctrl-Y and map to LightTable command(s). Do not use this tag to map individual keys, remap keys to other keys or bind to non-standard key combos e.g. <Space>ob. is a tag that bypasses LightTable's normal keyhandling and interacts directly with the Vim CodeMirror plugin. This allows for the following more powerful but non-standard behavior:

  • Key combinations are not limited to modifier keys e.g. <Space>ob or jkl
  • Keys can be mapped to a string of keys or the standard LightTable command(s)
  • An individual key can be a keybinding
  • Special keys and modifier keys are referred to differently than in standard LightTable keybindings. For example, down is <down> and Ctrl-x is <C-x>. See the Vim CodeMirror keymap for more examples.

Some examples of these two tags:

;; Map a standard key combo to a command
[:editor.keys.vim.normal "alt-q" :lt.plugins.reflow/reflow]

;; Map an individual key to a LightTable command
[ ":" :vim.ex]

;; Remap a key to a sequence of keys
[ "j" "gj"]

For a thorough example of, see this config.

To map keys to visual mode, place them in a keymap under a or :editor.keys.vim.visual tag. These have the same behavior as their respective normal tags: supports powerful but non-standard keybindings while :editor.keys.vim.visual supports standard LightTable keybindings.

Our current vim mode version does not support mapping to other modes at this time.

For Committers

Upgrade vim.js with the following where $VERSION is a version number tag:

curl$VERSION/keymap/vim.js > vim.js

vim.js is currently on CodeMirror version 4.6.0.


Copyright (C) 2013 Kodowa Inc.

Distributed under the MIT license, see for the full text.