Skip to content

Commit

Permalink
feat: don't add frameworks snippets by default fix #88
Browse files Browse the repository at this point in the history
* add instructions in README on how to add extra snippets
  • Loading branch information
Rafael Madriz committed Nov 5, 2021
1 parent 1614c0a commit 4949050
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 13 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,29 @@ vscode snippets. Like for example:
- [LuaSnip](https://github.com/L3MON4D3/LuaSnip)
- [coc-snippets](https://github.com/neoclide/coc-snippets)

### Add snippets from a framework to a filetype.

There's extra snippets included in this repo but they are not added default,
since it would irrelevant for people not using those frameworks. See `[snippets/frameworks]()`

For example: if you want to add rails snippets to ruby.

With LuaSnip:

```lua
require'luasnip'.filetype_extend("ruby", {"rails"})
```

This method is going to work globally on all open buffers with `ruby` filetype.
Alternatively you can do `set filetype=ruby.rails` so it only works on a
specific buffer, but this is going to mess up with syntax highlighting.

With vim-vsnip:

```viml
let g:vsnip_filetypes.rails = ['ruby']
```

### Install

Use your plugin manager of choice, e.g.
Expand Down
22 changes: 9 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"path": "./snippets/gitcommit.json"
},
{
"language": "html",
"path": "./snippets/ejs.json"
"language": "ejs",
"path": "./snippets/frameworks/ejs.json"
},
{
"language": "eruby",
Expand Down Expand Up @@ -90,8 +90,8 @@
"path": "./snippets/ruby.json"
},
{
"language": "ruby",
"path": "./snippets/rails.json"
"language": "rails",
"path": "./snippets/frameworks/rails.json"
},
{
"language": "rust",
Expand Down Expand Up @@ -225,16 +225,12 @@
"path": "./snippets/python/unittest.json"
},
{
"language": "python",
"path": "./snippets/python/tkinter.json"
},
{
"language": "dart",
"path": "./snippets/flutter.json"
"language": "flutter",
"path": "./snippets/frameworks/flutter.json"
},
{
"language": "markdown",
"path": "./snippets/jekyll/vscode-jekyll-snippets.json"
"language": "jekyll",
"path": "./snippets/frameworks/jekyll.json"
},
{
"language": "cobol",
Expand Down Expand Up @@ -276,7 +272,7 @@
},
{
"language": "twig",
"path": "./snippets/twig.json"
"path": "./snippets/frameworks/twig.json"
},
{
"language": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 4949050

Please sign in to comment.