Home

Awesome

vim-scdoc-snippets

scdoc snips in action

Vim snippets for scdoc / .schelp files for SuperCollider for UltiSnips, snippets.nvim or LuaSnip.

These snippets cover all tags described by the SuperCollider scdoc syntax for writing help files.

Requirements

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:

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:

local ls = require'luasnip'

-- Parse scdoc snippets to luasnip format
local scdocsnips = {}
for snipName, snipContents in pairs(require'scdoc-snippets') do

	local parsedSnip = ls.parser.parse_snippet({ trig = snipName }, snipContents)
	table.insert(scdocsnips, parsedSnip)
	-- print(value)
end

require'luasnip'.snippets.scdoc = scdocsnips

See also