summaryrefslogtreecommitdiff
path: root/.emacs
diff options
context:
space:
mode:
Diffstat (limited to '.emacs')
-rw-r--r--.emacs30
1 files changed, 16 insertions, 14 deletions
diff --git a/.emacs b/.emacs
index 2142c31..b49f196 100644
--- a/.emacs
+++ b/.emacs
@@ -36,7 +36,7 @@
(global-set-key (kbd "C-x C-b") 'ibuffer)
-;; C-c [:alpha:] is reserved for users - let's make good use of it
+;; C-c [[:alpha:]] is reserved for users - let's make good use of it.
(global-set-key (kbd "C-c c") 'compile)
(global-set-key (kbd "C-c f") 'auto-fill-mode)
@@ -49,9 +49,9 @@
(global-set-key (kbd "C-c w c") 'whitespace-cleanup)
(global-set-key (kbd "C-c w f") 'page-break-lines-mode)
(global-set-key (kbd "C-c w m") 'whitespace-mode)
-(global-set-key (kbd "C-c w t") 'set-tab-width)
+(global-set-key (kbd "C-c w t") 'my/set-tab-width)
-(rg-enable-default-bindings)
+(rg-enable-default-bindings) ; Uses the C-c s prefix.
;; TODO: define my own input method, instead of overloading TeX
;; https://www.emacswiki.org/emacs/TeXInputMethod explains why the
@@ -72,6 +72,9 @@
("<--" ?←) ("</-" ?β†š) ("<==" ?⇐) ("</=" ?⇍)
("<->" ?↔) ("<=>" ?⇔))))
+;; What's life without a little risk?
+(setq disabled-command-function nil)
+
;; Window management
@@ -104,8 +107,9 @@
(delight 'page-break-lines-mode nil "page-break-lines")
(delight 'scroll-lock-mode "πŸ“œ" "scroll-lock")
(delight 'visual-line-mode "β€Έ" t)
+(delight 'whitespace-mode nil "whitespace")
(delight 'with-editor-mode "⸎" "with-editor")
-;; TODO: narrowing
+;; TODO: Narrow (βŒ–, β›Ά)
(defun my/magit-mode-hook ()
(when window-system
@@ -120,9 +124,7 @@
(defun my/c-modes-hook ()
(c-set-style "bsd")
- (c-set-offset 'arglist-close 0)
- ;; TODO: find why c-mode is not happy with mark-defun
- (local-set-key (kbd "C-c h") 'c-mark-function))
+ (c-set-offset 'arglist-close 0))
(add-hook 'c-mode-common-hook 'my/c-modes-hook)
@@ -143,8 +145,8 @@
(defun my/makefile-hook ()
;; I would rather align backslashes with spaces rather than tabs;
;; however, I would also like indent-tabs-mode to remain non-nil.
- (local-set-key (kbd "C-c C-\\") (make-tabless 'makefile-backslash-region))
- (local-set-key (kbd "M-q") (make-tabless 'fill-paragraph)))
+ (local-set-key (kbd "C-c C-\\") (my/make-tabless 'makefile-backslash-region))
+ (local-set-key (kbd "M-q") (my/make-tabless 'fill-paragraph)))
(add-hook 'makefile-mode-hook 'my/makefile-hook)
@@ -183,14 +185,14 @@
;; Helper functions and miscellaneous settings.
-;; TODO: copy documentation from F
-(defun make-tabless (f)
- "Make a function which will disable tabs while running F."
+(defun my/make-tabless (f)
+ "Make a function which will run F with indent-tabs-mode disabled."
(lambda () (interactive)
+ ;; TODO: copy documentation from F
(let ((indent-tabs-mode nil))
(call-interactively f))))
-(defun set-tab-width (&optional arg)
+(defun my/set-tab-width (&optional arg)
(interactive "P")
(let ((new-width (cond (arg (prefix-numeric-value arg))
((= tab-width 4) 8)
@@ -237,7 +239,7 @@
(my/unfroggify)
(my/froggify)))
-(defun buffer-justify-full ()
+(defun my/buffer-justify-full ()
(setq default-justification 'full))
;; Font stuff (🀷 🀦)