Refactor core-editor

This commit is contained in:
Henrik Lissner 2017-07-26 18:49:08 +02:00
parent 4c1f42de81
commit dd947b5eae
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -150,7 +150,7 @@ with functions that require it (like modeline segments)."
;; Keep track of recently opened files ;; Keep track of recently opened files
(def-package! recentf (def-package! recentf
:defer 1 :init (add-hook 'doom-init-hook #'recentf-mode)
:config :config
(setq recentf-save-file (concat doom-cache-dir "recentf") (setq recentf-save-file (concat doom-cache-dir "recentf")
recentf-max-menu-items 0 recentf-max-menu-items 0
@ -162,8 +162,7 @@ with functions that require it (like modeline segments)."
;; ignore private DOOM temp files (but not all of them) ;; ignore private DOOM temp files (but not all of them)
(concat "^" (replace-regexp-in-string (concat "^" (replace-regexp-in-string
(concat "@" (regexp-quote (system-name))) (concat "@" (regexp-quote (system-name)))
"@" (abbreviate-file-name doom-host-dir))))) "@" (abbreviate-file-name doom-host-dir))))))
(quiet! (recentf-mode 1)))
;; ;;
@ -174,6 +173,7 @@ with functions that require it (like modeline segments)."
;; specify their own formatting rules. ;; specify their own formatting rules.
(def-package! editorconfig (def-package! editorconfig
:demand t :demand t
:mode ("\\.?editorconfig$" . editorconfig-conf-mode)
:init :init
(def-setting! :editorconfig (action value) (def-setting! :editorconfig (action value)
":add or :remove an entry in `editorconfig-indentation-alist'." ":add or :remove an entry in `editorconfig-indentation-alist'."
@ -201,25 +201,22 @@ with functions that require it (like modeline segments)."
(whitespace-mode +1)))) (whitespace-mode +1))))
(add-hook 'editorconfig-custom-hooks #'doom|editorconfig-whitespace-mode-maybe)) (add-hook 'editorconfig-custom-hooks #'doom|editorconfig-whitespace-mode-maybe))
(def-package! editorconfig-conf-mode
:mode "\\.?editorconfig$")
;; Auto-close delimiters and blocks as you type ;; Auto-close delimiters and blocks as you type
(def-package! smartparens (def-package! smartparens
:demand t :demand t
:init :config
(setq sp-autowrap-region nil ; let evil-surround handle this (setq sp-autowrap-region nil ; let evil-surround handle this
sp-highlight-pair-overlay nil sp-highlight-pair-overlay nil
sp-cancel-autoskip-on-backward-movement nil sp-cancel-autoskip-on-backward-movement nil
sp-show-pair-delay 0 sp-show-pair-delay 0
sp-max-pair-length 3) sp-max-pair-length 3)
:config
(add-hook 'doom-init-hook #'smartparens-global-mode) (add-hook 'doom-init-hook #'smartparens-global-mode)
(require 'smartparens-config) (require 'smartparens-config)
;; Smartparens interferes with Replace mode ;; Smartparens interferes with Replace mode
(add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode) (add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode)
(add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode) (add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode)
;; Auto-close more conservatively ;; Auto-close more conservatively
(let ((unless-list '(sp-point-before-word-p (let ((unless-list '(sp-point-before-word-p
sp-point-after-word-p sp-point-after-word-p