v1.1.3 bump
+ sp: be quiet + popup: load *eval* rule earlier + evil-anzu: defer, due to long load time + Update makefile + Clean up core.el + line-spacing = 1, less rpadding on nlinum-format + Add *esup* popup rule + Refactor doom macro + Refactor doom-byte-compile + :big [SIZE] + use inconsolata in big-mode + :v TAB -> doom/yas-insert-snippet + eval: use pop-to-buffer instead of doom/popup-buffer + Refactor backspace fn; handle pair deletion issue with sp better + \#bringbackwindowsystem + db: remove unused var + Update init.el
This commit is contained in:
parent
df13257ce8
commit
fc78d46f30
19 changed files with 86 additions and 76 deletions
|
@ -1,34 +1,34 @@
|
|||
;;; core-defuns.el
|
||||
|
||||
;; Bootstrap macro
|
||||
(defmacro doom (_ default-theme __ term-theme ___ font &rest packages)
|
||||
(defmacro doom (_ theme __ font &rest packages)
|
||||
"Bootstrap DOOM emacs and initialize PACKAGES"
|
||||
`(let ((gc-cons-threshold 339430400)
|
||||
(gc-cons-percentage 0.6)
|
||||
file-name-handler-alist)
|
||||
`(let (file-name-handler-alist)
|
||||
;; Local settings
|
||||
(load "~/.emacs.local.el" t t)
|
||||
;; (load "~/.emacs.local.el" t t)
|
||||
;; Global constants
|
||||
(defvar doom-default-theme ,default-theme)
|
||||
(defvar doom-terminal-theme ,term-theme)
|
||||
(defvar doom-default-theme ,theme)
|
||||
(defvar doom-default-font
|
||||
(font-spec :family ,(nth 0 font)
|
||||
:size ,(nth 1 font)
|
||||
:antialias ,(not (nth 2 font))))
|
||||
|
||||
(defvar doom-current-theme (if (display-graphic-p) doom-default-theme doom-terminal-theme))
|
||||
(defvar doom-current-theme doom-default-theme)
|
||||
(defvar doom-current-font doom-default-font)
|
||||
|
||||
(unless noninteractive
|
||||
,@(mapcar (lambda (pkg) `(require ',pkg))
|
||||
packages)
|
||||
(when (display-graphic-p)
|
||||
(when window-system
|
||||
(require 'server)
|
||||
(unless (server-running-p)
|
||||
(server-start)))
|
||||
;; Prevent any auto-displayed text + benchmarking
|
||||
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
||||
(message ""))))
|
||||
(message ""))
|
||||
|
||||
(setq-default gc-cons-threshold 4388608
|
||||
gc-cons-percentage 0.4)))
|
||||
|
||||
;; Backwards compatible `with-eval-after-load'
|
||||
(unless (fboundp 'with-eval-after-load)
|
||||
|
@ -339,14 +339,20 @@ e.g. (doom-fix-unicode \"DejaVu Sans\" '(?⚠ ?★ ?λ ?➊ ?➋ ?➌ ?➍ ?➎
|
|||
(font-spec :name font :size size) nil 'prepend))
|
||||
chars))
|
||||
|
||||
(defun doom-byte-compile ()
|
||||
(defun doom-byte-compile (&optional minimal)
|
||||
"Byte compile the core and library .el files in ~/.emacs.d"
|
||||
(interactive)
|
||||
(mapc (lambda (f) (byte-compile-file (concat doom-emacs-dir "/" f)))
|
||||
'("init.el" "private/my-commands.el" "private/my-bindings.el"
|
||||
"core/core.el" "core/core-defuns.el" "core/core-ui.el"))
|
||||
(byte-recompile-directory doom-core-dir 0 t)
|
||||
(byte-recompile-directory doom-modules-dir 0 t)
|
||||
"core/core.el" "core/core-defuns.el" "core/core-ui.el"
|
||||
"core/core-os.el" "core/core-os-osx.el" "core/core-os-win32.el"
|
||||
"core/core-os-linux.el"))
|
||||
(unless minimal
|
||||
(byte-recompile-directory doom-core-dir 0 t)
|
||||
(byte-recompile-directory doom-modules-dir 0 t))
|
||||
(when minimal
|
||||
(byte-recompile-directory (concat doom-core-dir "/defuns") 0 t)
|
||||
(byte-recompile-directory (concat doom-modules-dir "/defuns") 0 t))
|
||||
(message "Compiled!"))
|
||||
|
||||
(provide 'core-defuns)
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
:init (add-hook 'quickrun/mode-hook 'linum-mode)
|
||||
:config
|
||||
(setq quickrun-focus-p nil)
|
||||
(def-popup! "*quickrun*" :align below :size 10)
|
||||
(def-popup! "*eval*" :align below :size 20))
|
||||
(def-popup! "*quickrun*" :align below :size 10))
|
||||
|
||||
(use-package repl-toggle
|
||||
:commands (rtog/toggle-repl rtog/add-repl)
|
||||
|
|
|
@ -205,6 +205,7 @@
|
|||
:commands (evil-numbers/inc-at-pt evil-numbers/dec-at-pt))
|
||||
|
||||
(use-package evil-anzu
|
||||
:defer 1
|
||||
:config
|
||||
(setq anzu-cons-mode-line-p nil
|
||||
anzu-minimum-input-length 1
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
(setq shackle-rules
|
||||
`(;; Util
|
||||
("^\\*.+-Profiler-Report .+\\*$" :align below :size 0.3 :regexp t)
|
||||
("*esup*" :align below :size 30 :noselect t)
|
||||
("*esup*" :align below :size 0.4 :noselect t)
|
||||
("*minor-modes*" :align below :size 0.5 :noselect t)
|
||||
("*eval*" :align below :size 20)
|
||||
;; Emacs
|
||||
("*Pp Eval Output*" :align below :size 0.3)
|
||||
("*Apropos*" :align below :size 0.3)
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
(erase-buffer)
|
||||
(setq doom-buffer-edited nil)
|
||||
(insert
|
||||
(let* ((auto-detect-frame (or auto-detect-frame (not (display-graphic-p))))
|
||||
(let* ((auto-detect-frame (or auto-detect-frame (not window-system)))
|
||||
(width (max 3 (- (if auto-detect-frame
|
||||
(window-width)
|
||||
(cdr (assq 'width default-frame-alist))) 3)))
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
(setq-default
|
||||
line-spacing 1
|
||||
indicate-buffer-boundaries nil ; don't show where buffer starts/ends
|
||||
indicate-empty-lines nil ; don't show empty lines
|
||||
fringes-outside-margins t ; switches order of fringe and margin
|
||||
|
@ -42,7 +43,7 @@
|
|||
;; Initialize UI
|
||||
(load-theme doom-current-theme t)
|
||||
(tooltip-mode -1) ; show tooltips in echo area
|
||||
(if (not (display-graphic-p))
|
||||
(if (not window-system)
|
||||
(menu-bar-mode -1)
|
||||
(scroll-bar-mode -1) ; no scrollbar
|
||||
(tool-bar-mode -1) ; no toolbar
|
||||
|
@ -151,7 +152,7 @@
|
|||
:commands nlinum-mode
|
||||
:preface
|
||||
(setq linum-format "%3d ")
|
||||
(defvar nlinum-format "%4d ")
|
||||
(defvar nlinum-format "%4d ")
|
||||
(defvar doom--hl-nlinum-overlay nil)
|
||||
(defvar doom--hl-nlinum-line nil)
|
||||
:init
|
||||
|
@ -260,7 +261,8 @@
|
|||
(spaceline-define-segment *anzu
|
||||
"Show the current match number and the total number of matches. Requires
|
||||
anzu to be enabled."
|
||||
(when (evil-ex-hl-active-p 'evil-ex-search)
|
||||
(when (and (featurep 'evil-anzu)
|
||||
(evil-ex-hl-active-p 'evil-ex-search))
|
||||
(powerline-raw
|
||||
(let ((here anzu--current-position)
|
||||
(total anzu--total-matched))
|
||||
|
|
|
@ -14,7 +14,7 @@ defuns/defuns-workgroups.el.")
|
|||
automatically renamed to the project name.")
|
||||
|
||||
(use-package workgroups2
|
||||
:when (display-graphic-p)
|
||||
:when window-system
|
||||
:init
|
||||
(setq-default
|
||||
wg-session-file (concat doom-temp-dir "/workgroups/last")
|
||||
|
|
19
core/core.el
19
core/core.el
|
@ -13,6 +13,10 @@
|
|||
;;
|
||||
;;; Autoloaded functions are in {core,modules}/defuns/defuns-*.el
|
||||
|
||||
;; Premature optimization for faster startup
|
||||
(setq-default gc-cons-threshold 339430400
|
||||
gc-cons-percentage 0.6)
|
||||
|
||||
(defalias '! 'eval-when-compile)
|
||||
|
||||
(defconst doom-emacs-dir (! (expand-file-name user-emacs-directory)))
|
||||
|
@ -27,6 +31,9 @@
|
|||
emacs-major-version emacs-minor-version))
|
||||
"Hostname and emacs-version-based elisp temp directories")
|
||||
|
||||
;; window-system is deprecated. Not on my watch!
|
||||
(unless (boundp 'window-system)
|
||||
(defvar window-system (framep-on-display)))
|
||||
|
||||
;;
|
||||
;; Load path
|
||||
|
@ -37,7 +44,7 @@
|
|||
|
||||
;; Populate the load-path manually; cask shouldn't be an internal dependency
|
||||
(setq load-path
|
||||
(! (defsubst --subdirs (path &optional include-self)
|
||||
(! (defun --subdirs (path &optional include-self)
|
||||
(let ((result (if include-self (list path) (list))))
|
||||
(mapc (lambda (file)
|
||||
(when (file-directory-p file)
|
||||
|
@ -67,11 +74,6 @@
|
|||
(prefer-coding-system 'utf-8) ; with sugar on top
|
||||
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
|
||||
|
||||
;; Premature optimization for faster startup
|
||||
(setq-default gc-cons-threshold 4388608
|
||||
gc-cons-percentage 0.3
|
||||
major-mode 'text-mode)
|
||||
|
||||
;; stop package.el from being annoying. I rely solely on Cask.
|
||||
(setq package--init-file-ensured t
|
||||
package-enable-at-startup nil
|
||||
|
@ -81,10 +83,10 @@
|
|||
("org" . "http://orgmode.org/elpa/"))
|
||||
|
||||
ad-redefinition-action 'accept ; silence the advised function warnings
|
||||
confirm-nonexistent-file-or-buffer t
|
||||
compilation-always-kill t ; kill compl. process before spawning another
|
||||
compilation-ask-about-save nil ; save all buffers before compiling
|
||||
compilation-scroll-output t ; scroll with output while compiling
|
||||
confirm-nonexistent-file-or-buffer t
|
||||
delete-by-moving-to-trash t
|
||||
echo-keystrokes 0.02 ; show me what I type
|
||||
ediff-diff-options "-w"
|
||||
|
@ -92,6 +94,7 @@
|
|||
ediff-window-setup-function 'ediff-setup-windows-plain ; no extra frames
|
||||
enable-recursive-minibuffers nil ; no minibufferception
|
||||
idle-update-delay 5 ; update a little less often
|
||||
major-mode 'text-mode
|
||||
ring-bell-function 'ignore ; silence of the bells!
|
||||
save-interprogram-paste-before-kill nil
|
||||
sentence-end-double-space nil
|
||||
|
@ -120,8 +123,6 @@
|
|||
|
||||
(autoload 'use-package "use-package" "" nil 'macro)
|
||||
(require 'f)
|
||||
(require 'dash)
|
||||
(require 's)
|
||||
(require 'core-vars)
|
||||
(require 'core-defuns)
|
||||
(unless (require 'autoloads nil t)
|
||||
|
|
|
@ -35,7 +35,7 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
|||
|
||||
;; Buffer Life and Death ;;;;;;;;;;;;;;;
|
||||
|
||||
(unless (display-graphic-p)
|
||||
(unless window-system
|
||||
(defalias 'wg-workgroup-associated-buffers 'ignore)
|
||||
(defalias 'wg-current-workgroup 'ignore)
|
||||
(defalias 'wg-save-session 'ignore))
|
||||
|
|
|
@ -53,16 +53,16 @@ elisp buffer). Otherwise forward the region to Quickrun."
|
|||
(lines (length (s-lines out))))
|
||||
(if (< lines 5)
|
||||
(princ out t)
|
||||
(with-current-buffer (get-buffer-create "*eval*")
|
||||
;; (rename-buffer (buffer-name old-buf))
|
||||
(read-only-mode -1)
|
||||
(setq-local scroll-margin 0)
|
||||
(emacs-lisp-mode)
|
||||
(erase-buffer)
|
||||
(insert out)
|
||||
(read-only-mode 1)
|
||||
(goto-char (point-min))
|
||||
(doom/popup-buffer (current-buffer))))))
|
||||
(let ((buf (get-buffer-create "*eval*")))
|
||||
(with-current-buffer buf
|
||||
(read-only-mode -1)
|
||||
(setq-local scroll-margin 0)
|
||||
(emacs-lisp-mode)
|
||||
(erase-buffer)
|
||||
(insert out)
|
||||
(read-only-mode 1)
|
||||
(goto-char (point-min)))
|
||||
(pop-to-buffer buf)))))
|
||||
(t (quickrun-region beg end))))
|
||||
|
||||
;;;###autoload (autoload 'doom:eval-region-and-replace "defuns-quickrun" nil t)
|
||||
|
|
|
@ -54,24 +54,22 @@ already there, move it to the true bol."
|
|||
possible, or just one char if that's not possible."
|
||||
(interactive)
|
||||
(let* ((context (sp--get-pair-list-context 'navigate))
|
||||
(open-pair (sp--get-opening-regexp context))
|
||||
(close-pair (sp--get-closing-regexp context))
|
||||
(open-pair-re (sp--get-opening-regexp context))
|
||||
(close-pair-re (sp--get-closing-regexp context))
|
||||
open-len close-len)
|
||||
(cond ;; When in strings (sp acts weird with quotes; this is the fix)
|
||||
;; Also, skip closing delimiters
|
||||
((and (and (sp--looking-back open-pair)
|
||||
((and (and (sp--looking-back open-pair-re)
|
||||
(setq open-len (- (match-beginning 0) (match-end 0))))
|
||||
(and (looking-at close-pair)
|
||||
(setq close-len (- (match-beginning 0) (match-end 0)))))
|
||||
(and (looking-at close-pair-re)
|
||||
(setq close-len (- (match-beginning 0) (match-end 0))))
|
||||
(string= (plist-get (sp-get-thing t) :op)
|
||||
(plist-get (sp-get-thing) :cl)))
|
||||
(delete-backward-char open-len)
|
||||
(delete-char close-len))
|
||||
;; If using tabs (or at bol), just delete normally
|
||||
((or indent-tabs-mode
|
||||
(= (point-at-bol) (point)))
|
||||
(call-interactively 'backward-delete-char-untabify))
|
||||
;; Delete up to the nearest tab column IF only whitespace between
|
||||
;; point and bol.
|
||||
((sp--looking-back-p "^[\\t ]*" (point-at-bol))
|
||||
((sp--looking-back-p "^[\\t ]*" (line-beginning-position))
|
||||
(let ((movement (% (current-column) tab-width))
|
||||
(p (point)))
|
||||
(when (= movement 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue