-
Notifications
You must be signed in to change notification settings - Fork 4
/
funcs.el
54 lines (47 loc) · 1.92 KB
/
funcs.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(defun sclang-reset-spacemacs-conf()
"Reset the library yaml file to defaults. You will have to reinstall
all your Quarks."
(interactive)
(if (y-or-n-p "You will have to re-install all your quarks. Do it? ")
(progn
(defvar dummy-config-file
"~/.emacs.d/private/supercollider/dummy_conf.yaml")
(defvar spacemacs-config-file
"~/Library/Application Support/SuperCollider/spacemacs_conf.yaml")
(delete-file spacemacs-config-file)
(copy-file dummy-config-file spacemacs-config-file)
)))
(defun sclang-create-spacemacs-conf-file ()
(defvar dummy-config-file
"~/.emacs.d/private/supercollider/dummy_conf.yaml")
(defvar spacemacs-config-file
"~/Library/Application Support/SuperCollider/spacemacs_conf.yaml")
(unless (file-exists-p spacemacs-config-file)
(copy-file dummy-config-file spacemacs-config-file)))
(defun sclang-move-post-buffer-right ()
(delete-other-windows)
(split-window-horizontally)
(switch-to-buffer-other-window "*SCLang:PostBuffer*")
(other-window -1)
(spacemacs/enlarge-window-horizontally 20)
;; make the current window 60% of the screen wide
(window-resize nil (- (truncate (* 0.6 (frame-width))) (window-width)) t)
)
(defun sclang-start-right ()
(interactive)
(sclang-start)
(sclang-move-post-buffer-right))
(defun sclang-show-post-buffer-right ()
(interactive)
(sclang-show-post-buffer)
(sclang-move-post-buffer-right))
(defun sclang-use-post-buffer-right-split ()
"Use a right split for the post buffer. Its width is 60% of the screen."
(spacemacs/set-leader-keys-for-major-mode 'sclang-mode
"RET" 'sclang-start-right)
(spacemacs/set-leader-keys-for-major-mode 'sclang-mode
">" 'sclang-show-post-buffer-right))
(defun sclang-evaluate-within-parens ()
"Evaluate code within outermost parentheses (assumes active evil mode)"
(interactive)
(setq unread-command-events (listify-key-sequence "mz(vi),,v`z")))