From 82fa5d977a97062edb90f441793b40d3bf8a9a59 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 26 May 2016 18:51:39 -0400 Subject: [PATCH] General cleanup --- core/core-editor.el | 8 ++-- core/core-ui.el | 4 +- core/core.el | 66 ++++++++++++++++--------------- init.el | 2 +- modules/module-csharp.el | 2 +- modules/module-eshell.el | 2 +- modules/module-org.el | 2 +- modules/module-php.el | 3 +- private/dict/all | 2 +- private/my-bindings.el | 12 +++--- private/themes/doom-dark-theme.el | 12 +++--- 11 files changed, 60 insertions(+), 55 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 67c06670a..eeb9b27b1 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -262,9 +262,9 @@ ;; behave more like vim (or how I like it). ;; Line-wise mouse selection on margin -(global-set-key (kbd " ") 'doom/mouse-drag-line) -(global-set-key (kbd " ") 'doom/mouse-select-line) -(global-set-key (kbd " ") 'doom/mouse-select-line) +(map! " " 'doom/mouse-drag-line + " " 'doom/mouse-select-line + " " 'doom/mouse-select-line) ;; Restores "dumb" indentation to the tab key. This rustles a lot of peoples' ;; jimmies, apparently, but it's how I like it. @@ -283,7 +283,7 @@ :i [remap backward-delete-char-untabify] 'doom/deflate-space-maybe :i [remap newline] 'doom/newline-and-indent ;; Smarter move-to-beginning-of-line - :i [remap move-beginning-of-line] 'doom/move-to-bol + :i [remap move-beginning-of-line] 'doom/move-to-bol ;; Restore bash-esque keymaps in insert mode; C-w and C-a already exist :i "C-e" 'doom/move-to-eol :i "C-u" 'doom/backward-kill-to-bol-and-indent diff --git a/core/core-ui.el b/core/core-ui.el index bbc478299..5a55058b2 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -159,7 +159,9 @@ (markdown-mode prog-mode scss-mode web-mode conf-mode) 'nlinum-mode) (add-hook! 'nlinum-mode-hook - (add-hook 'post-command-hook 'doom|nlinum-hl-line nil t)) + (if nlinum-mode-hook + (add-hook 'post-command-hook 'doom|nlinum-hl-line nil t) + (remove-hook 'post-command-hook 'doom|nlinum-hl-line t))) :config ;; Calculate line number column width (add-hook! nlinum-mode diff --git a/core/core.el b/core/core.el index df79b298e..b715524b5 100644 --- a/core/core.el +++ b/core/core.el @@ -13,7 +13,6 @@ ;; ;;; Autoloaded functions are in {core,modules}/defuns/defuns-*.el -;; Paths (defalias '! 'eval-when-compile) (defconst doom-emacs-dir (! (expand-file-name user-emacs-directory))) @@ -28,6 +27,37 @@ emacs-major-version emacs-minor-version)) "Hostname and emacs-version-based elisp temp directories") + +;; +;; Load path +;; + +(defvar doom--load-path load-path + "Initial `load-path'; so we don't clobber it on consecutive reloads.") + +;; Populate the load-path manually; cask shouldn't be an internal dependency +(setq load-path + (! (defsubst --subdirs (path &optional include-self) + (let ((result (if include-self (list path) (list)))) + (mapc (lambda (file) + (when (file-directory-p file) + (push file result))) + (ignore-errors (directory-files path t "^[^.]" t))) + result)) + (append (list doom-private-dir) + (--subdirs doom-core-dir t) + (--subdirs doom-modules-dir t) + (--subdirs doom-packages-dir) + (--subdirs (expand-file-name "../bootstrap" doom-packages-dir)) + doom--load-path)) + custom-theme-load-path + (! (append (list (expand-file-name "themes/" doom-private-dir)) + custom-theme-load-path))) + +;; +;; Core configuration +;; + ;; UTF-8 please (set-charset-priority 'unicode) (setq locale-coding-system 'utf-8) ; pretty @@ -39,7 +69,7 @@ ;; Premature optimization for faster startup (setq-default gc-cons-threshold 4388608 - gc-cons-percentage 0.4 + gc-cons-percentage 0.3 major-mode 'text-mode) ;; stop package.el from being annoying. I rely solely on Cask. @@ -85,41 +115,13 @@ ;; -;; Load path -;; - -(defvar doom--load-path load-path - "Initial `load-path'; so we don't clobber it on consecutive reloads.") - -;; Populate the load-path manually; cask shouldn't be an internal dependency -(setq load-path - (! (defsubst --subdirs (path &optional include-self) - (let ((result (if include-self (list path) (list)))) - (mapc (lambda (file) - (when (file-directory-p file) - (push file result))) - (ignore-errors (directory-files path t "^[^.]" t))) - result)) - (append (list doom-private-dir) - (--subdirs doom-core-dir t) - (--subdirs doom-modules-dir t) - (--subdirs doom-packages-dir) - (--subdirs (expand-file-name "../bootstrap" doom-packages-dir)) - doom--load-path)) - custom-theme-load-path - (! (append (list (expand-file-name "themes/" doom-private-dir)) - custom-theme-load-path))) - - -;; -;; Libraries +;; Bootstrap ;; +(autoload 'use-package "use-package" "" nil 'macro) (require 'f) (require 'dash) (require 's) - -(autoload 'use-package "use-package" "" nil 'macro) (require 'core-vars) (require 'core-defuns) (unless (require 'autoloads nil t) diff --git a/init.el b/init.el index e84f482a5..000374c22 100644 --- a/init.el +++ b/init.el @@ -71,7 +71,7 @@ module-php ; making php less painful to work with module-processing ; pretty prototypes module-python ; beautiful is better than ugly - module-rest ; GET /a/life?please=1&top=cherry + module-rest ; Emacs as a service module-ruby ; 1.step do {|i| p "Ruby is #{i&1==0?'love':'life'}"} module-rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() module-scala ; Java, but good diff --git a/modules/module-csharp.el b/modules/module-csharp.el index d4e16e960..40c7562e6 100644 --- a/modules/module-csharp.el +++ b/modules/module-csharp.el @@ -1,4 +1,4 @@ -;;; module-csharp.el +;;; module-csharp.el --- -*- no-byte-compile: t; -*- (use-package csharp-mode :mode "\\.cs$" diff --git a/modules/module-eshell.el b/modules/module-eshell.el index 849eea342..a289e5924 100644 --- a/modules/module-eshell.el +++ b/modules/module-eshell.el @@ -1,4 +1,4 @@ -;;; module-eshell.el +;;; module-eshell.el --- -*- no-byte-compile: t; -*- (use-package eshell :when IS-WINDOWS diff --git a/modules/module-org.el b/modules/module-org.el index 597d87c44..d3342e50e 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -1,4 +1,4 @@ -;;; module-org.el +;;; module-org.el --- -*- no-byte-compile: t; -*- (add-hook 'org-load-hook 'doom|org-init t) (add-hook 'org-load-hook 'doom|org-keybinds t) diff --git a/modules/module-php.el b/modules/module-php.el index eb1d75184..d48b0a9e4 100644 --- a/modules/module-php.el +++ b/modules/module-php.el @@ -29,6 +29,7 @@ (use-package php-extras :after php-mode + :init (add-hook 'php-mode-hook 'turn-on-eldoc-mode) :config (defun php-extras-company-setup ()) ;; company will set up itself ;; Generate php-extras documentation and completion asynchronously @@ -43,7 +44,7 @@ (use-package php-refactor-mode :after php-mode - :init (add-hook! php-mode '(turn-on-eldoc-mode php-refactor-mode)) + :init (add-hook 'php-mode-hook 'php-refactor-mode) :config (mapc (lambda (x) (let ((command-name (car x)) diff --git a/private/dict/all b/private/dict/all index 3936556c4..10998a2d6 100644 --- a/private/dict/all +++ b/private/dict/all @@ -1,4 +1,4 @@ -henrik@lissner.net +henrik@lissner.net @lissner.net ---------------------------------------- ======================================== //////////////////////////////////////// diff --git a/private/my-bindings.el b/private/my-bindings.el index 95db3347c..6dbfbeb67 100644 --- a/private/my-bindings.el +++ b/private/my-bindings.el @@ -46,7 +46,7 @@ :m "M-8" (λ! (doom:switch-to-tab 7)) :m "M-9" (λ! (doom:switch-to-tab 8)) (:when IS-MAC - "" 'doom/backward-kill-to-bol-and-indent + "" 'doom/backward-kill-to-bol-and-indent "" 'backward-word "" 'forward-word "A-SPC" 'just-one-space @@ -250,7 +250,7 @@ ;; evil-matchit :m "%" 'evilmi-jump-items - ;; hide-show + ;; hide-show/evil-matchit :m [tab] (λ! (if (ignore-errors (hs-already-hidden-p)) (hs-toggle-hiding) (call-interactively 'evilmi-jump-items))) @@ -310,14 +310,14 @@ ;;; Insert mode hacks ;; Textmate-esque newlines - :i "" 'backward-delete-char-untabify - :i "" 'doom/backward-kill-to-bol-and-indent - :i "" 'evil-ret-and-indent + :i "" 'delete-backward-char + :i "" 'doom/backward-kill-to-bol-and-indent + :i "" 'evil-ret-and-indent ;; Emacsien motions for insert mode :i "C-b" 'backward-word :i "C-f" 'forward-word ;; escape from insert mode (more responsive than using key-chord-define) - :irv "C-g" 'evil-normal-state) + :irv "C-g" 'evil-normal-state) ;; Common unicode characters (map! :i "A-o" (λ! (insert "ø")) diff --git a/private/themes/doom-dark-theme.el b/private/themes/doom-dark-theme.el index 97cb0ab82..cdbc8addf 100644 --- a/private/themes/doom-dark-theme.el +++ b/private/themes/doom-dark-theme.el @@ -375,7 +375,7 @@ (--color-name-to-rgb color2)))) (custom-theme-set-variables - 'doom-one + 'doom-dark `(vc-annotate-color-map '((20 . ,green) (40 . ,(--color-blend yellow green (/ 1.0 3))) @@ -390,11 +390,11 @@ (220 . ,(--color-blend red magenta (/ 1.0 3))) (240 . ,(--color-blend red magenta (/ 2.0 3))) (260 . ,red) - (280 . ,(--color-blend grey-l red (/ 1.0 4))) - (300 . ,(--color-blend grey-l red (/ 2.0 4))) - (320 . ,(--color-blend grey-l red (/ 3.0 4))) - (340 . ,grey-l) - (360 . ,grey-l))) + (280 . ,(--color-blend grey-2 red (/ 1.0 4))) + (300 . ,(--color-blend grey-2 red (/ 2.0 4))) + (320 . ,(--color-blend grey-2 red (/ 3.0 4))) + (340 . ,grey-2) + (360 . ,grey-2))) `(vc-annotate-very-old-color nil) `(vc-annotate-background ,black)))