2022-12-14 15:52:44 -08:00
|
|
|
;; Spacemacs itself
|
|
|
|
(exec-path-from-shell-initialize)
|
2023-01-11 11:59:10 -08:00
|
|
|
(spacemacs/enable-transparency)
|
2022-12-07 20:04:44 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
; Needed for emacs --daemon to read fonts
|
|
|
|
; Sometimes doesn't work
|
|
|
|
(spacemacs|do-after-display-system-init (spacemacs/set-default-font dotspacemacs-default-font))
|
2022-12-14 15:52:44 -08:00
|
|
|
|
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
;; whitespace mode
|
|
|
|
(spacemacs/toggle-whitespace-globally-on)
|
2022-12-14 15:52:44 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
(defun custom/common-program-hook ()
|
|
|
|
(setq whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark lines-tail))
|
|
|
|
(interactive)
|
|
|
|
(whitespace-mode t)
|
|
|
|
(setq whitespace-line-column 80)
|
|
|
|
(display-fill-column-indicator-mode)
|
|
|
|
(smart-tabs-mode-enable)
|
|
|
|
)
|
|
|
|
(defun custom/common-richtext-hook ()
|
|
|
|
(setq whitespace-style '(face spaces tabs newline trailing space-mark tab-mark newline-mark))
|
|
|
|
(interactive)
|
|
|
|
(whitespace-mode t)
|
|
|
|
(setq whitespace-line-column 'nil)
|
|
|
|
)
|
|
|
|
(defun custom/latex-hook ()
|
|
|
|
(custom/common-program-hook)
|
|
|
|
)
|
2022-12-14 15:52:44 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
(add-hook 'text-mode-hook 'custom/common-richtext-hook)
|
|
|
|
(add-hook 'latex-mode-hook 'custom/latex-hook)
|
|
|
|
(add-hook 'prog-mode-hook 'custom/common-program-hook)
|
2022-12-14 15:52:44 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
(setq whitespace-display-mappings
|
|
|
|
;; all numbers are Unicode codepoint in decimal. ⁖ (insert-char 182 1)
|
|
|
|
'(
|
|
|
|
(space-mark 32 [183] [46]) ; 32 SPACE 「 」, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」
|
|
|
|
(newline-mark 10 [172 10]) ; 10 LINE FEED, 172 Not Sign「¬」
|
|
|
|
(tab-mark 9 [10141 9] [92 9]) ; 9 TAB, 10141 Triangle-headed rightwards arrow 「➝」
|
|
|
|
))
|
|
|
|
;; Auto save upon defocus
|
|
|
|
(add-hook 'focus-out-hook
|
|
|
|
(defun save-current-buffer-if-needed ()
|
|
|
|
(interactive)
|
|
|
|
(when (and (buffer-file-name) (buffer-modified-p))
|
|
|
|
(save-buffer))))
|
2022-12-14 15:52:44 -08:00
|
|
|
|
|
|
|
;; Mixed indent mode (in conjunction with smart-tabs-mode)
|
2022-12-07 20:04:44 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
(setq-default indent-tabs-mode t
|
|
|
|
indent-line-function 'tab-to-tab-stop
|
|
|
|
tab-width 2)
|
2022-12-07 20:04:44 -08:00
|
|
|
(setq css-indent-offset 2)
|
|
|
|
(smart-tabs-insinuate
|
|
|
|
'c
|
|
|
|
'c++
|
|
|
|
'java
|
|
|
|
'javascript)
|
|
|
|
(add-hook 'after-init-hook #'company-statistics-mode)
|
|
|
|
|
2022-12-14 15:52:44 -08:00
|
|
|
;; C/C++
|
|
|
|
(setq
|
2023-01-16 17:21:19 -08:00
|
|
|
c-default-style "stroustrup"
|
|
|
|
c-basic-offset 2
|
2022-12-14 15:52:44 -08:00
|
|
|
lsp-clients-clangd-args
|
|
|
|
'("-j=4"
|
2023-01-16 17:21:19 -08:00
|
|
|
"--clang-tidy"
|
|
|
|
"--header-insertion=never"
|
|
|
|
"--pch-storage=memory"
|
|
|
|
))
|
2022-12-07 20:04:44 -08:00
|
|
|
(highlight-doxygen-global-mode 1)
|
2023-01-13 21:09:39 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
;; Org mode
|
|
|
|
(setq org-format-latex-options (plist-put org-format-latex-options :scale 2.0))
|
2023-01-13 21:09:39 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
;; Spellchecking
|
|
|
|
(setq ispell-dictionary "english")
|
2023-01-13 21:09:39 -08:00
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
;; Centaur
|
|
|
|
(setq
|
|
|
|
centaur-tabs-set-icons t
|
|
|
|
centaur-tabs-set-bar 'over
|
|
|
|
centaur-tabs-set-close-button t
|
|
|
|
centaur-tabs-style "wave"
|
|
|
|
centaur-tabs-set-bar 'under
|
|
|
|
centaur-tabs-set-modified-marker t
|
|
|
|
centaur-tabs-modified-marker "*"
|
|
|
|
centaur-tabs-cycle-scope 'tabs)
|
|
|
|
(setq
|
|
|
|
pdf-sync-backward-display-action t
|
|
|
|
pdf-sync-forward-display-action t)
|
2023-01-13 21:09:39 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-16 17:21:19 -08:00
|
|
|
;; Ensures the pdf view mode doesn't get into emacs state.
|
|
|
|
;; If it does get into emacs state, checked by
|
|
|
|
;; (describe-variable 'evil-state)
|
|
|
|
;; Use M-x evil-normal-state or M-x evil-force-evilified-state to revert.
|
|
|
|
(evil-set-initial-state 'pdf-view-mode 'evilified)
|
2023-01-13 21:09:39 -08:00
|
|
|
|
|
|
|
|
2022-12-07 20:04:44 -08:00
|
|
|
|