Skip to content

grzegorzkiselev/vims

Repository files navigation

VimS for VS Code

icon

The Vim mode for Visual Studio Code that works as expected.

Key features

  • Vim style keybindings & looks
  • Normal, Visual and Visual Line modes support
  • Multi-cursor support
  • Works with VS Code's default behaviors

Not supported

  • : started commands.
  • Visual Block mode: Please use multi-cursor instead for now.

Compability

Works with VS Code keybindings, so:

  • commands works in any language layout
  • you can remap keys

Issues

To disable annoying macOS “beep” on ctrl+cmd+arrow keybindings run this script:

echo '{"@^\\UF700" = "noop:";"@^\\UF701" = "noop:";"@^\\UF702" = "noop:";"@^\\UF703" = "noop:";"@~^\\UF700" = "noop:";"@~^\\UF701" = "noop:";"@~^\\UF702" = "noop:";"@~^\\UF703" = "noop:";}' > ~/Library/KeyBindings/DefaultKeyBinding.dict

See this issue for more.

Features

  • Sofisticated motions by indentation levels, selection and multicursor modifiers works as expected.
  • Suggestions widget that shows relevant commands while you typing

Commands

Check the list here.

Configuration

You can override default configurations in User and Workspace Settings.

vims.bindCtrlCommands

Boolean, Default: true

Set to false to disable Ctrl+<key> keybindings.

vims.mimicVimSearchBehavior

Boolean, Default: true

Set to false to keep VSCode's keybinding when searching.

vims.startInInsertMode

Boolean, Default: false

Set to true to start in Insert mode when opening files.

vims.smartRelativeLineNumbers

Boolean, Default: false

Set to true to will make line numbers relative when not in Insert mode.

vims.useSystemClipboard

Boolean, Default: false

Set to true to copy to and paste from the system clipboard.

vims.vimStyleNavigationInListView

Boolean, Default: true

Set to false to disable Vim style navigation in sidebar.

Contexts

You can make use of when clause contexts to construct keybindings that only apply in specific scenarios.

vims.mode

String, Possible values: NORMAL, INSERT, VISUAL, VISUAL LINE

Tracks the current editing mode. For backward compatibility, REPLACE mode will appear as INSERT.

vims.waitingForInput

Boolean

Set to true when vims is waiting for further input to match a command, otherwise false. This can be used to set up keybindings that perform a custom function when keys are pressed independently, without overriding the default Vim style behavior for those keys when prefixed.

For example, the following configuration will redefine Vim style navigation keys j and k to move the native cursor, stepping over folded code and stepping into wrapped lines, while still allowing longer Vim commands like 3j to work as expected:

[
  {
    "key": "j",
    "command": "cursorDown",
    "when": "editorTextFocus && vims.mode == 'NORMAL' && !vims.waitingForInput"
  },
  {
    "key": "k",
    "command": "cursorUp",
    "when": "editorTextFocus && vims.mode == 'NORMAL' && !vims.waitingForInput"
  }
]

Contributing

Feel free to open issues to report bugs or require features.

Pull requests are welcomed too! See VS Code's official instructions about:

  • Extension API
  • Testing Extensions
    • Protip: change suite( to suite.only( in a test file to run only a single test suite at a time. This saves quite a lot of time. Remember to remove the .only part before making a Git commit.

About

The AMVim based [Vim](http://www.vim.org/) mode for [Visual Studio Code](https://code.visualstudio.com/) that works as expected.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published