Browse Source

improve work environment

master
Alison G. Watson 10 months ago
parent
commit
f330dfb902
2 changed files with 18 additions and 10 deletions
  1. +18
    -8
      emacs/data.el
  2. +0
    -2
      emacs/init.el

+ 18
- 8
emacs/data.el View File

@@ -7,7 +7,10 @@
"Global keymap for `agw-mode'.")

(defvar-local agw-no-fixes nil
"Fixes files before save if `t' in this buffer.")
"Fixes files before save if nil in this buffer.")

(defvar-local agw-work nil
"Changes the functionality of `agw-prog-mode'.")

(define-minor-mode agw-key-map-mode
"Minor mode for key bindings."
@@ -18,13 +21,6 @@
"Binds a key into `agw-mode-map'."
(define-key agw-mode-map (kbd (concat "C-<tab> " key)) def))

(defun agw-prog-mode ()
"Sets up `prog-mode' and `text-mode'."
(setq-local tab-always-indent nil
tab-width 3
standard-indent 3
indent-tabs-mode t))

(defun agw-fp-mode ()
"Sets up lisp and other functional language major modes."
(setq-local indent-tabs-mode nil
@@ -61,7 +57,21 @@
((eq selection 'screen-line) "ʌ")
((eq selection 'block) "Λ"))))

(defun agw-prog-mode ()
"Sets up `prog-mode' and `text-mode'."
(if agw-work
(setq-local tab-always-indent t
tab-width 4
standard-indent 4
indent-tabs-mode nil)
(setq-local tab-always-indent nil
tab-width 3
standard-indent 3
indent-tabs-mode t)))

(defun agw-after-local-vars ()
(if (or (derived-mode-p 'prog-mode) (derived-mode-p 'text-mode))
(agw-prog-mode))
(unless indent-tabs-mode (smart-tabs-mode 0)))

;; Lithium dialogues mode


+ 0
- 2
emacs/init.el View File

@@ -24,12 +24,10 @@
(add-hook 'prog-mode-hook #'agw-flyspell-prog-mode)
(add-hook 'prog-mode-hook #'prettify-symbols-mode)
(add-hook 'prog-mode-hook #'subword-mode)
(add-hook 'prog-mode-hook #'agw-prog-mode)

;; `text-mode'
(add-hook 'text-mode-hook #'agw-flyspell-prog-mode)
(add-hook 'text-mode-hook #'subword-mode)
(add-hook 'text-mode-hook #'agw-prog-mode)

;; `hack-local-variables'
(add-hook 'hack-local-variables-hook #'agw-after-local-vars)


Loading…
Cancel
Save