Skip to content

Commit a143d51

Browse files
authored
Added vim support (#50)
* feat: add completion specs paths to root so that vim plugins can find it * docs(readme): update with instructions for using with vim
1 parent 003c04c commit a143d51

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,37 @@ React and Next.js Snippets with TypeScript support as well!🚀
1313
- Reload VSCode
1414
- Snippets are ready 🎉
1515

16+
# Vim Installation
17+
18+
These snippets should work with the following snippet plugins:
19+
20+
- [vim-vsnip](https://github.com/hrsh7th/vim-vsnip)
21+
- [LuaSnip](https://github.com/L3MON4D3/LuaSnip)
22+
- [coc-snippets](https://github.com/neoclide/coc-snippets)
23+
24+
Please set up the aforementioned plugins before using this snippet plugin. You
25+
might need to explicitly enable loading of vscode snippet plugins (like in the case of LuaSnip).
26+
27+
## Installing the plugin
28+
29+
With [packer](https://github.com/wbthomason/packer.nvim) -
30+
31+
```
32+
use "avneesh0612/react-nextjs-snippets/"
33+
```
34+
35+
With [vim-plug](https://github.com/junegunn/vim-plug)
36+
37+
```
38+
Plug "avneesh0612/react-nextjs-snippets"
39+
```
40+
41+
If you are using `coc-snippets`, you can simply run the following command -
42+
43+
```
44+
:CocInstall https://github.com/avneesh0612/react-nextjs-snippets@main
45+
```
46+
1647
# Usage
1748

1849
All the snippets and using guide is given in the [USING Guide](./packages/vscode/README.md)

package.json

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,44 @@
1919
"pre-commit": "yarn run format && git add -A .",
2020
"format": "prettier --write \"packages/vscode/{code,snippets}/**/*.{js,jsx,ts,tsx,json,md}\"",
2121
"format:check": "prettier --check \"packages/vscode/{code,snippets}/**/*.{js,jsx,ts,tsx,json,md}\""
22+
},
23+
"engines": {
24+
"vscode": "^1.64.0"
25+
},
26+
"contributes": {
27+
"snippets": [
28+
{
29+
"language": "javascript",
30+
"path": "./packages/vscode/snippets/react-javascript.json"
31+
},
32+
{
33+
"language": "javascriptreact",
34+
"path": "./packages/vscode/snippets/react-javascript.json"
35+
},
36+
{
37+
"language": "typescript",
38+
"path": "./packages/vscode/snippets/react-typescript.json"
39+
},
40+
{
41+
"language": "typescriptreact",
42+
"path": "./packages/vscode/snippets/react-typescript.json"
43+
},
44+
{
45+
"language": "javascriptreact",
46+
"path": "./packages/vscode/snippets/next-javascript.json"
47+
},
48+
{
49+
"language": "typescript",
50+
"path": "./packages/vscode/snippets/next-typescript.json"
51+
},
52+
{
53+
"language": "typescriptreact",
54+
"path": "./packages/vscode/snippets/next-typescript.json"
55+
},
56+
{
57+
"language": "javascript",
58+
"path": "./packages/vscode/snippets/next-javascript.json"
59+
}
60+
]
2261
}
23-
}
62+
}

0 commit comments

Comments
 (0)