2020-02-01 18:25:57 -08:00
|
|
|
(defgroup agw nil
|
|
|
|
"Alison G. Watson's customizations."
|
|
|
|
:prefix "agw-"
|
|
|
|
:group 'convenience)
|
|
|
|
|
|
|
|
(defvar agw-mode-map (make-sparse-keymap)
|
|
|
|
"Global keymap for `agw-mode'.")
|
|
|
|
|
2020-02-15 18:54:40 -08:00
|
|
|
(define-minor-mode agw-key-map-mode
|
2020-02-01 18:25:57 -08:00
|
|
|
"Minor mode for key bindings."
|
|
|
|
:global t
|
|
|
|
:keymap agw-mode-map)
|
|
|
|
|
|
|
|
(defun agw-set-key (key def)
|
|
|
|
"Binds a key into `agw-mode-map'."
|
|
|
|
(define-key agw-mode-map (kbd (concat "C-<tab> " key)) def))
|
|
|
|
|
2020-02-01 23:08:21 -08:00
|
|
|
(defun agw-prog-mode ()
|
|
|
|
"Sets up `prog-mode'."
|
2020-02-15 18:49:50 -08:00
|
|
|
(setq-local tab-always-indent nil
|
|
|
|
tab-width 3
|
|
|
|
standard-indent 3
|
2020-03-16 18:29:06 -07:00
|
|
|
indent-tabs-mode t)
|
|
|
|
(hl-line-mode nil))
|
2020-02-01 23:08:21 -08:00
|
|
|
|
2020-02-01 18:25:57 -08:00
|
|
|
(defun agw-fp-mode ()
|
|
|
|
"Sets up lisp and other functional language major modes."
|
2020-02-15 18:49:50 -08:00
|
|
|
(setq-local indent-tabs-mode nil
|
|
|
|
standard-indent 2
|
|
|
|
tab-width 2))
|
2020-02-01 18:25:57 -08:00
|
|
|
|
|
|
|
(defun agw-org-mode ()
|
|
|
|
"Sets up `org-mode'."
|
2020-02-15 18:49:50 -08:00
|
|
|
(setq-local indent-tabs-mode nil
|
|
|
|
standard-indent 2
|
|
|
|
tab-width 2))
|
2020-02-01 18:25:57 -08:00
|
|
|
|
|
|
|
(defun agw-remove-elc ()
|
|
|
|
"Removes an elc file if it exists."
|
|
|
|
(let ((elc (concat buffer-file-name "c")))
|
|
|
|
(if (file-exists-p elc)
|
|
|
|
(delete-file elc))))
|
|
|
|
|
|
|
|
(defun agw-el-mode ()
|
|
|
|
"Sets up `emacs-lisp-mode'."
|
|
|
|
(add-hook 'after-save-hook #'agw-remove-elc nil t))
|
|
|
|
|
2020-02-15 18:55:14 -08:00
|
|
|
(defun agw-evil-visual-state-tag (&optional selection)
|
|
|
|
"Displays the mode for the visual state."
|
|
|
|
(let ((selection (or selection evil-visual-selection)))
|
|
|
|
(cond ((eq selection 'char) "v")
|
|
|
|
((eq selection 'line) "V")
|
|
|
|
((eq selection 'screen-line) "ʌ")
|
|
|
|
((eq selection 'block) "Λ"))))
|
|
|
|
|
2020-03-16 18:29:43 -07:00
|
|
|
(defun agw-after-local-vars ()
|
|
|
|
(unless indent-tabs-mode (smart-tabs-mode 0)))
|
|
|
|
|
2020-02-01 18:25:57 -08:00
|
|
|
;; EOF
|