spacemacs config

my .spacemacs

1 part of my .spacemacs content

1.1 layers

version-control
deft
semantic
(auto-completion :variables
auto-completion-return-key-behavior 'complete
auto-completion-tab-key-behavior 'cycle
auto-completion-complete-with-key-sequence nil
auto-completion-complete-with-key-sequence-delay 0.1
auto-completion-enable-snippets-in-popup t
auto-completion-enable-help-tooltip t
auto-completion-enable-sort-by-usage t
)
(spell-checking :variables
spell-checking-enable-by-default nil
)
(syntax-checking :variables
syntax-checking-enable-by-default nil
syntax-checking-enable-tooltips nil
)
(org :variables
org-enable-github-support t
org-download-screenshot-method 'screencapture
)
(git :variables
git-magit-status-fullscreen t
magit-push-always-verify nil
magit-save-repository-buffers 'dontask
magit-revert-buffers 'silent
magit-refs-show-commit-count 'all
magit-revision-show-gravatars nil
)
(latex :variables
;; LaTeX and TeX-engine xetex can work well together, other settings are tricky.
latex-build-command "LaTeX"
latex-enable-auto-fill t
latex-enable-folding t
)
bibtex
shell-scripts
javascript
(colors :variables
;; colors-enable-rainbow-identifiers t
colors-enable-nyan-cat-progress-bar t
)
(shell :variables
shell-default-shell 'multi-term
shell-enable-smart-eshell t
shell-default-term-shell "/bin/zsh"
shell-default-height 30
shell-default-position 'bottom
)

1.2 init

 dotspacemacs-startup-lists '((recents . 3)
(todos . 4)
(agenda . 7)
)

dotspacemacs-default-font '("Sauce Code Powerline"
:size 14
:weight normal
:width normal
:powerline-scale 1.1)

dotspacemacs-line-numbers
'(:relative t
:disabled-for-modes dired-mode
doc-view-mode
markdown-mode
org-mode
pdf-view-mode
:size-limit-kb 1000)

1.3 user-init

;; elisp freeze while parsing emacs files
(setq tramp-ssh-controlmaster-options
"-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")

1.4 user-config

  (setq warning-minimum-level :emergency)
;; key-binding custom here
(define-key global-map [(meta f11)] 'toggle-frame-maximized)
;; helm-yank is much better than other yank/paste
(define-key global-map [(meta y)] 'helm-show-kill-ring)
;; these default bindings are not working correctly, use hook here to fix
(add-hook 'term-mode-hook
(lambda ()
(add-to-list 'term-bind-key-alist '("M-[" . multi-term-prev))
(add-to-list 'term-bind-key-alist '("M-]" . multi-term-next))))
;; default settings
;; transparency on startup 85-->active, 50-->inactive
(set-frame-parameter (selected-frame) 'alpha '(85 . 50))
;; latex previw doc, will auto update pdf
;; (add-hook 'doc-view-mode-hook 'auto-revert-mode)
;; search engine
;; (setq browse-url-browser-function 'browse-url-generic
;; engine/browser-function 'browse-url-generic
;; browse-url-generic-program "google-chrome")
;; chrome
(setq edit-server-url-major-mode-alist
'(("github\\.com" . org-mode)))
;; (add-hook 'edit-server-done-hook (lambda () (shell-command "open -a \"Google Chrome\"")))
;; read-aloud
(setq read-aloud-engine "say")
(define-key global-map [(f6)] 'read-aloud-this)
;; deft
(setq deft-directory "~/alpha/deft")
(setq deft-extensions '("org" "md"))
(setq deft-auto-save-interval 2.5)
;; solve the freeze problem when editing elisp files
(eval-after-load 'semantic
(add-hook 'semantic-mode-hook
(lambda ()
(dolist (x (default-value 'completion-at-point-functions))
(when (string-prefix-p "semantic-" (symbol-name x))
(remove-hook 'completion-at-point-functions x))))))
;; org fontification error
(setq org-src-fontify-natively nil)
;; here goes your Org config :)
(with-eval-after-load 'org
;; org path & agenda file
(setq org-directory "~/alpha/deft/"
org-default-notes-file (concat org-directory "/0x10-journal.org")
org-agenda-files (list "~/alpha/deft/0x10-todo.org"
"~/alpha/deft/0x10-graveyard.org"
"~/alpha/deft/0x12-notes.org"))
(setq org-refile-targets (quote ((nil :maxlevel . 4) (org-agenda-files :maxlevel . 5))))
(setq org-refile-use-outline-path (quote file))
(setq org-outline-path-complete-in-steps nil)
;; org bullets
(setq org-bullets-bullet-list '("■" "◆" "▲" "▶"))
;; mode line of org clock
(setq spaceline-org-clock-p t)
;; gscholar-bibtex-database-file
(setq gscholar-bibtex-database-file "~/alpha/deft/references.bib")
;; org-ref
(setq org-ref-bibliography-notes "~/alpha/deft/0x12-notes.org"
org-ref-default-bibliography '("~/alpha/deft/refs.bib")
org-ref-pdf-directory "~/Documents/book/")
(setq org-ref-note-title-format
"** TODO %y - %t
:PROPERTIES:
:Custom_ID: %k
:AUTHOR: %9a
:JOURNAL: %j
:YEAR: %y
:VOLUME: %v
:PAGES: %p
:DOI: %D
:URL: %U
:PDF: [[file:%F][%f]]
:END:
%l
")
;; saving macro
(fset 'sub-add-empty-line
[?y ?y ?P ?f ?D ?v ?e ?d ?i ?S ?a ?u ?r ?c ?e escape ?j ?1 ?1 ?l ?D ?j])
(fset 'org-tab-copy-item
"vt|y")
;; capture i/t/j templates customize
(setq org-capture-templates (quote (
("l" "Link" entry (file "~/alpha/deft/0x09-Links-of-Mook-and-Ted.org")
"* TODO %?\n%U\n")
("d" "Diary" entry (file+headline "~/alpha/deft/0x10-diary.org" "Sands")
"* Enter on %U\n- %? :: ")
("s" "Subscribe" entry (file+headline "~/alpha/deft/0x14-subscribe.org" "Push")
"* Enter on %U %?\n")
("e" "Extracts" entry (file+headline "~/alpha/deft/0x01-extracts.org" "Stars")
"* Extract on %U\n- %?")
("k" "keybings" entry (file+headline "~/alpha/deft/0x03-shortcuts.org" "Drops")
"* Enter on %U\n|%?")
("t" "Todo" entry (file+headline "~/alpha/deft/0x10-todo.org" "Inbox")
"* TODO %?\nSCHEDULED: %T%i\n")
("r" "Running-Logs" entry (file+headline "~/alpha/deft/0x14-running-log.org" "Logs")
"* RUN %?K on %U%i\n")
("j" "Journal" entry (file+datetree "~/alpha/deft/0x10-journal.org")
"* %?\n%U\n %i\n")))))