summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-03-08 16:58:18 -0600
committerCase Duckworth2021-03-08 16:58:18 -0600
commit2c72fd14cd1bdab0cd5bead7aad6b87e6f721dcd (patch)
treeeedb3b6346452d82281cd738be74dd1103af2db9 /init.el
parent5c (diff)
downloademacs-2c72fd14cd1bdab0cd5bead7aad6b87e6f721dcd.tar.gz
emacs-2c72fd14cd1bdab0cd5bead7aad6b87e6f721dcd.zip
Add functions
Diffstat (limited to 'init.el')
-rw-r--r--init.el80
1 files changed, 76 insertions, 4 deletions
diff --git a/init.el b/init.el index 7f6da30..4998f47 100644 --- a/init.el +++ b/init.el
@@ -19,9 +19,81 @@
19;;; Code: 19;;; Code:
20 20
21;; Add `acdw.el' 21;; Add `acdw.el'
22(add-to-list 'load-path (expand-file-name "lisp/" 22(push (expand-file-name "lisp/"
23 user-emacs-directory)) 23 user-emacs-directory)
24 load-path)
25
24(require 'acdw) 26(require 'acdw)
25 27
26(autoload 'ehelp-command "ehelp") 28;;; Good defaults
27(define-key acdw/map (kbd "C-h") #'ehelp-command) 29
30;; Lines
31(acdw/set '((fill-column 80)))
32(global-display-fill-column-indicator-mode +1)
33(add-hook 'text-mode-hook #'turn-on-auto-fill)
34(add-hook 'prog-mode-hook #'turn-on-auto-fill)
35(global-so-long-mode +1)
36;; Whitespace
37(acdw/set `((whitespace-style
38 (empty indentation space-before-tab space-after-tab))
39 (indent-tabs-mode t)
40 (tab-width 8)))
41(add-hook 'before-save-hook #'whitespace-cleanup)
42
43;; Pairs
44(add-hook 'prog-mode-hook #'electric-pair-local-mode)
45(acdw/set '((show-paren-delay 0)
46 (show-paren-style mixed)
47 (show-paren-when-point-inside-paren t)
48 (show-paren-when-point-in-periphery t)))
49(show-paren-mode +1)
50
51;; Killing & Yanking
52(delete-selection-mode +1)
53(acdw/set `((save-interprogram-paste-before-kill t)
54 (yank-pop-change-selection t)
55 (x-select-enable-clipboard t)
56 (x-select-enable-primary t)
57 (mouse-drag-copy-region t)
58 (kill-do-not-save-duplicates t)))
59
60;; Encoding
61(set-charset-priority 'unicode)
62(set-language-environment "UTF-8")
63(prefer-coding-system 'utf-8-unix)
64(set-default-coding-systems 'utf-8-unix)
65(set-terminal-coding-system 'utf-8-unix)
66(set-keyboard-coding-system 'utf-8-unix)
67(set-selection-coding-system 'utf-8-unix)
68(acdw/set '((locale-coding-system utf-8-unix)
69 (coding-system-for-read utf-8-unix)
70 (coding-system-for-write utf-8-unix)
71 (buffer-file-coding-system utf-8-unix)
72 (org-export-coding-system utf-8-unix)
73 (org-html-coding-system utf-8-unix)
74 (default-process-coding-system (utf-8-unix . utf-8-unix))
75 (x-select-request-type (UTF8_STRING COMPOUND_TEXT TEXT STRING))))
76
77;; Backups
78(acdw/set `((backup-by-copying t)
79 (delete-old-versions -1)
80 (version-control t)
81 (vc-make-backup-files t)
82 (backup-directory-alist ((".*" . ,(acdw/in-dir "backup/" t))))))
83;; Autosaves
84(acdw/set `((auto-save-file-name-transforms
85 ((".*" ,(acdw/in-dir "auto-save/" t) t)))
86 (auto-save-list-file-prefix
87 ,(acdw/in-dir "auto-save-list/.saves-" t))))
88(auto-save-visited-mode +1)
89
90;; Cursor
91(acdw/set '((cursor-type bar)
92 (cursor-in-non-selected-windows 'box)))
93
94(defun hook--overwrite-mode-change-cursor ()
95 (setq cursor-type (if overwrite-mode t 'bar)))
96(add-hook 'overwrite-mode-hook #'hook--overwrite-mode-change-cursor)
97
98;; Bindings
99(acdw/bind "C-h" 'ehelp-command :autoload ("ehelp" nil nil 'keymap))