vimrc-to-json
vimrc-to-json copied to clipboard
A Python script that converts a .vimrc file to a settings.json for VSCodeVim.
Hold up! ⚠️
Did you know that VsCodeVim as of version 1.12.0 supports .vimrc files? So you might not even need this tool!
Set vim.vimrc.enable to true and set vim.vimrc.path appropriately.
.vimrc to JSON
A Python script that converts a .vimrc into a settings.json for VSCodeVim.
How to use
-
Install Python 3.x
-
Download vimrc-to-json.py manually or run
curl https://raw.githubusercontent.com/Sheepolution/vimrc-to-json/master/vimrc-to-json.py > vimrc-to-json.py -
Put your
.vimrcandvimrc-to-json.pyin the same directory -
Run
vimrc-to-json.py. It outputs asettings.jsonfor VSCodeVim.
Example
.vim
nmap nt gg
nnoremap + <C-a>
vnoremap Y :w<CR>
settings.json
{
"vim.normalModeKeyBindings": [
{
"before": ["n", "t"],
"after": ["g", "g"]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["+"],
"after": ["<C-a>"]
}
],
"vim.visualModeKeyBindingsNonRecursive": [
{
"before": ["Y"],
"commands": [":w"]
}
]
}
License
This tool is free software; you can redistribute it and/or modify it under the terms of the MIT license. See LICENSE for details.