diff options
| author | tslil clingman <> | 2024-07-13 15:07:01 +0200 |
|---|---|---|
| committer | tslil clingman <> | 2024-07-13 15:09:41 +0200 |
| commit | ed836738a16efb7721b72f6aa58f07541fd37393 (patch) | |
| tree | 077b925d8ad499d8c50b37c5049cae50e4e606f9 /emacs/work_inits/22-lisp.el | |
| parent | 31da2d6faa41043ce5e1ddc9b8f6ac0aacc49708 (diff) | |
[emacs] cleanup
Diffstat (limited to 'emacs/work_inits/22-lisp.el')
| -rw-r--r-- | emacs/work_inits/22-lisp.el | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/emacs/work_inits/22-lisp.el b/emacs/work_inits/22-lisp.el deleted file mode 100644 index 1a7e33d..0000000 --- a/emacs/work_inits/22-lisp.el +++ /dev/null @@ -1,104 +0,0 @@ -;; Time-stamp: <2022-06-03 09h28 CDT (radix)> - -;; ---------------------------------------------------------------------------- -;; Lisp helpers - -(defvar lh-pairs '(("(" . ")") - ("[" . "]") - ("{" . "}") - ("<" . ">") - ("\"" . "\""))) - -(defun lh-forward-delim () - (interactive) - (save-match-data - (re-search-forward - (regexp-opt (mapcar #'cdr lh-pairs))))) - -(defun lh-backward-delim () - (interactive) - (save-match-data - (re-search-backward - (regexp-opt (mapcar #'car lh-pairs))))) - -(defun lh-matching-delim () - (interactive) - (cond - ((looking-at (regexp-opt (mapcar #'car lh-pairs))) - (forward-sexp)) - ((looking-back (regexp-opt (mapcar #'cdr lh-pairs)) nil) - (backward-sexp)) - (t (backward-up-list 1 t t)))) - -(defun lh-slurp-forward () - (interactive) - (corral-shift-forward ?\( ?\))) - -(defun lh-slurp-backward () - (interactive) - (corral-shift-backward ?\( ?\))) - -(defun lh-open-parentheses-dwim (arg) - (interactive "P") - (if (or (= (line-beginning-position) (point)) - (looking-at "\\Sw")) (insert-parentheses arg) - (backward-sexp) - (insert-parentheses 1))) - -(defun lh-end-of-defun (arg) - (interactive "P") - (end-of-defun arg) - (re-search-backward ")") - (forward-char)) - -(defun lh-avy-open-paren () - (interactive) - (avy-goto-char ?\( )) - -(defun lh-avy-close-paren () - (interactive) - (avy-goto-char ?\) )) - -(use-package corral :ensure t) -(defun make-lisp-bindings () - (let ((map (eval (read (format "%s-map" major-mode))))) - (progn - (require 'corral) - (define-key map (kbd "M-e") 'forward-sexp) - (define-key map (kbd "M-a") 'backward-sexp) - (define-key map (kbd "M-,") 'lh-backward-delim) - (define-key map (kbd "M-.") 'lh-forward-delim) - (define-key map (kbd "M-/") 'lh-matching-delim) - (define-key map (kbd "C-c (") 'lh-avy-open-paren) - (define-key map (kbd "C-c )") 'lh-avy-close-paren) - (define-key map (kbd "(") 'lh-open-parentheses-dwim) - (define-key map (kbd "C-c r") 'raise-sexp) - (define-key map (kbd "C-k") 'kill-sexp) - (define-key map (kbd "M-(") 'corral-parentheses-forward) - (define-key map (kbd "M-)") 'corral-parentheses-backward) - (define-key map (kbd "M-{") 'corral-braces-forward) - (define-key map (kbd "M-}") 'corral-braces-backward) - (define-key map (kbd "M-[") 'corral-brackets-forward) - (define-key map (kbd "M-]") 'corral-brackets-backward) - (define-key map (kbd "C-)") 'lh-slurp-forward) - (define-key map (kbd "C-(") 'lh-slurp-backward) - (define-key map (kbd "M-p") 'beginning-of-defun) - (define-key map (kbd "M-n") 'lh-end-of-defun) - t))) - -;; ---------------------------------------------------------------------------- -;; Mode configurations - -;; (use-package rainbow-blocks :ensure t) - -(add-hook 'emacs-lisp-mode-hook - (lambda () - (eldoc-mode) - (aggressive-indent-mode) - (make-lisp-bindings))) - -(use-package caps-lock-mode - :load-path "~/.emacs.d/scripts/") - -;; (use-package slime-company -;; :ensure t :defer t) |
