https://github.com/madskjeldgaard/vim-scdoc-snippets
scdoc snippets for NeoVim (both UltiSnips and Snippets.nvim)
https://github.com/madskjeldgaard/vim-scdoc-snippets
nvim snippets supercollider ultisnips vim
Last synced: 4 months ago
JSON representation
scdoc snippets for NeoVim (both UltiSnips and Snippets.nvim)
- Host: GitHub
- URL: https://github.com/madskjeldgaard/vim-scdoc-snippets
- Owner: madskjeldgaard
- License: gpl-3.0
- Created: 2020-11-27T11:51:51.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-06T21:27:20.000Z (almost 4 years ago)
- Last Synced: 2025-05-30T11:35:22.374Z (4 months ago)
- Topics: nvim, snippets, supercollider, ultisnips, vim
- Language: Vim Snippet
- Homepage:
- Size: 259 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vim-scdoc-snippets
Vim snippets for scdoc / .schelp files for SuperCollider for [UltiSnips](https://github.com/SirVer/ultisnips), [snippets.nvim](https://github.com/norcalli/snippets.nvim) or [LuaSnip](https://github.com/L3MON4D3/LuaSnip).
These snippets cover all tags described by [the SuperCollider scdoc syntax for writing help files](http://doc.sccode.org/Reference/SCDocSyntax.html).
## Requirements
* [UltiSnips](https://github.com/SirVer/ultisnips), [snippets.nvim](https://github.com/norcalli/snippets.nvim) or [LuaSnip](https://github.com/L3MON4D3/LuaSnip).## Install
To install using vim-plug
1. Add this to your init.vim / .vimrc:
`Plug 'madskjeldgaard/vim-scdoc-snippets'`
2. Open Vim and run the command `:PlugInstall`### Snippets.nvim
If you use snippets.nvim, you may add these snippets like so:```lua
require'snippets'.snippets = {
scdoc = require'scdoc-snippets';
}
```### Luasnip
To use these snippets with LuaSnip, you need to parse them to the LuaSnip format first. Add this to your snippets file for LuaSnip to do so:
```lua
local ls = require'luasnip'-- Parse scdoc snippets to luasnip format
local scdocsnips = {}
for snipName, snipContents in pairs(require'scdoc-snippets') dolocal parsedSnip = ls.parser.parse_snippet({ trig = snipName }, snipContents)
table.insert(scdocsnips, parsedSnip)
-- print(value)
endrequire'luasnip'.snippets.scdoc = scdocsnips
```# See also
- [scnvim](https://github.com/davidgranstrom/scnvim) / [scvim](https://github.com/supercollider/scvim)
- [supercollider-h4x-nvim](https://github.com/madskjeldgaard/supercollider-h4x-nvim)