.emacs 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. ;;; Commentary:
  2. ;;; Sets up major minor modes for Emacs
  3. ;;; Code:
  4. (require 'package)
  5. (setq use-package-always-ensure t)
  6. (add-to-list 'package-archives
  7. '("melpa-stable" . "http://stable.melpa.org/packages/") t)
  8. (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
  9. (package-initialize)
  10. ;; TODO: install issues (pdf-tools-install)
  11. (setq-default indent-tabs-mode nil)
  12. (scroll-bar-mode -1)
  13. (use-package evil
  14. :diminish undo-tree-mode
  15. :config (evil-mode 1)
  16. :bind (:map evil-normal-state-map
  17. ("l" . evil-search-next)))
  18. (use-package evil-surround
  19. :config (global-evil-surround-mode 1))
  20. (use-package evil-org)
  21. (use-package evil-dvorak
  22. :config (global-evil-dvorak-mode 1)
  23. :diminish evil-dvorak-mode)
  24. (use-package god-mode)
  25. (use-package evil-god-state
  26. :bind (:map evil-normal-state-map
  27. ("," . evil-execute-in-god-state)
  28. :map evil-god-state-map
  29. ("ESC" . evil-god-state-bail)))
  30. (use-package magit
  31. :bind (:map evil-normal-state-map ("C-c C-s" . magit-status)))
  32. (use-package evil-magit)
  33. (use-package flx-ido
  34. :init
  35. (setq ido-enable-flex-matching t)
  36. (setq ido-use-faces nil)
  37. :config
  38. (ido-mode 1)
  39. (ido-everywhere 1)
  40. (flx-ido-mode 1))
  41. (use-package helm
  42. :bind ("M-x" . helm-M-x))
  43. (use-package projectile
  44. :config
  45. (projectile-global-mode 1)
  46. (use-package persp-projectile
  47. :config (persp-mode))
  48. :diminish projectile-mode)
  49. ;; not sure if persp-switch is covered by projectile
  50. ;(define-key projectile-mode-map (kbd "s-s") 'projectile-persp-switch-project)
  51. (use-package ace-jump-mode
  52. :bind (:map evil-normal-state-map
  53. ("f" . ace-jump-mode)))
  54. (use-package flycheck
  55. :init (add-hook 'js-mode-hook (lambda () (flycheck-mode t))))
  56. (use-package flyspell)
  57. ;;; C/C++
  58. (use-package cmake-ide
  59. :init (use-package rtags)
  60. :config (cmake-ide-setup))
  61. ;; Git settings
  62. (use-package git-gutter+
  63. :config (global-git-gutter+-mode))
  64. (use-package rainbow-delimiters
  65. :init
  66. (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
  67. (add-hook 'geiser-repl-mode-hook 'rainbow-delimiters-mode)
  68. (add-hook 'cider-repl-mode-hook 'rainbow-delimiters-mode))
  69. (use-package yasnippet :config (yas-global-mode 1))
  70. (load-file (concat default-directory "Dev/emacs/evil-paredit/evil-paredit.el"))
  71. (use-package paredit
  72. ;(autoload 'enable-paredit-mode "paredit" "Turn on pseudo-structural editing of Lisp code." t)
  73. :init
  74. (add-hook 'emacs-lisp-mode-hook #'enable-paredit-mode)
  75. (add-hook 'eval-expression-minibuffer-setup-hook #'enable-paredit-mode)
  76. (add-hook 'ielm-mode-hook #'enable-paredit-mode)
  77. (add-hook 'lisp-mode-hook #'enable-paredit-mode)
  78. (add-hook 'lisp-interaction-mode-hook #'enable-paredit-mode)
  79. (add-hook 'scheme-mode-hook #'enable-paredit-mode)
  80. (add-hook 'emacs-lisp-mode-hook 'evil-paredit-mode)
  81. (add-hook 'scheme-mode-hook 'evil-paredit-mode))
  82. ;;; GUIX
  83. (let ((dir (concat default-directory "Dev/guix/guix/emacs")))
  84. (add-to-list 'load-path dir)
  85. (setq guix-load-path dir))
  86. (require 'guix-autoloads nil t)
  87. ;; PY
  88. (use-package company-jedi
  89. :init
  90. (add-hook 'python-mode-hook
  91. (lambda ()
  92. (add-to-list 'company-backends 'company-jedi))))
  93. ;;; ANDROID
  94. (use-package android-mode
  95. :init
  96. (setq android-mode-sdk-dir
  97. (concat default-directory ".buildozer/android/platform/android-sdk-21"))
  98. (setq android-mode-builder 'gradle)
  99. (setq android-mode-root-file-plist
  100. (quote
  101. (ant "AndroidManifest.xml" gradle "gradlew" maven "AndroidManifest.xml")))
  102. :config
  103. (add-hook 'gud-mode-hook
  104. (lambda ()
  105. (add-to-list
  106. 'gud-jdb-classpath
  107. (concat default-directory
  108. ".buildozer/android/platform/android-sdk-21/platforms/android-19/android.jar")))))
  109. ;;; php
  110. (use-package php-mode)
  111. (use-package phpcbf
  112. :config (add-hook 'php-mode-hook 'phpcbf-enable-on-save)
  113. (custom-set-variables
  114. '(phpcbf-executable (concat default-directory ".composer/vendor/bin/phpcbf"))))
  115. (use-package multiple-cursors
  116. :bind
  117. ("C->" . mc/mark-next-like-this)
  118. ("C-<" . mc/mark-previous-like-this)
  119. ("C-c C-<" . mc/mark-all-like-this))
  120. (use-package tagedit
  121. :bind (:map html-mode-map
  122. ("C-<right>" . tagedit-forward-slurp-tag)
  123. ("C-<left>" . tagedit-forward-barf-tag)
  124. ("M-r" . tagedit-raise-tag)
  125. ("M-s" . tagedit-splice-tag)
  126. ("M-J" . tagedit-join-tags)
  127. ("M-S" . tagedit-split-tag)
  128. ("M-?" . tagedit-convolute-tags)
  129. ("C-k" . tagedit-kill)
  130. ("s-k" . tagedit-kill-attribute))
  131. :config (tagedit-add-experimental-features))
  132. (use-package clojure-mode
  133. :init
  134. (add-hook 'clojure-mode-hook 'paredit-mode)
  135. (add-hook 'clojure-repl-mode-hook 'paredit-mode))
  136. ;;; TODO: resolve colliding bindings w/ geiser
  137. (use-package cider
  138. :init
  139. (add-hook 'clojure-mode-hook 'evil-paredit-mode)
  140. (add-hook 'clojure-repl-mode-hook 'evil-paredit-mode)
  141. :bind (:map evil-normal-state-map
  142. ("M-." . cider-find-var)
  143. ("M-," . cider-pop-back)
  144. ("M-e" . cider-eval-defun-at-point)
  145. ("M-b" . cider-eval-buffer)))
  146. (use-package clj-refactor
  147. :config
  148. (add-hook 'clojure-mode-hook 'clj-refactor-mode)
  149. (cljr-add-keybindings-with-prefix "C-c C-r"))
  150. (use-package flycheck-pos-tip
  151. :no-require t
  152. :config
  153. (setq flycheck-display-errors-function #'flycheck-pos-tip-error-messages))
  154. (use-package geiser
  155. :no-require t
  156. :init (add-hook 'geiser-repl-mode-hook 'evil-paredit-mode)
  157. :bind (:map evil-normal-state-map
  158. ("M-." . geiser-edit-symbol-at-point)
  159. ("M-," . geiser-pop-symbol-stack)))
  160. (add-hook 'after-init-hook 'global-company-mode)
  161. (autoload 'octave-mode "octave-mod" nil t)
  162. (setq auto-mode-alist
  163. (cons '("\\.m$" . octave-mode) auto-mode-alist))
  164. (autoload 'run-octave "octave-inf" nil t)
  165. (add-hook 'octave-mode-hook
  166. (lambda ()
  167. (abbrev-mode 1)
  168. (auto-fill-mode 1)
  169. (if (eq window-system 'x)
  170. (font-lock-mode 1))))
  171. (use-package tex
  172. :ensure auctex
  173. :init
  174. (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
  175. (add-hook 'LaTeX-mode-hook 'visual-line-mode)
  176. (add-hook 'LaTeX-mode-hook 'flyspell-mode)
  177. (add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
  178. (setq TeX-auto-save t)
  179. (setq TeX-parse-self t)
  180. (setq-default TeX-master nil))
  181. (defun maybe-linux-style ()
  182. "Set c-style to linux format."
  183. (when (and buffer-file-name
  184. (string-match "linux" buffer-file-name))
  185. (c-set-style "Linux")))
  186. ;; Edit sudo files
  187. (defadvice ido-find-file (after find-file-sudo activate)
  188. (unless (and buffer-file-name
  189. (file-writable-p buffer-file-name))
  190. (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
  191. ;; Create backup files in .emacs-backup instead of everywhere
  192. (defvar user-temporary-file-directory "~/.emacs-backup")
  193. (make-directory user-temporary-file-directory t)
  194. (setq backup-by-copying t)
  195. (setq backup-directory-alist
  196. `(("." . ,user-temporary-file-directory)
  197. (,tramp-file-name-regexp nil)))
  198. (setq auto-save-list-file-prefix
  199. (concat user-temporary-file-directory ".auto-saves-"))
  200. (setq auto-save-file-name-transforms
  201. `((".*" ,user-temporary-file-directory t)))
  202. (custom-set-variables
  203. ;; custom-set-variables was added by Custom.
  204. ;; If you edit it by hand, you could mess it up, so be careful.
  205. ;; Your init file should contain only one such instance.
  206. ;; If there is more than one, they won't work right.
  207. '(TeX-view-program-selection
  208. (quote
  209. (((output-dvi has-no-display-manager)
  210. "dvi2tty")
  211. ((output-dvi style-pstricks)
  212. "dvips and gv")
  213. (output-dvi "xdvi")
  214. (output-pdf "xldf")
  215. (output-html "xdg-open"))))
  216. '(android-mode-sdk-dir "~/.buildozer/android/platform/android-sdk-21")
  217. '(ansi-color-names-vector
  218. ["#0a0814" "#f2241f" "#67b11d" "#b1951d" "#4f97d7" "#a31db1" "#28def0" "#b2b2b2"])
  219. '(ansi-term-color-vector
  220. [unspecified "#151515" "#FF0086" "#00C918" "#ABA800" "#3777E6" "#AD00A1" "#3777E6" "#D0D0D0"] t)
  221. '(cider-default-repl-command "repl")
  222. '(cider-lein-command "lein")
  223. '(cider-lein-parameters "-U with-profile +test repl :headless")
  224. '(compilation-message-face (quote default))
  225. '(cua-global-mark-cursor-color "#2aa198")
  226. '(cua-normal-cursor-color "#657b83")
  227. '(cua-overwrite-cursor-color "#b58900")
  228. '(cua-read-only-cursor-color "#859900")
  229. '(custom-enabled-themes (quote (spacemacs-dark)))
  230. '(custom-safe-themes
  231. (quote
  232. ("c7a9a68bd07e38620a5508fef62ec079d274475c8f92d75ed0c33c45fbe306bc" "076a94693c0f6fa99612121c18ccb48bfbd842c05b6b9ed04b6e7e0a0f95a53e" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "e2e4e109357cfcebccb17961950da6b84f72187ade0920a4494013489df648fe" "75c0b9f9f90d95ac03f8647c75a91ec68437c12ff598e2abb22418cd4b255af0" "bf81a86f9cfa079a7bb9841bc6ecf9a2e8999b85e4ae1a4d0138975921315713" "e24679edfdea016519c0e2d4a5e57157a11f928b7ef4361d00c23a7fe54b8e01" "d43120398682953ef18fd7e11e69c94e44d39bb2ab450c4e64815311542acbff" "cdfb22711f64d0e665f40b2607879fcf2607764b2b70d672ddaa26d2da13049f" "f245c9f24b609b00441a6a336bcc556fe38a6b24bfc0ca4aedd4fe23d858ba31" "a7b47876e5da7cac6f5e61cca7a040a365ca2c498823654bd4076add8edf34c5" "232f715279fc131ed4facf6a517b84d23dca145fcc0e09c5e0f90eb534e1680f" "aed73c6d0afcf2232bb25ed2d872c7a1c4f1bda6759f84afc24de6a1aec93da8" "e8e744a1b0726814ac3ab86ad5ccdf658b9ff1c5a63c4dc23841007874044d4a" "101a10b15bbbd0d5a0e56e4773e614962197886780afb2d62523a63a144ad96c" "e254f8e18ba82e55572c5e18f3ac9c2bd6728a7e500f6cc216e0c6f6f8ea7003" "9e87bddff84cbce28c01fa05eb22f986d770628fa202cd5ca0cd7ed53db2f068" "f2503f0a035c2122984e90eb184185769ee665de5864edc19b339856942d2d2d" "09669536b4a71f409e7e2fd56609cd7f0dff2850d4cbfb43916cc1843c463b80" "76bd62f6ce376bf0597fab7f478eaa98cd94a7b41f0ae46de63a958fbe99c1d9" "b2028956188cf668e27a130c027e7f240c24c705c1517108b98a9645644711d9" "0b6645497e51d80eda1d337d6cabe31814d6c381e69491931a688836c16137ed" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" default)))
  233. '(fci-rule-color "#eee8d5")
  234. '(geiser-arguile-binary "/home/sapientech/Dev/guile/bin/guile")
  235. '(geiser-arguile-init-file "~/.arguile-geiser.scm")
  236. '(geiser-arguile-load-path (quote ("/home/sapientech/Dev/arguile")))
  237. '(geiser-chicken-load-path (quote ("/home/user/Development/ai/aima-chicken/aima.scm")))
  238. '(geiser-guile-binary "/home/sapientech/Dev/guile/bin/guile")
  239. '(geiser-guile-load-path
  240. (quote
  241. ("/home/sapientech/Dev/guile/" "/home/sapientech/Dev/guix/guix/" "/home/sapientech/Dev/guix-packages/" "/home/sapientech/Dev/guile/guile-graph" "/home/sapientech/Dev/web/" "/home/sapientech/Dev/arguile")))
  242. '(highlight-changes-colors (quote ("#d33682" "#6c71c4")))
  243. '(highlight-symbol-colors
  244. (--map
  245. (solarized-color-blend it "#fdf6e3" 0.25)
  246. (quote
  247. ("#b58900" "#2aa198" "#dc322f" "#6c71c4" "#859900" "#cb4b16" "#268bd2"))))
  248. '(highlight-symbol-foreground-color "#586e75")
  249. '(highlight-tail-colors
  250. (quote
  251. (("#eee8d5" . 0)
  252. ("#B4C342" . 20)
  253. ("#69CABF" . 30)
  254. ("#69B7F0" . 50)
  255. ("#DEB542" . 60)
  256. ("#F2804F" . 70)
  257. ("#F771AC" . 85)
  258. ("#eee8d5" . 100))))
  259. '(hl-bg-colors
  260. (quote
  261. ("#DEB542" "#F2804F" "#FF6E64" "#F771AC" "#9EA0E5" "#69B7F0" "#69CABF" "#B4C342")))
  262. '(hl-fg-colors
  263. (quote
  264. ("#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3" "#fdf6e3")))
  265. '(jdee-server-dir "/home/sapientech/Dev/java")
  266. '(magit-diff-use-overlays nil)
  267. '(magit-log-section-arguments (quote ("-n256" "--decorate")))
  268. '(menu-bar-mode nil)
  269. '(nrepl-message-colors
  270. (quote
  271. ("#dc322f" "#cb4b16" "#b58900" "#546E00" "#B4C342" "#00629D" "#2aa198" "#d33682" "#6c71c4")))
  272. '(org-agenda-files nil)
  273. '(package-selected-packages
  274. (quote
  275. (php-mode php yaml-mode elixir-mode elixir-yasnippets flycheck-elixir org-evil company-lua smtpmail-multi monokai-theme clj-refactor evil-god evil-god-mode evil-god-state god-mode cider flycheck-pos-tip tex pesp-projectile js2 latex autex clojure cider-mode js2-refactor web-beautify js2-mode weechat clojure-mode evil-surround evil-mc w3m use-package test-simple tagedit swift-mode spacemacs-theme solarized-theme skewer-mode show-css rtags rainbow-delimiters psysh phpcbf php-scratch php-refactor-mode php-eldoc php-auto-yasnippets persp-projectile pandoc ox-pandoc multiple-cursors markdown-mode magit-annex lua-mode loc-changes load-relative kivy-mode jdee irony-eldoc inf-php helm haskell-mode groovy-mode gradle-mode git-gutter+ geiser flyspell-correct flymake-php flycheck-irony flx-ido evil-paredit evil-org evil-magit evil-dvorak ecb composer company-php company-jedi company-irony company-auctex color-theme-solarized cmake-ide base16-theme android-mode ag ace-jump-mode)))
  276. '(phpcbf-executable (concat default-directory ".composer/vendor/bin/phpcbf"))
  277. '(phpcbf-standard "PSR2")
  278. '(pos-tip-background-color "#eee8d5")
  279. '(pos-tip-foreground-color "#586e75")
  280. '(safe-local-variable-values
  281. (quote
  282. ((eval modify-syntax-entry 43 "'")
  283. (eval modify-syntax-entry 36 "'")
  284. (eval modify-syntax-entry 126 "'")
  285. (bug-reference-bug-regexp . "<https?://\\(debbugs\\|bugs\\)\\.gnu\\.org/\\([0-9]+\\)>"))))
  286. '(send-mail-function (quote smtpmail-send-it))
  287. '(smartrep-mode-line-active-bg (solarized-color-blend "#859900" "#eee8d5" 0.2))
  288. '(smtpmail-smtp-server "smtp.openmailbox.org")
  289. '(smtpmail-smtp-service 465 t)
  290. '(term-default-bg-color "#fdf6e3")
  291. '(term-default-fg-color "#657b83")
  292. '(tool-bar-mode nil)
  293. '(vc-annotate-background nil)
  294. '(vc-annotate-color-map
  295. (quote
  296. ((20 . "#dc322f")
  297. (40 . "#c37300")
  298. (60 . "#b97d00")
  299. (80 . "#b58900")
  300. (100 . "#a18700")
  301. (120 . "#9b8700")
  302. (140 . "#948700")
  303. (160 . "#8d8700")
  304. (180 . "#859900")
  305. (200 . "#5a942c")
  306. (220 . "#439b43")
  307. (240 . "#2da159")
  308. (260 . "#16a870")
  309. (280 . "#2aa198")
  310. (300 . "#009fa7")
  311. (320 . "#0097b7")
  312. (340 . "#008fc7")
  313. (360 . "#268bd2"))))
  314. '(vc-annotate-very-old-color nil)
  315. '(weechat-color-list
  316. (quote
  317. (unspecified "#fdf6e3" "#eee8d5" "#990A1B" "#dc322f" "#546E00" "#859900" "#7B6000" "#b58900" "#00629D" "#268bd2" "#93115C" "#d33682" "#00736F" "#2aa198" "#657b83" "#839496")))
  318. '(xterm-color-names
  319. ["#eee8d5" "#dc322f" "#859900" "#b58900" "#268bd2" "#d33682" "#2aa198" "#073642"])
  320. '(xterm-color-names-bright
  321. ["#fdf6e3" "#cb4b16" "#93a1a1" "#839496" "#657b83" "#6c71c4" "#586e75" "#002b36"]))
  322. ;;; Add these faces to spacemacs-dark + add new faces for light
  323. (custom-set-faces
  324. ;; custom-set-faces was added by Custom.
  325. ;; If you edit it by hand, you could mess it up, so be careful.
  326. ;; Your init file should contain only one such instance.
  327. ;; If there is more than one, they won't work right.
  328. '(default ((t (:family "SourceCodePro" :foundry "urw" :slant normal :weight normal :height 87 :width normal))))
  329. '(rainbow-delimiters-depth-1-face ((t (:foreground "red"))))
  330. '(rainbow-delimiters-depth-2-face ((t (:foreground "dark orange"))))
  331. '(rainbow-delimiters-depth-3-face ((t (:foreground "yellow"))))
  332. '(rainbow-delimiters-depth-4-face ((t (:foreground "lawn green"))))
  333. '(rainbow-delimiters-depth-5-face ((t (:foreground "deep sky blue"))))
  334. '(rainbow-delimiters-depth-6-face ((t (:foreground "orchid"))))
  335. '(rainbow-delimiters-depth-7-face ((t (:foreground "spring green"))))
  336. '(rainbow-delimiters-depth-8-face ((t (:foreground "sienna1")))))
  337. (provide '.emacs)
  338. ;;; .emacs ends here