Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Sheepolution/vimrc-to-json

A Python script that converts a .vimrc file to a settings.json for VSCodeVim.
https://github.com/Sheepolution/vimrc-to-json

Last synced: 1 day ago
JSON representation

A Python script that converts a .vimrc file to a settings.json for VSCodeVim.

Awesome Lists containing this project

README

        

# Hold up! ⚠️

Did you know that VsCodeVim as of version 1.12.0 [supports](https://github.com/VSCodeVim/Vim/issues/463#issuecomment-563451426) `.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](https://github.com/VSCodeVim/Vim).

## How to use

1. Install [Python 3.x](https://www.python.org/downloads/)

2. Download [vimrc-to-json.py](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`

3. Put your `.vimrc` and `vimrc-to-json.py` in the same directory

4. Run `vimrc-to-json.py`. It outputs a `settings.json` for VSCodeVim.

## Example

`.vim`
```vim
nmap nt gg
nnoremap +
vnoremap Y :w
```

`settings.json`
```json
{
"vim.normalModeKeyBindings": [
{
"before": ["n", "t"],
"after": ["g", "g"]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["+"],
"after": [""]
}
],
"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](LICENSE) for details.