[programming] absorb config in init.org, create general hydra

This commit is contained in:
contrapunctus 2021-02-17 17:39:41 +05:30
parent 71e989bd82
commit 8b7f07a993
6 changed files with 548 additions and 284 deletions

View File

@ -153,7 +153,7 @@
(":" org-demote-subtree "demote")
("m" magit-status "Magit" :color blue)
("\"" cp-prog/body "Other language" :color blue)
("u" contrapunctus-general/body "up" :color blue)
("G" elpher "Elpher" :color blue))
;; (use-package org-src-mode

View File

@ -1,30 +0,0 @@
;;; cp-prog-c.el --- configuration for C programming
;;; Commentary:
;;
(use-package cc-mode)
(use-package irony-eldoc
:hook
(c-mode . irony-eldoc))
(use-package irony
:config
(add-hook 'irony-mode-hook #'irony-eldoc))
(use-package company-irony)
(use-package rtags
:hook
(c-mode . rtags-call-rc)
:config
(setq rtags-rc-binary-name "rtags-rc"
rtags-rdm-binary-name "rtags-rdm")
:bind
(:map c-mode-map
("<f2> <f2>" . rtags-find-symbol-at-point)))
(provide 'cp-prog-c)
;;; cp-prog-c.el ends here

View File

@ -1,40 +0,0 @@
(use-package elisp-mode
:diminish
:bind
(:map emacs-lisp-mode-map
("<tab>" . 'company-indent-or-complete-common)
("<C-tab>" . 'outline-toggle-children)
("M-n" . 'outline-next-heading)
("M-p" . 'outline-previous-heading)
("M-m" . macrostep-expand))
:config
(put 'cl-loop 'lisp-indent-function 'defun)
(setq print-length nil
eval-expression-print-length nil))
(use-package eldoc
:diminish
:if (featurep 'elisp-mode)
:init (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
:config (setq eldoc-idle-delay 0))
(use-package emr
:bind (:map prog-mode-map
("M-S-<return>" . emr-show-refactor-menu)))
(use-package nameless
:commands nameless-mode
:hook
(ert-results-mode . nameless-mode)
(emacs-lisp-mode . nameless-mode)
:bind (:map emacs-lisp-mode-map
("C-c C-n" . nameless-mode)))
(use-package explain-pause-mode
:load-path "/home/anon/.emacs.d/elisp-git/explain-pause-mode/"
:disabled t
:diminish
:commands explain-pause-mode
:init (explain-pause-mode))
(provide 'cp-prog-elisp)

View File

@ -1,147 +0,0 @@
;;; cp-prog.el --- configuration related to programming
;;; Commentary:
;;
;;; Code:
(require 'cp-prog-elisp)
(require 'cp-prog-c)
(use-package ediprolog
:commands ediprolog-dwim)
(use-package company
:diminish company-mode
:commands global-company-mode
:init (global-company-mode)
:bind ;; ("TAB" . company-indent-or-complete-common)
(:map emacs-lisp-mode-map
("TAB" . company-indent-or-complete-common)
("C-i" . company-indent-or-complete-common))
(:map c-mode-map
("TAB" . company-indent-or-complete-common)
("C-i" . company-indent-or-complete-common))
:config
(add-to-list 'company-backends 'company-irony))
(use-package feature-mode
:mode "\\.feature$")
(defhydra cp-el-eval (:color blue)
("b" eval-buffer "buffer")
("e" eval-defun "defun")
("l" eval-last-sexp "last sexp"))
(defun cp/compile-project (file cmd)
"Locate directory with FILE and run compile command CMD."
(cd (locate-dominating-file default-directory file))
(compile cmd))
(defhydra cp-el (:color blue)
"Emacs Lisp"
("r" ielm "REPL")
("e" cp-el-eval/body "Eval")
("h" helpful-at-point "Help")
("j" xref-find-definitions "Jump to definition")
("d" (funcall-interactively #'eval-defun t) "Debug")
("c" (cp/compile-project "Cask" "cask build") "Compile")
("C" (cp/compile-project "Cask" "cask clean-elc") "clean")
("t" (cp/compile-project "Cask" "cask exec buttercup -L . --traceback pretty") "Test")
("m" magit-status "Magit")
("G" elpher "Elpher")
("o" cp-prog/body "Other language"))
(defhydra cp-scm-eval (:color blue)
("b" geiser-eval-buffer "buffer")
("e" geiser-eval-definition "defun"))
(defhydra cp-guile (:color blue)
"Guile"
("e" cp-scm-eval/body "Eval")
("r" run-guile "REPL")
("m" magit-status "Magit")
("G" elpher "Elpher")
("o" cp-prog/body "Other language"))
(defhydra cp-cs (:color blue)
"CHICKEN Scheme"
("e" cp-scm-eval/body "Eval")
("r" run-chicken "REPL")
("m" magit-status "Magit")
("G" elpher "Elpher")
("o" cp-prog/body "Other language"))
(defhydra cp-ly (:color blue)
"Lilypond"
("c" (cp/compile-project "main.ly" "~/bin/mkly dev") "Compile")
("m" magit-status "Magit")
("G" elpher "Elpher")
("o" cp-prog/body "Other language"))
(defhydra cp-cl-eval (:color blue)
("b" slime-eval-buffer "buffer")
("e" slime-eval-defun "defun"))
(defhydra cp-cl-doc (:color blue)
("d" slime-documentation "slime")
("e" slime-documentation-lookup "CLHS"))
(defhydra cp-cl (:color blue)
"Common Lisp"
("C" slime-connect "connect")
("d" cp-cl-doc/body "Documentation")
("e" cp-cl-eval/body "Eval")
("r" slime "REPL")
("m" magit-status "Magit")
("o" cp-prog/body "Other language")
("G" elpher "Elpher"))
(defhydra cp-prolog (:color blue)
"Prolog"
("o" cp-prog/body "Other language")
("r" ediprolog-dwim "REPL"))
(defhydra cp-prog (:color blue)
"Which language?"
("e" cp-el/body "Emacs Lisp")
("c" cp-cs/body "CHICKEN Scheme")
("g" cp-guile/body "Guile")
("L" cp-ly/body "Lilypond")
("l" cp-cl/body "Common Lisp")
("o" cp-org/body "Org")
("p" cp-prolog/body "Prolog")
("m" magit-status "Magit")
("G" elpher "Elpher"))
(defun cp/prog-hydra ()
(interactive)
(cond ((or (derived-mode-p 'emacs-lisp-mode 'ielm-mode)
;; ;; Similar problems with this as the f-glob below;
;; ;; e.g. false positive if you have a .dir-locals.el in
;; ;; a project...
;; (f-glob "*.el")
)
(cp-el/body))
(;; (or (locate-dominating-file default-directory "build.scm")
;; (locate-dominating-file default-directory "main.ly"))
(derived-mode-p 'LilyPond-mode)
(cp-ly/body))
((and (featurep 'geiser) geiser-mode)
(cond ((equal 'chicken geiser-impl--implementation)
(cp-cs/body))
((equal 'guile geiser-impl--implementation)
(cp-guile/body))
(t (error "Couldn't detect Scheme implementation."))))
((derived-mode-p 'lisp-mode 'slime-repl-mode)
(cp-cl/body))
((derived-mode-p 'org-mode)
(cp-org/body))
(t (cp-prog/body))))
(define-key boon-command-map (kbd "\"") #'cp/prog-hydra)
(define-key boon-command-map (kbd "m") #'cp/prog-hydra)
(provide 'cp-prog)
;;; cp-prog.el ends here

266
init.el
View File

@ -102,6 +102,7 @@
(bound-and-true-p slime-popup-buffer-mode)))
(add-to-list 'boon-special-conditions var))
(setq hi-lock-auto-select-face t)
(define-key boon-command-map (kbd "x d f") nil)
(general-def boon-command-map
"M" 'ido-mini
"J" 'ido-mini
@ -404,24 +405,22 @@ Return nil (and run `magit-status') if the user answers no."
:bind (("M-w" . easy-kill)
("M-d" . easy-kill-delete-region)))
(use-package elpher
:bind (:map elpher-mode-map
("n" . elpher-next-link)
("p" . elpher-prev-link)
("b" . elpher-back)
("w" . elpher-copy-current-url)
("W" . elpher-copy-link-url)))
(use-package elfeed
:bind (:map elfeed-show-mode-map
("v" . nil))
:config
(add-to-list 'boon-special-mode-list 'elfeed-show-mode)
(add-to-list 'boon-special-mode-list 'elfeed-search-mode))
(use-package hydra
:commands defhydra)
(defhydra contrapunctus-general (:color blue)
"Hailing frequencies open"
("c" chronometrist "chronometrist")
("G" elpher "elpher")
("o" cp-org/body "org")
("p" cp/prog-hydra "programming")
("s" save-buffer "save")
("k" (kill-buffer (current-buffer)) "kill")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq")
("m" magit-status "magit"))
(use-package emms
:after hydra
:bind
@ -533,6 +532,29 @@ Return nil (and run `magit-status') if the user answers no."
:config
(setq url-cookie-confirmation t))
(use-package elpher
:bind (:map elpher-mode-map
("n" . elpher-next-link)
("p" . elpher-prev-link)
("b" . elpher-back)
("w" . elpher-copy-current-url)
("W" . elpher-copy-link-url)))
(use-package elfeed
:bind (:map elfeed-show-mode-map
("v" . nil))
:config
(add-to-list 'boon-special-mode-list 'elfeed-show-mode)
(add-to-list 'boon-special-mode-list 'elfeed-search-mode))
(use-package jabber
:disabled
:commands jabber-connect
:config (global-unset-key (kbd "C-x C-j"))
(global-set-key (kbd "C-x C-j") 'join-line)
(setq jabber-history-enabled t
jabber-history-muc-enabled t
jabber-alert-presence-message-function nil))
(use-package image-mode
:bind
(:map image-map
@ -862,14 +884,6 @@ and eval it."
:config
(setq ivy-re-builders-alist
'((t . ivy--regex-ignore-order))))
(use-package jabber
:disabled
:commands jabber-connect
:config (global-unset-key (kbd "C-x C-j"))
(global-set-key (kbd "C-x C-j") 'join-line)
(setq jabber-history-enabled t
jabber-history-muc-enabled t
jabber-alert-presence-message-function nil))
(use-package magit
:bind (("<f5> m" . #'magit-status)
:map magit-revision-mode-map
@ -912,6 +926,209 @@ and eval it."
:hook
(midnight . clean-buffer-list))
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package company
:diminish company-mode
:commands global-company-mode
:init (global-company-mode)
:bind ;; ("TAB" . company-indent-or-complete-common)
(:map emacs-lisp-mode-map
("TAB" . company-indent-or-complete-common)
("C-i" . company-indent-or-complete-common))
(:map c-mode-map
("TAB" . company-indent-or-complete-common)
("C-i" . company-indent-or-complete-common))
:config
(add-to-list 'company-backends 'company-irony))
(use-package feature-mode
:mode "\\.feature$")
(defun cp/compile-project (file cmd)
"Locate directory with FILE and run compile command CMD."
(cd (locate-dominating-file default-directory file))
(compile cmd))
(defhydra cp-prog (:color blue)
"Which language?"
("e" cp-el/body "Emacs Lisp")
("c" cp-cs/body "CHICKEN Scheme")
("g" cp-guile/body "Guile")
("L" cp-ly/body "Lilypond")
("l" cp-cl/body "Common Lisp")
("o" cp-org/body "Org")
("p" cp-prolog/body "Prolog")
("u" contrapunctus-general/body "up" :color blue)
("s" save-buffer "save")
("k" (kill-buffer (current-buffer)) "kill")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq")
("m" magit-status "Magit"))
(defun cp/prog-hydra ()
(interactive)
(cond ((or (derived-mode-p 'emacs-lisp-mode 'ielm-mode)
;; ;; Similar problems with this as the f-glob below;
;; ;; e.g. false positive if you have a .dir-locals.el in
;; ;; a project...
;; (f-glob "*.el")
)
(cp-el/body))
(;; (or (locate-dominating-file default-directory "build.scm")
;; (locate-dominating-file default-directory "main.ly"))
(derived-mode-p 'LilyPond-mode)
(cp-ly/body))
((and (featurep 'geiser) geiser-mode)
(cond ((equal 'chicken geiser-impl--implementation)
(cp-cs/body))
((equal 'guile geiser-impl--implementation)
(cp-guile/body))
(t (error "Couldn't detect Scheme implementation."))))
((derived-mode-p 'lisp-mode 'slime-repl-mode)
(cp-cl/body))
((derived-mode-p 'org-mode)
(cp-org/body))
((derived-mode-p 'prog-mode)
(cp-prog/body))
(t (contrapunctus-general/body))))
(define-key boon-command-map (kbd "m") #'cp/prog-hydra)
(use-package elisp-mode
:diminish
:bind
(:map emacs-lisp-mode-map
("<tab>" . 'company-indent-or-complete-common)
("<C-tab>" . 'outline-toggle-children)
("M-n" . 'outline-next-heading)
("M-p" . 'outline-previous-heading)
("M-m" . macrostep-expand))
:config
(put 'cl-loop 'lisp-indent-function 'defun)
(setq print-length nil
eval-expression-print-length nil))
(use-package eldoc
:diminish
:if (featurep 'elisp-mode)
:init (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
:config (setq eldoc-idle-delay 0))
(use-package emr
:bind (:map prog-mode-map
("M-S-<return>" . emr-show-refactor-menu)))
(use-package nameless
:commands nameless-mode
:hook
(ert-results-mode . nameless-mode)
(emacs-lisp-mode . nameless-mode)
:bind (:map emacs-lisp-mode-map
("C-c C-n" . nameless-mode)))
(use-package explain-pause-mode
:load-path "/home/anon/.emacs.d/elisp-git/explain-pause-mode/"
:disabled t
:diminish
:commands explain-pause-mode
:init (explain-pause-mode))
(defhydra cp-el-eval (:color blue)
("b" eval-buffer "buffer")
("e" eval-defun "defun")
("l" eval-last-sexp "last sexp"))
(defhydra cp-el (:color blue)
"Emacs Lisp"
("r" ielm "REPL")
("e" cp-el-eval/body "Eval")
("h" helpful-at-point "Help")
("j" xref-find-definitions "Jump to definition")
("d" (funcall-interactively #'eval-defun t) "Debug")
("c" (cp/compile-project "Cask" "cask build") "Compile")
("C" (cp/compile-project "Cask" "cask clean-elc") "clean")
("t" (cp/compile-project "Cask" "cask exec buttercup -L . --traceback pretty") "Test")
("u" cp-prog/body "up" :color blue)
("s" save-buffer "save")
("k" (kill-buffer (current-buffer)) "kill")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq")
("m" magit-status "Magit"))
(defhydra cp-cl-eval (:color blue)
("b" slime-eval-buffer "buffer")
("e" slime-eval-defun "defun"))
(defhydra cp-cl-doc (:color blue)
("d" slime-documentation "slime")
("e" slime-documentation-lookup "CLHS"))
(defhydra cp-cl (:color blue)
"Common Lisp"
("C" slime-connect "connect")
("d" cp-cl-doc/body "Documentation")
("e" cp-cl-eval/body "Eval")
("r" slime "REPL")
("u" cp-prog/body "up" :color blue)
("s" save-buffer "save")
("m" magit-status "Magit"))
(defhydra cp-scm-eval (:color blue)
("b" geiser-eval-buffer "buffer")
("e" geiser-eval-definition "defun"))
(defhydra cp-cs (:color blue)
"CHICKEN Scheme"
("e" cp-scm-eval/body "Eval")
("r" run-chicken "REPL")
("m" magit-status "Magit")
("u" cp-prog/body "up" :color blue))
(defhydra cp-guile (:color blue)
"Guile"
("e" cp-scm-eval/body "Eval")
("r" run-guile "REPL")
("m" magit-status "Magit")
("G" elpher "Elpher")
("u" cp-prog/body "up" :color blue))
(defhydra cp-ly (:color blue)
"Lilypond"
("c" (cp/compile-project "main.ly" "~/bin/mkly dev") "Compile")
("m" magit-status "Magit")
("G" elpher "Elpher")
("u" cp-prog/body "up" :color blue))
(use-package ediprolog
:commands ediprolog-dwim)
(defhydra cp-prolog (:color blue)
"Prolog"
("u" cp-prog/body "up" :color blue)
("r" ediprolog-dwim "REPL"))
(use-package cc-mode)
(use-package irony-eldoc
:hook
(c-mode . irony-eldoc))
(use-package irony
:config
(add-hook 'irony-mode-hook #'irony-eldoc))
(use-package company-irony)
(use-package rtags
:hook
(c-mode . rtags-call-rc)
:config
(setq rtags-rc-binary-name "rtags-rc"
rtags-rdm-binary-name "rtags-rdm")
:bind
(:map c-mode-map
("<f2> <f2>" . rtags-find-symbol-at-point)))
(use-package nodejs-repl
:disabled
:config (setq nodejs-repl-command "nodejs"))
@ -933,8 +1150,7 @@ and eval it."
:hook (package-menu-mode . feather-mode)
:bind ("<f5> p " . list-packages))
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package swiper
:bind

347
init.org
View File

@ -139,6 +139,7 @@ And =org-babel-tangle= takes nearly 27 seconds to tangle this file, at the time
(bound-and-true-p slime-popup-buffer-mode)))
(add-to-list 'boon-special-conditions var))
(setq hi-lock-auto-select-face t)
(define-key boon-command-map (kbd "x d f") nil)
(general-def boon-command-map
"M" 'ido-mini
"J" 'ido-mini
@ -542,32 +543,29 @@ Return nil (and run `magit-status') if the user answers no."
("M-d" . easy-kill-delete-region)))
#+END_SRC
** elpher :application:
#+BEGIN_SRC emacs-lisp
(use-package elpher
:bind (:map elpher-mode-map
("n" . elpher-next-link)
("p" . elpher-prev-link)
("b" . elpher-back)
("w" . elpher-copy-current-url)
("W" . elpher-copy-link-url)))
#+END_SRC
** elfeed :application:
#+BEGIN_SRC emacs-lisp
(use-package elfeed
:bind (:map elfeed-show-mode-map
("v" . nil))
:config
(add-to-list 'boon-special-mode-list 'elfeed-show-mode)
(add-to-list 'boon-special-mode-list 'elfeed-search-mode))
#+END_SRC
** hydra
** TODO hydra [50%]
Add these common operations to the hydra -
1. [ ] =enlarge-window=, =enlarge-window-horizontally=
2. [X] =save-buffer=, =kill-buffer=
3. [ ] switch to last buffer, such that pressing it twice brings you back to the original buffer. Bind to "m" (same key as the one to launch the Hydra), moving magit to "M". Trickier to implement than I thought.
4. [X] =toggle-debug-on-error=
#+BEGIN_SRC emacs-lisp
(use-package hydra
:commands defhydra)
(defhydra contrapunctus-general (:color blue)
"Hailing frequencies open"
("c" chronometrist "chronometrist")
("G" elpher "elpher")
("o" cp-org/body "org")
("p" cp/prog-hydra "programming")
("s" save-buffer "save")
("k" (kill-buffer (current-buffer)) "kill")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq")
("m" magit-status "magit"))
#+END_SRC
** WISH emms :application:
1. [ ] make toggle command for emms-start/emms-stop
@ -666,7 +664,8 @@ Return nil (and run `magit-status') if the user answers no."
:config (setq eshell-history-size 999))
#+END_SRC
** eww :application:
** Internet
*** eww :application:
#+BEGIN_SRC emacs-lisp
(use-package eww
:config
@ -688,7 +687,7 @@ Return nil (and run `magit-status') if the user answers no."
("v" . nil)))
#+END_SRC
** url-cookie
*** url-cookie
Ask for confirmation before saving cookies. I'd rather just disallow them all though 🤔
#+BEGIN_SRC emacs-lisp
(use-package url-cookie
@ -696,6 +695,38 @@ Ask for confirmation before saving cookies. I'd rather just disallow them all th
(setq url-cookie-confirmation t))
#+END_SRC
*** elpher :application:
#+BEGIN_SRC emacs-lisp
(use-package elpher
:bind (:map elpher-mode-map
("n" . elpher-next-link)
("p" . elpher-prev-link)
("b" . elpher-back)
("w" . elpher-copy-current-url)
("W" . elpher-copy-link-url)))
#+END_SRC
*** elfeed :application:
#+BEGIN_SRC emacs-lisp
(use-package elfeed
:bind (:map elfeed-show-mode-map
("v" . nil))
:config
(add-to-list 'boon-special-mode-list 'elfeed-show-mode)
(add-to-list 'boon-special-mode-list 'elfeed-search-mode))
#+END_SRC
*** jabber :disabled:
#+BEGIN_SRC emacs-lisp
(use-package jabber
:disabled
:commands jabber-connect
:config (global-unset-key (kbd "C-x C-j"))
(global-set-key (kbd "C-x C-j") 'join-line)
(setq jabber-history-enabled t
jabber-history-muc-enabled t
jabber-alert-presence-message-function nil))
#+END_SRC
** image-mode
#+BEGIN_SRC emacs-lisp
(use-package image-mode
@ -769,7 +800,7 @@ Ask for confirmation before saving cookies. I'd rather just disallow them all th
(server-start)
#+END_SRC
** general
** general (keybindings)
#+BEGIN_SRC emacs-lisp
(use-package general
:commands general-define-key)
@ -1161,17 +1192,6 @@ SLIME opens CLHS links in Firefox, but I'd rather open them in Tor Browser; Tor
(setq ivy-re-builders-alist
'((t . ivy--regex-ignore-order))))
#+END_SRC
** jabber :disabled:
#+BEGIN_SRC emacs-lisp
(use-package jabber
:disabled
:commands jabber-connect
:config (global-unset-key (kbd "C-x C-j"))
(global-set-key (kbd "C-x C-j") 'join-line)
(setq jabber-history-enabled t
jabber-history-muc-enabled t
jabber-alert-presence-message-function nil))
#+END_SRC
** WISH magit
It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) when you close a section
#+BEGIN_SRC emacs-lisp
@ -1224,7 +1244,254 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
(midnight . clean-buffer-list))
#+END_SRC
** nodejs-repl :disabled:
** Programming
*** common
#+BEGIN_SRC emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
(use-package company
:diminish company-mode
:commands global-company-mode
:init (global-company-mode)
:bind ;; ("TAB" . company-indent-or-complete-common)
(:map emacs-lisp-mode-map
("TAB" . company-indent-or-complete-common)
("C-i" . company-indent-or-complete-common))
(:map c-mode-map
("TAB" . company-indent-or-complete-common)
("C-i" . company-indent-or-complete-common))
:config
(add-to-list 'company-backends 'company-irony))
(use-package feature-mode
:mode "\\.feature$")
(defun cp/compile-project (file cmd)
"Locate directory with FILE and run compile command CMD."
(cd (locate-dominating-file default-directory file))
(compile cmd))
(defhydra cp-prog (:color blue)
"Which language?"
("e" cp-el/body "Emacs Lisp")
("c" cp-cs/body "CHICKEN Scheme")
("g" cp-guile/body "Guile")
("L" cp-ly/body "Lilypond")
("l" cp-cl/body "Common Lisp")
("o" cp-org/body "Org")
("p" cp-prolog/body "Prolog")
("u" contrapunctus-general/body "up" :color blue)
("s" save-buffer "save")
("k" (kill-buffer (current-buffer)) "kill")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq")
("m" magit-status "Magit"))
(defun cp/prog-hydra ()
(interactive)
(cond ((or (derived-mode-p 'emacs-lisp-mode 'ielm-mode)
;; ;; Similar problems with this as the f-glob below;
;; ;; e.g. false positive if you have a .dir-locals.el in
;; ;; a project...
;; (f-glob "*.el")
)
(cp-el/body))
(;; (or (locate-dominating-file default-directory "build.scm")
;; (locate-dominating-file default-directory "main.ly"))
(derived-mode-p 'LilyPond-mode)
(cp-ly/body))
((and (featurep 'geiser) geiser-mode)
(cond ((equal 'chicken geiser-impl--implementation)
(cp-cs/body))
((equal 'guile geiser-impl--implementation)
(cp-guile/body))
(t (error "Couldn't detect Scheme implementation."))))
((derived-mode-p 'lisp-mode 'slime-repl-mode)
(cp-cl/body))
((derived-mode-p 'org-mode)
(cp-org/body))
((derived-mode-p 'prog-mode)
(cp-prog/body))
(t (contrapunctus-general/body))))
(define-key boon-command-map (kbd "m") #'cp/prog-hydra)
#+END_SRC
*** Emacs Lisp
#+BEGIN_SRC emacs-lisp
(use-package elisp-mode
:diminish
:bind
(:map emacs-lisp-mode-map
("<tab>" . 'company-indent-or-complete-common)
("<C-tab>" . 'outline-toggle-children)
("M-n" . 'outline-next-heading)
("M-p" . 'outline-previous-heading)
("M-m" . macrostep-expand))
:config
(put 'cl-loop 'lisp-indent-function 'defun)
(setq print-length nil
eval-expression-print-length nil))
#+END_SRC
**** eldoc
#+BEGIN_SRC emacs-lisp
(use-package eldoc
:diminish
:if (featurep 'elisp-mode)
:init (add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
:config (setq eldoc-idle-delay 0))
#+END_SRC
**** emr - emacs refactor
#+BEGIN_SRC emacs-lisp
(use-package emr
:bind (:map prog-mode-map
("M-S-<return>" . emr-show-refactor-menu)))
#+END_SRC
**** nameless-mode
#+BEGIN_SRC emacs-lisp
(use-package nameless
:commands nameless-mode
:hook
(ert-results-mode . nameless-mode)
(emacs-lisp-mode . nameless-mode)
:bind (:map emacs-lisp-mode-map
("C-c C-n" . nameless-mode)))
#+END_SRC
**** explain-pause-mode
#+BEGIN_SRC emacs-lisp
(use-package explain-pause-mode
:load-path "/home/anon/.emacs.d/elisp-git/explain-pause-mode/"
:disabled t
:diminish
:commands explain-pause-mode
:init (explain-pause-mode))
#+END_SRC
**** hydra
#+BEGIN_SRC emacs-lisp
(defhydra cp-el-eval (:color blue)
("b" eval-buffer "buffer")
("e" eval-defun "defun")
("l" eval-last-sexp "last sexp"))
(defhydra cp-el (:color blue)
"Emacs Lisp"
("r" ielm "REPL")
("e" cp-el-eval/body "Eval")
("h" helpful-at-point "Help")
("j" xref-find-definitions "Jump to definition")
("d" (funcall-interactively #'eval-defun t) "Debug")
("c" (cp/compile-project "Cask" "cask build") "Compile")
("C" (cp/compile-project "Cask" "cask clean-elc") "clean")
("t" (cp/compile-project "Cask" "cask exec buttercup -L . --traceback pretty") "Test")
("u" cp-prog/body "up" :color blue)
("s" save-buffer "save")
("k" (kill-buffer (current-buffer)) "kill")
("E" toggle-debug-on-error "tdoe")
("Q" toggle-debug-on-quit "tdoq")
("m" magit-status "Magit"))
#+END_SRC
*** Common Lisp
#+BEGIN_SRC emacs-lisp
(defhydra cp-cl-eval (:color blue)
("b" slime-eval-buffer "buffer")
("e" slime-eval-defun "defun"))
(defhydra cp-cl-doc (:color blue)
("d" slime-documentation "slime")
("e" slime-documentation-lookup "CLHS"))
(defhydra cp-cl (:color blue)
"Common Lisp"
("C" slime-connect "connect")
("d" cp-cl-doc/body "Documentation")
("e" cp-cl-eval/body "Eval")
("r" slime "REPL")
("u" cp-prog/body "up" :color blue)
("s" save-buffer "save")
("m" magit-status "Magit"))
#+END_SRC
*** Scheme
**** common
#+BEGIN_SRC emacs-lisp
(defhydra cp-scm-eval (:color blue)
("b" geiser-eval-buffer "buffer")
("e" geiser-eval-definition "defun"))
#+END_SRC
**** CHICKEN Scheme
#+BEGIN_SRC emacs-lisp
(defhydra cp-cs (:color blue)
"CHICKEN Scheme"
("e" cp-scm-eval/body "Eval")
("r" run-chicken "REPL")
("m" magit-status "Magit")
("u" cp-prog/body "up" :color blue))
#+END_SRC
**** Guile
#+BEGIN_SRC emacs-lisp
(defhydra cp-guile (:color blue)
"Guile"
("e" cp-scm-eval/body "Eval")
("r" run-guile "REPL")
("m" magit-status "Magit")
("G" elpher "Elpher")
("u" cp-prog/body "up" :color blue))
#+END_SRC
*** Lilypond
#+BEGIN_SRC emacs-lisp
(defhydra cp-ly (:color blue)
"Lilypond"
("c" (cp/compile-project "main.ly" "~/bin/mkly dev") "Compile")
("m" magit-status "Magit")
("G" elpher "Elpher")
("u" cp-prog/body "up" :color blue))
#+END_SRC
*** Prolog
#+BEGIN_SRC emacs-lisp
(use-package ediprolog
:commands ediprolog-dwim)
(defhydra cp-prolog (:color blue)
"Prolog"
("u" cp-prog/body "up" :color blue)
("r" ediprolog-dwim "REPL"))
#+END_SRC
*** c
#+BEGIN_SRC emacs-lisp
(use-package cc-mode)
(use-package irony-eldoc
:hook
(c-mode . irony-eldoc))
(use-package irony
:config
(add-hook 'irony-mode-hook #'irony-eldoc))
(use-package company-irony)
(use-package rtags
:hook
(c-mode . rtags-call-rc)
:config
(setq rtags-rc-binary-name "rtags-rc"
rtags-rdm-binary-name "rtags-rdm")
:bind
(:map c-mode-map
("<f2> <f2>" . rtags-find-symbol-at-point)))
#+END_SRC
*** nodejs-repl :disabled:
#+BEGIN_SRC emacs-lisp
(use-package nodejs-repl
:disabled
@ -1260,8 +1527,7 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
**
#+BEGIN_SRC emacs-lisp
(use-package rainbow-delimiters
:hook (prog-mode . rainbow-delimiters-mode))
#+END_SRC
@ -1301,7 +1567,6 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
(require 'cp-fm)
(require 'cp-lily)
(require 'cp-sfz)
(require 'cp-prog)
(require 'cp-lisp)
(require 'cp-nav)
@ -1487,7 +1752,7 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
(load custom-file)
#+END_SRC
** doom-acario-dark
** Theme
Must put this after loading the custom file, or I get prompted about the theme each time.
#+BEGIN_SRC emacs-lisp