File with the defined snippets.
let g:snippets_file = $HOME . "/dotfiles/vim-snippets.json"
The file needs to be a json with the following structure:
{
"ReactComponent": [
"import React from 'react';",
"",
"type Props = {};",
"",
"function Component({}: Props) {}",
"",
"export default Component;"
],
"ReduxSelector": [
"import { State } from './State'",
"",
"export const selector = (state: State) => {};"
]
}
A config like the one above will expose two snippets commands VSReactComponent
and VSReduxSelector
, each one
will generate the corresponding value.