Search code examples
vimvisual-studio-codevscodevim

Is "Expresssion Register" not supported by the VsCodeVim extension?


I've been learning vim recently and I've been using the vscodevim extension to get the shortcuts in Visual Studio Code. Yesterday I came across this tutorial which uses to 'Expression Register' to do simple calculations. This worked when using vim from the command line directly but I've had no luck trying to make it work in Visual Studio Code (pressing <C-r>= does nothing).

I've looked in the github page of vscode vim but found nothing related to it. There is mention of the '=' register, but nothing related to 'Expression Register'.

CTRL-R {0-9a-z%#:.-="} insert the contents of a register

And also the 'useCtrlKeys' option is set to true in the settings.json so the extension has access to the Ctrl keys.

Am I missing something? Is this feature missing from the extension?


Solution

  • The answer is no (at least for now). Upon reading the linked article and vscodevim's page in Visual Studio marketplace a little more carefully I've found that it is currently not possible to use the 'expression register' using the vscodevim extension. This is because the expression register uses Vimscript to evaluate simple code and Vimscript is currently not supported in vscodevim.

    From the article:

    The expression register lets us evaluate a snippet of Vimscript code.

    From vscodevim's page in Visual Studio Marketplace:

    Vimscript is not supported; therefore, we are not able to load your .vimrc or use .vim plugins.