Use Vim commands, mappings and others together with VS Code!
If you are one of those people who like Vim, but at the same time I really like VSCode, then this article is for you!
VSCodeVim is an extension for VSCode that makes it possible for you to use Vim shortcuts and commands inside VSCode!
Installation
To install this extension click on the extensions tab and write in the search bar: VSCodeVim, select it and click on Install
common use
Once installed, the extension will already be automatically enabled, that is, when creating a new file you should and will be able to use the modes: Insert, Normal and Visual as it is in Vim.
Remembering that VSCode shortcuts will work simultaneously, for example: Ctrl + S to save.
Vim commands will also be available, examples:
:e ~/main.cpp
:vsplit file.md
:w
:!g++ ~/main.cpp
:q and among others!
Creating your mappings
To create your mappings:
type Ctrl + Shift + p or if you are on macOS, type CMD + Shift + p
Type: preferences
Select the option: Open User Settings type: Vim
Click on Vim and scroll down and click on the option: Edit in settings.json(Vim: Command Line Mode Key Bindings)
Erase the content and start from scratch, eg create a mapping to open the search command, but using the key combination: Ctrl + f:
Then test to see that it will be working!
Some shortcuts you create may conflict with VSCode shortcuts, but you can work around it by creating a <Leader> key, usually using the SPACE key or separating each character, for example, let’s create one more shortcut to select everything with: Ctrl + a which in Vim would be the command: ggVG:
Customizing Colors
You can also customize the status bar colors, for example in the VSCodeVim repository there is the link vim-airline(https://github.com/VSCodeVim/Vim#vim-airline), copy the code and paste inside settings.json and change the colors as you wish!
#554477, #FFFFFF and #028800 for green!
How to create iabbr
You can also create abbreviations, for example create a code for MarkDown
Then test create a MarkDown file, example: :e ~/file.md and type code and press space.
And among many other things, for more information access the repository and the address through the links: