General refactor + cleanup
This commit is contained in:
parent
3e769dc43f
commit
4eb2a7cb41
3 changed files with 24 additions and 22 deletions
|
@ -11,6 +11,7 @@ modes are active and the buffer is read-only.")
|
|||
"Major modes that `doom|check-large-file' will ignore.")
|
||||
|
||||
(setq-default
|
||||
vc-follow-symlinks t
|
||||
;; Save clipboard contents into kill-ring before replacing them
|
||||
save-interprogram-paste-before-kill t
|
||||
;; Bookmarks
|
||||
|
@ -32,7 +33,7 @@ modes are active and the buffer is read-only.")
|
|||
require-final-newline t
|
||||
tab-always-indent t
|
||||
tab-width 4
|
||||
tabify-regexp "^\t* [ \t]+" ; for :retab
|
||||
tabify-regexp "^\t* [ \t]+" ; for :retab
|
||||
;; Wrapping
|
||||
truncate-lines t
|
||||
truncate-partial-width-windows 50
|
||||
|
@ -43,21 +44,16 @@ modes are active and the buffer is read-only.")
|
|||
trailing lines-tail)
|
||||
whitespace-display-mappings
|
||||
'((tab-mark ?\t [?› ?\t])
|
||||
(newline-mark 10 [36 10])
|
||||
(space-mark 32 [183] [46]))
|
||||
;; undo-tree
|
||||
undo-tree-auto-save-history t
|
||||
undo-tree-history-directory-alist (list (cons "." (concat doom-cache-dir "undo-tree-hist/")))
|
||||
visual-fill-column-center-text nil
|
||||
vc-follow-symlinks t)
|
||||
(newline-mark ?\n [?¬ ?\n])
|
||||
(space-mark ?\ [?·] [?.])))
|
||||
|
||||
;; ediff: use existing frame instead of creating a new one
|
||||
(defun doom|init-ediff ()
|
||||
(defun doom|ediff-use-existing-frame ()
|
||||
"Use existing frame instead of creating a new one."
|
||||
(setq ediff-diff-options "-w"
|
||||
ediff-split-window-function #'split-window-horizontally
|
||||
;; no extra frames
|
||||
ediff-window-setup-function #'ediff-setup-windows-plain))
|
||||
(add-hook 'ediff-load-hook #'doom|init-ediff)
|
||||
(add-hook 'ediff-load-hook #'doom|ediff-use-existing-frame)
|
||||
|
||||
(defun doom|dont-kill-scratch-buffer ()
|
||||
"Don't kill the scratch buffer."
|
||||
|
@ -188,8 +184,11 @@ fundamental-mode) for performance sake."
|
|||
(add-hook 'evil-replace-state-entry-hook #'turn-off-smartparens-mode)
|
||||
(add-hook 'evil-replace-state-exit-hook #'turn-on-smartparens-mode)
|
||||
;; Auto-close more conservatively
|
||||
(sp-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p))
|
||||
(sp-pair "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p))
|
||||
(let ((unless-list '(sp-point-before-word-p
|
||||
sp-point-after-word-p
|
||||
sp-point-before-same-p)))
|
||||
(sp-pair "'" nil :unless unless-list)
|
||||
(sp-pair "\"" nil :unless unless-list))
|
||||
(sp-pair "{" nil :post-handlers '(("||\n[i]" "RET") ("| " " "))
|
||||
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
||||
(sp-pair "(" nil :post-handlers '(("||\n[i]" "RET") ("| " " "))
|
||||
|
@ -197,21 +196,24 @@ fundamental-mode) for performance sake."
|
|||
(sp-pair "[" nil :post-handlers '(("| " " "))
|
||||
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
||||
|
||||
(sp-local-pair
|
||||
'css-mode "/*" "*/" :post-handlers '(("[d-3]||\n[i]" "RET") ("| " "SPC")))
|
||||
(sp-local-pair 'css-mode "/*" "*/"
|
||||
:post-handlers '(("[d-3]||\n[i]" "RET") ("| " "SPC")))
|
||||
(sp-local-pair '(sh-mode markdown-mode) "`" nil
|
||||
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
||||
(sp-local-pair '(xml-mode nxml-mode php-mode)
|
||||
"<!--" "-->" :post-handlers '(("| " "SPC"))))
|
||||
:unless '(sp-point-before-word-p sp-point-before-same-p))
|
||||
(sp-local-pair '(xml-mode nxml-mode php-mode) "<!--" "-->"
|
||||
:post-handlers '(("| " "SPC"))))
|
||||
|
||||
;; Branching & persistent undo
|
||||
(def-package! undo-tree
|
||||
:demand t
|
||||
:config
|
||||
(defun doom*silent-undo-tree-load (orig-fn &rest args)
|
||||
(setq undo-tree-auto-save-history t
|
||||
undo-tree-history-directory-alist
|
||||
(list (cons "." (concat doom-cache-dir "undo-tree-hist/"))))
|
||||
(defun doom*silence-undo-tree-load (orig-fn &rest args)
|
||||
"Silence undo-tree load errors."
|
||||
(quiet! (apply orig-fn args)))
|
||||
(advice-add #'undo-tree-load-history-hook :around #'doom*silent-undo-tree-load))
|
||||
(advice-add #'undo-tree-load-history-hook :around #'doom*silence-undo-tree-load))
|
||||
|
||||
|
||||
;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue