Skip to content

Plugins

Jason Fields edited this page May 23, 2025 · 4 revisions

🔌 Emulated Plugins

vim-airline

⚠️ There are performance implications to using this plugin. In order to change the status bar, we override the configurations in your workspace settings.json which results in increased latency and a constant changing diff in your working directory (see issue#2124).

Change the color of the status bar based on the current mode. Once enabled, configure "vim.statusBarColors". Colors can be defined for each mode either as string (background only), or string[] (background, foreground).

    "vim.statusBarColorControl": true,
    "vim.statusBarColors.normal": ["#8FBCBB", "#434C5E"],
    "vim.statusBarColors.insert": "#BF616A",
    "vim.statusBarColors.visual": "#B48EAD",
    "vim.statusBarColors.visualline": "#B48EAD",
    "vim.statusBarColors.visualblock": "#A3BE8C",
    "vim.statusBarColors.replace": "#D08770",
    "vim.statusBarColors.commandlineinprogress": "#007ACC",
    "vim.statusBarColors.searchinprogressmode": "#007ACC",
    "vim.statusBarColors.easymotionmode": "#007ACC",
    "vim.statusBarColors.easymotioninputmode": "#007ACC",
    "vim.statusBarColors.surroundinputmode": "#007ACC",

vim-easymotion

Based on vim-easymotion and configured through the following settings:

Setting Description Type Default Value
vim.easymotion Enable/disable easymotion plugin Boolean false
vim.easymotionMarkerBackgroundColor The background color of the marker box. String '#0000'
vim.easymotionMarkerForegroundColorOneChar The font color for one-character markers. String '#ff0000'
vim.easymotionMarkerForegroundColorTwoCharFirst The font color for the first of two-character markers, used to differentiate from one-character markers. String '#ffb400'
vim.easymotionMarkerForegroundColorTwoCharSecond The font color for the second of two-character markers, used to differentiate consecutive markers. String '#b98300'
vim.easymotionIncSearchForegroundColor The font color for the search n-character command, used to highlight the matches. String '#7fbf00'
vim.easymotionDimColor The font color for the dimmed characters, used when #vim.easymotionDimBackground# is set to true. String '#777777'
vim.easymotionDimBackground Whether to dim other text while markers are visible. Boolean true
vim.easymotionMarkerFontWeight The font weight used for the marker text. String 'bold'
vim.easymotionKeys The characters used for jump marker name String 'hklyuiopnm,qwertzxcvbasdgjf;'
vim.easymotionJumpToAnywhereRegex Custom regex to match for JumpToAnywhere motion (analogous to Easymotion_re_anywhere) String \b[A-Za-z0-9]|[A-Za-z0-9]\b|_.|#.|[a-z][A-Z]

Once easymotion is active, initiate motions using the following commands. After you initiate the motion, text decorators/markers will be displayed and you can press the keys displayed to jump to that position. leader is configurable and is \ by default.

Motion Command Description
<leader><leader> s <char> Search character
<leader><leader> f <char> Find character forwards
<leader><leader> F <char> Find character backwards
<leader><leader> t <char> Til character forwards
<leader><leader> T <char> Til character backwards
<leader><leader> w Start of word forwards
<leader><leader> b Start of word backwards
<leader><leader> l Matches beginning & ending of word, camelCase, after _, and after # forwards
<leader><leader> h Matches beginning & ending of word, camelCase, after _, and after # backwards
<leader><leader> e End of word forwards
<leader><leader> ge End of word backwards
<leader><leader> j Start of line forwards
<leader><leader> k Start of line backwards
<leader><leader> / <char>... <CR> Search n-character
<leader><leader><leader> bdt Til character
<leader><leader><leader> bdw Start of word
<leader><leader><leader> bde End of word
<leader><leader><leader> bdjk Start of line
<leader><leader><leader> j JumpToAnywhere motion; default behavior matches beginning & ending of word, camelCase, after _ and after #

<leader><leader> (2s|2f|2F|2t|2T) <char><char> and <leader><leader><leader> bd2t <char>char> are also available. The difference is character count required for search. For example, <leader><leader> 2s <char><char> requires two characters, and search by two characters. This mapping is not a standard mapping, so it is recommended to use your custom mapping.

vim-surround

Based on surround.vim, the plugin is used to work with surrounding characters like parentheses, brackets, quotes, and XML tags.

Setting Description Type Default Value
vim.surround Enable/disable vim-surround Boolean true

t or < as <desired> or <existing> will enter tag entry mode. Using <CR> instead of > to finish changing a tag will preserve any existing attributes.

Surround Command Description
y s <motion> <desired> Add desired surround around text defined by <motion>
d s <existing> Delete existing surround
c s <existing> <desired> Change existing surround to desired
S <desired> Surround when in visual modes (surrounds full selection)

Some examples:

  • "test" with cursor inside quotes type cs"' to end up with 'test'
  • "test" with cursor inside quotes type ds" to end up with test
  • "test" with cursor inside quotes type cs"t and enter 123> to end up with <123>test</123>

vim-commentary

Similar to vim-commentary, but uses the VS Code native Toggle Line Comment and Toggle Block Comment features.

Usage examples:

  • gc - toggles line comment. For example gcc to toggle line comment for current line and gc2j to toggle line comments for the current line and the next two lines.
  • gC - toggles block comment. For example gCi) to comment out everything within parentheses.

vim-indent-object

Based on vim-indent-object, it allows for treating blocks of code at the current indentation level as text objects. Useful in languages that don't use braces around statements (e.g. Python).

Provided there is a new line between the opening and closing braces / tag, it can be considered an agnostic cib/ci{/ci[/cit.

Command Description
<operator>ii This indentation level
<operator>ai This indentation level and the line above (think if statements in Python)
<operator>aI This indentation level, the line above, and the line after (think if statements in C/C++/Java/etc)

vim-sneak

Based on vim-sneak, it allows for jumping to any location specified by two characters.

Setting Description Type Default Value
vim.sneak Enable/disable vim-sneak Boolean false
vim.sneakUseIgnorecaseAndSmartcase Respect vim.ignorecase and vim.smartcase while sneaking Boolean false

Once sneak is active, initiate motions using the following commands. For operators sneak uses z instead of s because s is already taken by the surround plugin.

Motion Command Description
s<char><char> Move forward to the first occurrence of <char><char>
S<char><char> Move backward to the first occurrence of <char><char>
<operator>z<char><char> Perform <operator> forward to the first occurrence of <char><char>
<operator>Z<char><char> Perform <operator> backward to the first occurrence of <char><char>

CamelCaseMotion

Based on CamelCaseMotion, though not an exact emulation. This plugin provides an easier way to move through camelCase and snake_case words.

Setting Description Type Default Value
vim.camelCaseMotion.enable Enable/disable CamelCaseMotion Boolean false

Once CamelCaseMotion is enabled, the following motions are available:

Motion Command Description
<leader>w Move forward to the start of the next camelCase or snake_case word segment
<leader>e Move forward to the next end of a camelCase or snake_case word segment
<leader>b Move back to the prior beginning of a camelCase or snake_case word segment
<operator>i<leader>w Select/change/delete/etc. the current camelCase or snake_case word segment

By default, <leader> is mapped to \, so for example, d2i\w would delete the current and next camelCase word segment.

Input Method

Disable input method when exiting Insert Mode.

Setting Description
vim.autoSwitchInputMethod.enable Boolean denoting whether autoSwitchInputMethod is on/off.
vim.autoSwitchInputMethod.defaultIM Default input method.
vim.autoSwitchInputMethod.obtainIMCmd The full path to command to retrieve the current input method key.
vim.autoSwitchInputMethod.switchIMCmd The full path to command to switch input method, with {im} a placeholder for input method key.

Any third-party program can be used to switch input methods. The following will walkthrough the configuration using im-select.

  1. Install im-select (see installation guide)

  2. Find your default input method key

    • Mac:

      Switch your input method to English, and run the following in your terminal: /<path-to-im-select-installation>/im-select to output your default input method. The table below lists the common English key layouts for MacOS.

      Key Description
      com.apple.keylayout.US U.S.
      com.apple.keylayout.ABC ABC
      com.apple.keylayout.British British
      com.apple.keylayout.Irish Irish
      com.apple.keylayout.Australian Australian
      com.apple.keylayout.Dvorak Dvorak
      com.apple.keylayout.Colemak Colemak
    • Windows:

      Refer to the im-select guide on how to discover your input method key. Generally, if your keyboard layout is en_US the input method key is 1033 (the locale ID of en_US). You can also find your locale ID from this page, where the LCID Decimal column is the locale ID.

  3. Configure vim.autoSwitchInputMethod.

    • MacOS:

      Given the input method key of com.apple.keylayout.US and im-select located at /usr/local/bin. The configuration is:

      "vim.autoSwitchInputMethod.enable": true,
      "vim.autoSwitchInputMethod.defaultIM": "com.apple.keylayout.US",
      "vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/im-select",
      "vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select {im}"
    • Windows:

      Given the input method key of 1033 (en_US) and im-select.exe located at D:/bin. The configuration is:

      "vim.autoSwitchInputMethod.enable": true,
      "vim.autoSwitchInputMethod.defaultIM": "1033",
      "vim.autoSwitchInputMethod.obtainIMCmd": "D:\\bin\\im-select.exe",
      "vim.autoSwitchInputMethod.switchIMCmd": "D:\\bin\\im-select.exe {im}"

The {im} argument above is a command-line option that will be passed to im-select denoting the input method to switch to. If using an alternative program to switch input methods, you should add a similar option to the configuration. For example, if the program's usage is my-program -s imKey to switch input method, the vim.autoSwitchInputMethod.switchIMCmd should be /path/to/my-program -s {im}.

ReplaceWithRegister

Based on ReplaceWithRegister, an easy way to replace existing text with the contents of a register.

Setting Description Type Default Value
vim.replaceWithRegister Enable/disable ReplaceWithRegister Boolean false

Once active, type gr (say "go replace") followed by a motion to describe the text you want replaced by the contents of the register.

Motion Command Description
[count]["a]gr<motion> Replace the text described by the motion with the contents of the specified register
[count]["a]grr Replace the [count] lines or current line with the contents of the specified register
{Visual}["a]gr Replace the selection with the contents of the specified register

vim-textobj-entire

Similar to vim-textobj-entire.

Adds two useful text-objects:

  • ae which represents the entire content of a buffer.
  • ie which represents the entire content of a buffer without the leading and trailing spaces.

Usage examples:

  • dae - delete the whole buffer content.
  • yie - will yank the buffer content except leading and trailing blank lines.
  • gUae - transform the whole buffer to uppercase.

vim-textobj-arguments

Similar to the argument text object in targets.vim. It is an easy way to deal with arguments inside functions in most programming languages.

Motion Command Description
<operator>ia The argument excluding separators.
<operator>aa The argument including separators.

Usage examples:

  • cia - change the argument under the cursor while preserving separators like comma ,.
  • daa - will delete the whole argument under the cursor and the separators if applicable.
Setting Description Type Default Value
vim.argumentObjectOpeningDelimiters A list of opening delimiters String list ["(", "["]
vim.argumentObjectClosingDelimiters A list of closing delimiters String list [")", "]"]
vim.argumentObjectSeparators A list of object separators String list [","]
Clone this wiki locally