diff options
Diffstat (limited to 'oni-elisp')
-rw-r--r-- | oni-elisp/oni-elisp.el | 80 | ||||
-rw-r--r-- | oni-elisp/snippets/emacs-lisp-mode/depends-on | 5 | ||||
-rw-r--r-- | oni-elisp/snippets/emacs-lisp-mode/face | 5 |
3 files changed, 90 insertions, 0 deletions
diff --git a/oni-elisp/oni-elisp.el b/oni-elisp/oni-elisp.el new file mode 100644 index 0000000..1ae19d3 --- /dev/null +++ b/oni-elisp/oni-elisp.el @@ -0,0 +1,80 @@ +;;; oni-elisp.el --- Emacs Lisp configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2019 Tom Willemse + +;; Author: Tom Willemse <tom@ryuslash.org> +;; Keywords: local +;; Version: 20190825132536 +;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-fci oni-yasnippet rainbow-delimiters nameless erefactor) + +;; 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 <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; My configuration for working in Emacs Lisp. + +;;; Code: + +(require 'yasnippet) + +(let ((byte-compile-not-obsolete-funcs '(preceding-sexp))) + (require 'erefactor)) + +(require 'ielm) + +(defconst oni-elisp-root + (file-name-directory + (or load-file-name + (buffer-file-name))) + "The directory where ‘oni-elisp’ was loaded from.") + +(defconst oni-elisp-snippets-dir + (expand-file-name "snippets" oni-elisp-root) + "The directory where ‘oni-elisp’ stores its snippets.") + +(defun oni-elisp-snippets-initialize () + "Initialize the snippets for ‘oni-elisp’." + (when (boundp 'yas-snippet-dirs) + (add-to-list 'yas-snippet-dirs oni-elisp-snippets-dir t)) + (yas-load-directory oni-elisp-snippets-dir)) + +(add-hook 'emacs-lisp-mode-hook 'company-mode) +(add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode) +(add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on) +(add-hook 'emacs-lisp-mode-hook 'fci-mode) +(add-hook 'emacs-lisp-mode-hook 'flycheck-mode) +(add-hook 'emacs-lisp-mode-hook 'nameless-mode) +(add-hook 'emacs-lisp-mode-hook 'paredit-mode) +(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) + +(add-hook 'ielm-mode-hook 'company-mode) +(add-hook 'ielm-mode-hook 'paredit-mode) + +(setq ielm-prompt "λ> ") + +(define-key emacs-lisp-mode-map (kbd "C-c r") erefactor-map) + +;;;###autoload +(add-to-list 'auto-mode-alist '("/Cask\\'" . emacs-lisp-mode)) + +;;;###autoload +(with-eval-after-load 'elisp-mode + (with-eval-after-load 'yasnippet + (oni-elisp-snippets-initialize))) + +;;;###autoload(with-eval-after-load 'elisp-mode (require 'oni-elisp)) +;;;###autoload(with-eval-after-load 'ielm (require 'oni-elisp)) + +(provide 'oni-elisp) +;;; oni-elisp.el ends here diff --git a/oni-elisp/snippets/emacs-lisp-mode/depends-on b/oni-elisp/snippets/emacs-lisp-mode/depends-on new file mode 100644 index 0000000..4f99d92 --- /dev/null +++ b/oni-elisp/snippets/emacs-lisp-mode/depends-on @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: depends-on +# key: do +# -- +(depends-on "$1")$0
\ No newline at end of file diff --git a/oni-elisp/snippets/emacs-lisp-mode/face b/oni-elisp/snippets/emacs-lisp-mode/face new file mode 100644 index 0000000..9fdbbb2 --- /dev/null +++ b/oni-elisp/snippets/emacs-lisp-mode/face @@ -0,0 +1,5 @@ +# -*- mode: snippet; require-final-newline: nil -*- +# name: face +# key: face +# -- + `($1 ((t (${2::foreground} $0))))
\ No newline at end of file |