Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/Sheepolution/vimrc-to-json
- Owner: Sheepolution
- License: mit
- Created: 2019-02-08T17:36:44.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-24T10:52:44.000Z (almost 5 years ago)
- Last Synced: 2024-08-02T05:11:59.230Z (3 months ago)
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 56
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.