A VimL library for cribbing project infrastructure and workspace configurations from VSCode.
As of the time of writing, VSCrib.vim mainly serves as a library for reading
VSCode JSON configuration files, particularly files like launch.json
situated
in a .vscode
folder.
As of the time of writing, VSCrib.vim is effectively a submodule of dapper.nvim. In the future, VSCrib.vim might serve as a full compatibility layer between vim and VSCode extensions.
Developers are welcome to use VSCrib.vim in their own plugins, so long as they remain aware that VSCrib.vim is undergoing active development, and that I make no guarantees whatsoever of API stability. Issue reports and feature requests are still welcome, however; I hope to eventually turn VSCrib.vim into a fully-fledged vim plugin of its own, so such reports would help me plan a development roadmap.
VSCrib.vim requires at least Vim 7.4.1304 or practically any recent version of neovim. If you encounter problems while using Vim 7.4.X, they might be fixed by upgrading to a newer version of Vim, but please do open an Issue as well.
VSCrib.vim depends on vim-maktaba.
With vim-plug,
call plug#begin('~/.vim/bundle')
" ...
Plug 'Yilin-Yang/VSCrib.vim'
" dependencies
Plug 'Google/vim-maktaba'
" ...
call plug#end()
VSCrib.vim also includes an addon-info.json
file, allowing for dependency resolution (i.e. automatic installation of
vim-maktaba
) in compatible plugin managers.
VSCrib.vim is a maktaba-style library plugin, that is, VSCrib.vim does not directly offer any user-facing functionality and is meant for use in other plugins.
The VSCrib.vim interface is accessible through the VSCrib object.
A call to function! vscrib#New()
will return a VSCrib object, which:
- Can search for the "active VSCode workspace," i.e. a folder containing a
.vscode
directory, which can start from the current working directory, or from a directory given as an argument, and, - Can search for, read, and parse JSON configuration files found in such
.vscode
folders, and, - Stores an internal cache of "VSCode variables" that VSCode uses for variable substitution when parsing its configuration files, populating these variables from the current workspace (and other contextual information), and,
- Can update said cache through calls to
Refresh()
, and, - When parsing JSON configuration files, can perform variable substitution on
JSON entries (e.g. replacement of
${fileBasename}
with the name of the current file) using cached variables.
See :help VSCrib
for more details.
Documentation is generated using vimdoc.
# from project root, after installing vimdoc,
vimdoc .
VSCrib.vim uses vader.vim as its testing framework. To run tests,
# from project root, with `vader.vim` installed,
cd test
./run_tests.sh
See ./run_tests --help
for additional usage details.
MIT