How to use VIM together with VSCODE
Use Vim commands, mappings and others together with VS Code!
VSCodeVim is an extension for VSCode that makes it possible for you to use Vim shortcuts and commands inside VSCode!
To install this extension click on the extensions tab and write in the search bar:
VSCodeVim, select it and click on
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 + Sto save.
Vim commands will also be available, examples:
:qand among others!
Creating your mappings
To create your mappings:
Ctrl + Shift + por if you are on macOS, type
CMD + Shift + p
- Select the option:
Open User Settingstype:
- Click on
Vimand 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:
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
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:
The video is in Portuguese, but everything discussed here is in the video.