61 lines
1.9 KiB
EmacsLisp
61 lines
1.9 KiB
EmacsLisp
;;; init.el --- ryuslash's init -*- lexical-binding: t; -*-
|
|
|
|
;; Copyright (C) 2023 Tom Willemse
|
|
|
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
|
;; Keywords: local
|
|
|
|
;; 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:
|
|
|
|
;; This is my Emacs' init file.
|
|
|
|
;;; Code:
|
|
|
|
(require 'oni-core)
|
|
(require 'oni-gui)
|
|
|
|
(add-to-list
|
|
'auto-save-file-name-transforms
|
|
`(,(rx (zero-or-more any))
|
|
,(concat (or (getenv "XDG_DATA_HOME")
|
|
(expand-file-name "~/.local/share"))
|
|
"/emacs/auto-save-list")
|
|
t)
|
|
t)
|
|
|
|
(eval-when-compile (require 'ispell))
|
|
(with-eval-after-load 'ispell
|
|
(setq ispell-program-name "hunspell"
|
|
ispell-really-hunspell t))
|
|
|
|
(defun oni-in-word-p ()
|
|
"Check whether the character just typed was part of a word."
|
|
(save-excursion
|
|
(backward-char)
|
|
(looking-back (rx word) (1- (point)))))
|
|
|
|
(with-eval-after-load 'electric
|
|
(add-hook 'electric-quote-inhibit-functions #'oni-in-word-p))
|
|
|
|
(with-eval-after-load 'yaml-mode (require 'oni-yaml))
|
|
|
|
(defvar epg-gpg-program)
|
|
(with-eval-after-load 'epg-config
|
|
;; This is necessary because otherwise Emacs will select the wrong version of
|
|
;; GnuPG through gpg2. gpg is installed by Guix and gpg2 by Archlinux. EPG
|
|
;; seems to prefer gpg2 over gpg and now it seems that the versions of both
|
|
;; have diverged enough that it now matters which is used.
|
|
(setq epg-gpg-program "gpg"))
|