SuperCollider with emacs: scel

From SuperCollider wiki

Jump to: navigation, search

Getting started

to enable emacs sclang-mode, add this to your $HOME/.emacs file:

(add-to-list 'load-path "/usr/local/bin/sclang")
(require 'sclang)

Note: adapt sclang path to yours if necessary.

now you can start SuperCollider with the following command:

$ emacs -sclang

Auto-close parenthesis and brackets

  • to enable automatic insertion of closing parenthesis and brackets, add this to your $HOME/.emacs file:
;;-- skeleton pair insertion for brackets and stuff
(global-set-key "\"" 'skeleton-pair-insert-maybe)
(global-set-key "\'" 'skeleton-pair-insert-maybe)
(global-set-key "\`" 'skeleton-pair-insert-maybe)
(global-set-key "\{" 'skeleton-pair-insert-maybe)
(global-set-key "\[" 'skeleton-pair-insert-maybe)
(global-set-key "\(" 'skeleton-pair-insert-maybe)
(global-set-key "\<" 'skeleton-pair-insert-maybe)
(setq skeleton-pair 1)
  • alternatively you can use autopair.el which has some extra nice features (√† la Textmate).

Completion

  • you get auto-completion for free in emacs with the shortcut C-c C-n but the proposed completions will appear in a new buffer.
  • another alternative is to use auto complete mode:

follow the installation instructions on the website and copy the sclang_completion_dict file into auto-complete dictionnaries directory, usually:

$ cp ~/share/SuperCollider/sclang_completion_dict ~/.emacs.d/ac-dict

et voil√† ! Sc.gif

Personal tools