Created
April 30, 2016 05:03
-
-
Save walsvid/99d6a6699421f766bf82a564dcd80cd8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; use en_US.UTF-8 for git | |
(add-hook 'magit-mode-hook | |
(lambda () | |
(defadvice magit-start-process (around lang-en_US activate) | |
(let ((process-environment process-environment)) | |
(setenv "LC_ALL" "en_US.UTF-8") | |
ad-do-it)) | |
(defadvice magit-call-process (around lang-en_US activate) | |
"Set LANG to en_US." | |
(let ((process-environment process-environment)) | |
(setenv "LC_ALL" "en_US.UTF-8") | |
ad-do-it)))) | |
;; encoding | |
(prefer-coding-system 'chinese-gbk) | |
(prefer-coding-system 'utf-8) | |
;; undo-tree | |
(setq undo-tree-auto-save-history t | |
undo-tree-history-directory-alist | |
`(("." . ,(concat user-home-directory ".undo")))) | |
(setq company-idle-delay 0.5) | |
(setq flycheck-check-syntax-automatically '(mode-enabled save)) | |
;; aspell | |
(setq flyspell-default-dictionary "english") | |
(setq ispell-program-name "/usr/local/bin/aspell") | |
;; org | |
(with-eval-after-load 'org | |
(spacemacs/set-leader-keys-for-major-mode 'org-mode | |
"v" 'org-toggle-latex-fragment)) | |
;; c++ | |
;; xcode-select --install | |
;; xcode-select -switch /Library/Developer/CommandLineTools | |
(with-eval-after-load 'c++ | |
(spacemacs/set-leader-keys-for-major-mode 'c++-mode | |
"o=" 'clang-format-region)) | |
(add-hook 'c++-mode-hook | |
(lambda () | |
;; quick compilation | |
(set (make-local-variable 'compile-command) | |
(concat "g++ -std=c++11 -Wall " buffer-file-name " && ./a.out")) | |
;; (push 'company-semantic company-backends) | |
(setq company-clang-arguments '("-std=c++11")) | |
(setq flycheck-clang-language-standard "c++11") | |
(add-to-list 'company-c-headers-path-system | |
"/Library/Developer/CommandLineTools/usr/include/c++/v1") | |
)) | |
;; latex | |
(add-hook 'LaTeX-mode-hook | |
(lambda () | |
(setq TeX-source-correlate-mode t | |
TeX-source-correlate-method 'synctex) | |
(set-default 'preview-scale-function 1.1) | |
(add-to-list 'TeX-view-program-list | |
'("Skim" "/Applications/Skim.app/Contents/SharedSupport/displayline -b -g %n %o %b")) | |
(setq TeX-view-program-selection '((output-pdf "Skim"))) | |
)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment