• Stars
    star
    146
  • Rank 247,347 (Top 5 %)
  • Language
    Lua
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Neovim frontend for SuperCollider.

scnvim

Neovim frontend for SuperCollider.

unit tests lint and style check docs

Table of content

News

This plugin has recently undergone a big rewrite, take a look at the installation and usage sections to update your config.

Please report any issues or bugs on the issue tracker.

Have other questions? Start a discussion or join the IRC channel.

Features

  • Post window output is displayed in a scratch buffer
    • Uses a split or a floating window for display
    • Navigate/move/copy etc. as with any other window
    • Toggle back if hidden automatically on errors
  • Automatic display of function signatures
  • Status line widgets
    • Display SuperCollider server status in the status line
  • Snippet generator
    • Generates snippets for creation methods in SCClassLibrary.
  • Can be used with Neovim GUI frontends
  • Supports on-demand loading
  • Context aware (block or line) evaluation (like Cmd-Enter in ScIDE)
  • Flashy eval flash (configurable)
  • Partial Document support (e.g. thisProcess.nowExecutingPath, .load etc.)
  • Plain text help system for SuperCollider documentation
    • Evaluate code examples inside the help buffer

Installation

Requirements

Install

use {
  'davidgranstrom/scnvim',
  config = function()
    require('scnvim').setup()
  end
}
Plug 'davidgranstrom/scnvim'

" add this after calling plug#end()

lua << EOF
require('scnvim').setup()
EOF

Verify

Run :checkhealth scnvim to verify that the installation was successful.

Usage

Configuration

scnvim is configurable from lua only. Here is an example configuration that you can copy and paste to your init.vim.

lua << EOF
local scnvim = require 'scnvim'
local map = scnvim.map
local map_expr = scnvim.map_expr
scnvim.setup {
  keymaps = {
    ['<M-e>'] = map('editor.send_line', {'i', 'n'}),
    ['<C-e>'] = {
      map('editor.send_block', {'i', 'n'}),
      map('editor.send_selection', 'x'),
    },
    ['<CR>'] = map('postwin.toggle'),
    ['<M-CR>'] = map('postwin.toggle', 'i'),
    ['<M-L>'] = map('postwin.clear', {'n', 'i'}),
    ['<C-k>'] = map('signature.show', {'n', 'i'}),
    ['<F12>'] = map('sclang.hard_stop', {'n', 'x', 'i'}),
    ['<leader>st'] = map('sclang.start'),
    ['<leader>sk'] = map('sclang.recompile'),
    ['<F1>'] = map_expr('s.boot'),
    ['<F2>'] = map_expr('s.meter'),
  },
  editor = {
    highlight = {
      color = 'IncSearch',
    },
  },
  postwin = {
    float = {
      enabled = true,
    },
  },
}
EOF

Start

Open a new file in nvim with a .scd or .sc extension and type :SCNvimStart to start SuperCollider.

Commands

Command Description
SCNvimStart Start SuperCollider
SCNvimStop Stop SuperCollider
SCNvimRecompile Recompile SCClassLibrary
SCNvimGenerateAssets Generate tags, syntax, snippets etc.
SCNvimHelp <subject> Open help for <subject> (By default mapped to K)
SCNvimStatusLine Start to poll server status to be displayed in the status line

Additional setup

Run :SCNvimGenerateAssets after starting SuperCollider to generate syntax highlighting and tags.

The plugin should work "out of the box", but if you want even more fine-grained control please have a look at the configuration section in the wiki.

Documentation

Extensions

The extension system provides additional functionalities and integrations. If you have made a scnvim extension, please open a PR and add it to this list!

  • fzf-sc
    • Combine the magic of fuzzy searching with the magic of SuperCollider in Neovim
  • nvim-supercollider-piano
    • Play SuperCollider synths using your (computer) keyboard in neovim!
  • scnvim-tmux
    • Redirect post window ouput to a tmux pane.
  • scnvim-logger
    • Log post window output to a file (example scnvim extension)

Supported platforms

  • Linux
  • macOS
  • Windows (tested with nvim-qt and nvim.exe in Windows PowerShell)

Note to Windows users

The path to sclang.exe needs to be specified in the config:

local scnvim = require 'scnvim'
scnvim.setup {
  sclang = {
    cmd = 'C:/Program Files/SuperCollider-3.12.2/sclang.exe'
  },

Modify the sclang.cmd to point to where SuperCollider is installed on your system.

Additionally, to be able to boot the server you will need to add the following to startup.scd:

if (\SCNvim.asClass.notNil) {
  Server.program = (Platform.resourceDir +/+ "scsynth.exe").quote;
}

License

scnvim - Neovim frontend for SuperCollider
Copyright © 2018 David Granström

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

More Repositories

1

nvim-markdown-preview

Markdown preview for neovim using pandoc and live-server
CSS
100
star
2

NanoKontrol2

SuperCollider interface for NanoKONTROL2
SuperCollider
16
star
3

osc.nvim

Open Sound Control for Neovim
Lua
12
star
4

losc

Open Sound Control (OSC) for lua/luajit
Lua
12
star
5

telescope-scdoc.nvim

A SuperCollider documentation picker.
Lua
9
star
6

Pxshuf

Sequentially embed values from a list in a random order with no repetitions
SuperCollider
7
star
7

EZConv

Wrapper class around PartConv
SuperCollider
6
star
8

scnvim-tmux

Redirect post window ouput to a tmux pane.
Lua
6
star
9

Volca

Control Korg Volca synths from SuperCollider
Scala
4
star
10

scnvim-logger

Example scnvim extension
Lua
4
star
11

sclang-lsp-stdio

A stdio wrapper for LanguageServer.quark
JavaScript
4
star
12

oblique-strategies.nvim

Oblique Strategies
Lua
4
star
13

ArturiaBeatStep

Interface for Arturia BeatStep in SuperCollider
SuperCollider
4
star
14

json-to-midi

json to midi file generator
C++
4
star
15

slow

Like cat, but slower
C
2
star
16

audio-feature-extraction

Batch audio file analysis of spectral features
Python
2
star
17

SuperPrism

High-density speaker array diffusion engine
SuperCollider
2
star
18

tidal-bootstrap-deprecated

Deprecated - This project has been transferred to the TidalCycles organization
1
star
19

MessagePack

MessagePack implementation in SuperCollider
SuperCollider
1
star
20

SCDocVimRenderer

SCDoc render for vim
SuperCollider
1
star
21

7-limit-modulations

Generative audio visual installation
HTML
1
star
22

MS20Ctl

Interface for Korg MS-20 MIDI controller
SuperCollider
1
star
23

xchn-presenter

JavaScript
1
star
24

ixx

piece for laptop ensemble
SuperCollider
1
star
25

scnvim-wiki

Mirror of the scnvim wiki
1
star
26

scvim-reload

Reload (re-evaluate) SuperCollider projects in vim
Vim Script
1
star
27

xchn-browser-ui

JavaScript
1
star