Vim for Visual Studio Code
Go to file
2016-06-05 12:00:32 -07:00
.vscode Rewrite Normal Mode tests to use the ModeHandler interface. 2016-05-28 22:58:27 -04:00
images fix package in order to publish 2015-11-29 02:37:35 -08:00
src Add s keybinding 2016-06-05 18:23:11 +02:00
test Add s keybinding 2016-06-05 18:23:11 +02:00
typings scaffold project 2015-11-12 20:51:40 +01:00
.gitignore Update to new extension APIs. No longer requests binding to every single letter in package.json. 2016-05-19 02:59:16 -07:00
.travis.yml fix tests 2016-05-19 03:56:40 -07:00
.vscodeignore Tests: Fixes #15 enabling all tests to be run within Travis 2016-01-02 02:15:41 -08:00
appveyor.yml fix appveyor build 2016-03-18 02:38:50 -07:00
CONTRIBUTING.md 0.0.7 - update docs 2016-01-03 00:31:33 -08:00
DEVELOPING.md Create DEVELOPING.md 2016-06-05 11:58:46 -07:00
extension.ts Make all state transitions into Actions. 2016-05-29 21:59:07 -07:00
gulpfile.js fix gulpfile 2016-03-20 22:48:03 -07:00
LICENSE Initial commit 2015-11-12 01:02:24 -08:00
package.json Add rudimentary register implementation. 2016-05-29 00:58:09 -04:00
README.md Update README 2016-06-05 12:00:32 -07:00
tsconfig.json Passing most tests. 2016-05-29 02:32:06 -04:00
tslint.json * Fix build error 2016-03-04 00:04:34 -08:00
typings.json Add rudimentary register implementation. 2016-05-29 00:58:09 -04:00

Build Status Slack Status

Vim

Vim (aka. VSCodeVim) is a Visual Studio Code extension that enables the power of the Vim keybinding experience within Visual Studio Code. This is a work in progress and contributions are welcomed and loved!

Screenshot

Install

  1. Within Visual Studio Code, open the command palette (Ctrl-Shift-P / Cmd-Shift-P)
  2. Select Install Extension and search for 'vim' or run ext install vim

Configure

Adjust configurations through user settings (File -> Preferences -> User Settings).

  • vim.keyboardLayout:
    • Supported Values: en-US (QWERTY) (default), es-ES (QWERTY), de-DE (QWERTZ), da-DK (QWERTY)

Keybindings can be overridden for a mode by supplying a {string: string} object defining what key(s) should perform a given action.

Note: Currently, by defining keybindings for a mode, all bindings for that mode will be overridden. This should be fixed in a future update.

Example:

{
    "vim.normalModeKeyBindings": {
        "d": "DeleteChar",
        "D": "DeleteLastChar"
    },
    "vim.insertModeKeyBindings": {
        "e": "InsertAtCursor",
        "E": "InsertAfterCursor"
    }
}
  • vim.normalModeKeyBindings

    • Supported Actions:
    MoveUp
    MoveDown
    MoveLeft
    MoveRight
    
    MoveLineBegin
    MoveLineEnd
    MoveWordBegin
    MoveWordEnd
    MoveFullWordBegin
    MoveFullWordEnd
    MoveLastWord
    MoveLastFullWord
    MoveLastWordEnd
    MoveLastFullWordEnd
    
    MoveFullPageUp
    MoveFullPageDown
    
    MoveParagraphBegin
    MoveParagraphEnd
    
    MoveNonBlank
    MoveNonBlankFirst
    MoveNonBlankLast
    MoveMatchingBracket
    
    // Find
    Find
    
    // Folding
    Fold
    Unfold
    FoldAll
    UnfoldAll
    
    // Text Modification
    Undo
    Redo
    Copy
    Paste
    
    ChangeWord
    ChangeFullWord
    ChangeCurrentWord
    ChangeCurrentWordToNext
    ChangeToLineEnd
    
    DeleteLine
    DeleteToNextWord
    DeleteToFullNextWord
    DeleteToWordEnd
    DeleteToFullWordEnd
    DeleteToWordBegin
    DeleteToFullWordBegin
    DeleteToLineEnd
    
    DeleteChar
    DeleteLastChar
    
    Indent
    Outdent
    
    // Misc
    EnterCommand
    ExitMessages
    
  • vim.insertModeKeyBindings

    • Supported Actions:
    // Enter insert mode
    InsertAtCursor
    InsertAtLineBegin
    InsertAfterCursor
    InsertAtLineEnd
    InsertNewLineBelow
    InsertNewLineAbove
    
  • vim.visualModeKeyBindings

    • Supported Actions:
     EnterVisualMode
    

Project Status

Check out our release notes for more notes. The tables below are obviously an incomplete list, but show, at a glance, the current commands supported:

Keys in Insert Mode

Status Key Description
Esc end Insert mode, back to Normal mode
Ctrl+[ Command Mode

Writing and Quitting

Status Key Description
: Open command palette
:q Quit current buffer, unless changes have been made. Exit Vim when there are no other non-help buffers
:w Write the current file and exit.

Motions

Left-Right Motions

Status Key Description
h left (also: CTRL-H, , or key)
l right (also: or key)
0 to first character in the line (also: key)
^ to first non-blank character in the line
$ to the last character in the line (N-1 lines lower)
g0 to first character in screen line (differs from "0" when lines wrap)
g^ to first non-blank character in screen line (differs from "^" when lines wrap)
g$ to last character in screen line (differs from "$" when lines wrap)
| to column N (default: 1)
f to the Nth occurrence of to the right
F to the Nth occurrence of to the left
t till before the Nth occurrence of to the right
T till before the Nth occurrence of to the left
; repeat the last "f", "F", "t", or "T" N times
, repeat the last "f", "F", "t", or "T" N times in opposite direction

Up-Down Motions

Status Key Description
k up (also: CTRL-P and )
j down (also: CTRL-J, CTRL-N, , and )
- up, on the first non-blank character
+ down, on the first non-blank character (also: CTRL-M and )
_ down N-1 lines, on the first non-blank character
G goto last line, on the first non-blank character
gg goto frst line, on the firstnon-blank character
% goto line N percentage down in the file. N must be given, otherwise it is the % command.
matching brace % jump to matching brace, C-style comment, C/C++ preprocessor conditional
gk up N screen lines (differs from "k" when line wraps)
gj down N screen lines (differs from "j" when line wraps)
CTRL-F page down
CTRL-B page up

Word Motions

Status Key Description
w words forward
W N blank-separated WORDS forward
e forward to the end of the word
E forward to the end of the Nth blank-separated WORD
b words backward
B N blank-separated WORDS backward
ge backward to the end of the Nth word
gE backward to the end of the Nth blank-separated WORD

Insert Mode Commands

Status Key Description
a append text after the cursor
A append text at the end of the line (N times)
i insert text before the cursor (N times) (also: )
I insert text before the first non-blank in the line (N times)
o open a new line below the current line, append text (N times)
O open a new line above the current line, append text (N times)

Deleting Text

Status Key Description
x delete characters under and after the cursor
delete N characters under and after the cursor
X delete N characters before the cursor
dw, dW, db, dB, de, dE d{motion} delete the text that is moved over with {motion}
{visual}d delete the highlighted text
dd delete N lines
D delete to end-of-line (and N-1 more lines)
J join N-1 lines (delete newlines)
{visual}J join the highlighted lines

Deleting and Inserting

Status Key Description
C Delete from the cursor position to the end of the line and enter insert mode
cw Delete from the cursor position to the end of the word and enter insert mode
cW Delete from the cursor position to the end of the WORD and enter insert mode
ciw Delete word and enter insert mode
caw Delete word, right-side blanks and enter insert mode
s Delete character under cursor and enter insert mode

Changing Text

Status Key Description
<< move N lines one shiftwidth left
>> move N lines one shiftwidth right

Undo/Redo

Status Key Description
u undo last change
CTRL-R redo last undone change
U restore last changed line

Contributing

See here for how to run a development environment and make contributions.

This project is maintained by a group of awesome contributors. Thank you! ❤️

License

MIT