General refactor + cleanup

This commit is contained in:
Henrik Lissner 2017-06-05 00:47:56 +02:00
parent 1fd482fa51
commit 30402495fe
8 changed files with 56 additions and 52 deletions

View file

@ -222,14 +222,14 @@ files."
(defun doom-module-path (module submodule &optional file)
"Get the full path to a module: e.g. :lang emacs-lisp maps to
~/.emacs.d/modules/lang/emacs-lisp/ and will append FILE if non-nil."
(unless (keywordp module)
(error "Expected a keyword, got %s" module))
(unless (symbolp submodule)
(error "Expected a symbol, got %s" submodule))
(let ((module-name (substring (symbol-name module) 1))
(submodule-name (symbol-name submodule)))
(expand-file-name (concat module-name "/" submodule-name "/" file)
doom-modules-dir)))
(when (keywordp module)
(setq module (substring (symbol-name module) 1)))
(when (symbolp submodule)
(setq submodule (symbol-name submodule)))
(cl-assert (stringp module))
(cl-assert (stringp submodule))
(expand-file-name (concat module "/" submodule "/" file)
doom-modules-dir))
(defun doom-module-loaded-p (module submodule)
"Returns t if MODULE->SUBMODULE is present in `doom-modules'."

View file

@ -14,20 +14,21 @@
image-animate-loop t
indicate-buffer-boundaries nil
indicate-empty-lines nil
max-mini-window-height 0.3
mode-line-default-help-echo nil ; disable mode-line mouseovers
mouse-yank-at-point t ; middle-click paste at point, not at click
resize-mini-windows 'grow-only ; Minibuffer resizing
show-help-function nil ; hide :help-echo text
split-width-threshold nil ; favor horizontal splits
uniquify-buffer-name-style 'forward
use-dialog-box nil ; always avoid GUI
visible-cursor nil
x-stretch-cursor nil
;; defer jit font locking slightly to [try to] improve Emacs performance
jit-lock-defer-time nil
jit-lock-stealth-nice 0.1
jit-lock-stealth-time 0.2
jit-lock-stealth-verbose nil
max-mini-window-height 0.3
mode-line-default-help-echo nil ; disable mode-line mouseovers
mouse-yank-at-point t ; middle-click paste at point, not at click
resize-mini-windows 'grow-only ; Minibuffer resizing
show-help-function nil ; hide :help-echo text
split-width-threshold nil ; favor horizontal splits
uniquify-buffer-name-style 'forward
use-dialog-box nil ; always avoid GUI
visible-cursor nil
x-stretch-cursor nil
;; `pos-tip' defaults
pos-tip-internal-border-width 6
pos-tip-border-width 1
@ -197,11 +198,12 @@ file."
:init
(add-hook! (linum-mode nlinum-mode) #'hl-line-mode)
:config
;; stickiness doesn't play nice with emacs 25+
;; I don't need hl-line showing in other windows. This also offers a small
;; speed boost when buffer is displayed in multiple windows.
(setq hl-line-sticky-flag nil
global-hl-line-sticky-flag nil)
;; acts weird with evil visual mode, so disable it temporarily
;; Acts & looks weird with evil visual mode, so disable it temporarily
(defun doom|hl-line-off () (hl-line-mode -1))
(after! evil
(add-hook! 'hl-line-mode-hook

View file

@ -48,7 +48,7 @@
;ido ; the other *other* search engine...
:ui
doom ; doom-one; a look inspired by Atom's Dark One
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
doom-modeline ; a snazzy Atom-inspired mode-line
doom-quit ; DOOM quit-message prompts when you quit Emacs
@ -97,8 +97,8 @@
typescript ; javascript, but better
web ; the tubes
;; Applications are opinionated modules that transform Emacs to fulfill a
;; specific purpose. They should be loaded last.
;; Applications are complex and opinionated modules that transform Emacs
;; toward a specific purpose. They should be loaded last.
:app
;crm ; TODO org-mode for client relations management
email ; Emacs as an email client

View file

@ -40,7 +40,7 @@ These modules are in their ideal load order.
+ :feature :: Broad modules that bring essential functionality to Emacs as an editor.
+ :completion :: Swappable completion modules for narrowing down candidate lists quickly.
+ :ui :: Modules that affect the DOOM user interface or experience.
+ :ui :: Aesthetic modules that affect the Emacs interface or user experience.
+ :tools :: Small modules that add specific, non-essential functionality to Emacs.
+ :lang :: Modules that bring support for a language or group of languages to Emacs.
+ :app :: Opinionated and heavy modules that totally transform Emacs' UI to serve a specific purpose.

View file

@ -164,12 +164,6 @@ across windows."
;; Plugins
;;
(def-package! evil-args
:commands (evil-inner-arg evil-outer-arg
evil-forward-arg evil-backward-arg
evil-jump-out-args))
(def-package! evil-commentary
:commands (evil-commentary evil-commentary-yank evil-commentary-line)
:config (evil-commentary-mode 1))
@ -177,7 +171,6 @@ across windows."
(def-package! evil-easymotion
:defer 1
:commands evilem-define
:config
(defvar +evil--snipe-repeat-fn
(evilem-create #'evil-snipe-repeat
@ -263,15 +256,6 @@ across windows."
(add-hook '+evil-esc-hook #'+evil|escape-exchange))
(def-package! evil-indent-plus
:commands (evil-indent-plus-i-indent
evil-indent-plus-a-indent
evil-indent-plus-i-indent-up
evil-indent-plus-a-indent-up
evil-indent-plus-i-indent-up-down
evil-indent-plus-a-indent-up-down))
(def-package! evil-matchit
:commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode)
:config (global-evil-matchit-mode 1)
@ -341,10 +325,6 @@ the new algorithm is confusing, like in python or ruby."
(push 'evil-escape-mode evil-mc-incompatible-minor-modes))
(def-package! evil-textobj-anyblock
:commands (evil-textobj-anyblock-inner-block evil-textobj-anyblock-a-block))
(def-package! evil-snipe :demand t
:init
(setq evil-snipe-smart-case t
@ -409,3 +389,24 @@ the new algorithm is confusing, like in python or ruby."
(global-evil-visualstar-mode 1))
;;
;; Text object plugins
;;
(def-package! evil-args
:commands (evil-inner-arg evil-outer-arg
evil-forward-arg evil-backward-arg
evil-jump-out-args))
(def-package! evil-indent-plus
:commands (evil-indent-plus-i-indent
evil-indent-plus-a-indent
evil-indent-plus-i-indent-up
evil-indent-plus-a-indent-up
evil-indent-plus-i-indent-up-down
evil-indent-plus-a-indent-up-down))
(def-package! evil-textobj-anyblock
:commands (evil-textobj-anyblock-inner-block evil-textobj-anyblock-a-block))

View file

@ -36,7 +36,7 @@ produces an url. Used by `+jump/online'.")
(add-hook!
'(imenu-after-jump-hook evil-jumps-post-jump-hook
counsel-grep-post-action-hook dumb-jump-after-jump-hook)
'recenter)
#'recenter)
;;

View file

@ -5,14 +5,12 @@
(load! +commands)) ; my custom ex commands
(defvar +hlissner-dir
(file-name-directory load-file-name))
(eval-when-compile (file-name-directory load-file-name)))
(defvar +hlissner-snippets-dir
(expand-file-name "snippets/" +hlissner-dir))
(setq user-mail-address "henrik@lissner.net"
user-full-name "Henrik Lissner"
epa-file-encrypt-to user-mail-address
(setq epa-file-encrypt-to user-mail-address
auth-sources (list (expand-file-name ".authinfo.gpg" +hlissner-dir)))
(defun +hlissner*no-authinfo-for-tramp (orig-fn &rest args)

View file

@ -1,5 +1,5 @@
;;; fun/doom-quit/config.el
;;
;;; ui/doom-quit/config.el
;; A silly module that prompts you with messages when you try to quit, like DOOM
;; did. Some quotes are taken from Doom's quit-message list, others are random,
;; nerdy references that no decent human being has any business recognizing.
@ -28,7 +28,10 @@ http://doom.wikia.com/wiki/Quit_messages and elsewhere.")
(defun +doom-quit (&rest _)
(if (doom-real-buffers-list)
(y-or-n-p (format "%s Quit?" (nth (random (length +doom-quit-messages)) +doom-quit-messages)))
(y-or-n-p
(format "%s Quit?"
(nth (random (length +doom-quit-messages))
+doom-quit-messages)))
t))
(setq confirm-kill-emacs #'+doom-quit)