forked from magnars/.emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.el
154 lines (137 loc) · 5.57 KB
/
custom.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
(quote
("88ae008e9bf586a903dfb4e7ca6d9c06f6b1f8ce10d2ae89295a4114a6f2c3f3" "9527feeeec43970b1d725bdc04e97eb2b03b15be982ac50089ad223d3c6f2920" default)))
'(flycheck-display-errors-function (function flycheck-pos-tip-error-messages))
'(ido-use-filename-at-point nil)
'(package-selected-packages
(quote
(material-theme protobuf-mode auctex tide all-the-icons doom-themes elixir-yasnippets Yasnippet go-complete go-mode go js-doc slime jade wgrep-ag wgrep wgrep-ack ruby-end ag youdao-dictionary multiple-cursor ace-window corral web-mode org-bullets edts erlang-mode alchemist elixir-mode auto-complete js2-refactor debbugs js2-mode yesql-ghosts yasnippet whitespace-cleanup-mode visual-regexp string-edit smartparens simple-httpd restclient prodigy paredit nodejs-repl move-text markdown-mode magit inflections ido-vertical-mode ido-at-point hydra htmlize highlight-escape-sequences guide-key groovy-mode gist flycheck-pos-tip flycheck-clojure flx-ido fill-column-indicator exec-path-from-shell elisp-slime-nav edn dockerfile-mode dired-details css-eldoc clojure-mode-extra-font-locking)))
'(safe-local-variable-values
(quote
((eval font-lock-add-keywords nil
(quote
(("defexamples\\|def-example-group\\| => "
(0
(quote font-lock-keyword-face)))
("(defexamples[[:blank:]]+\\(.*\\)"
(1
(quote font-lock-function-name-face))))))
(eval font-lock-add-keywords nil
(quote
(("defexamples\\|def-example-group\\| => "
(0
(quote font-lock-keyword-face))))))
(eval when
(and
(buffer-file-name)
(file-regular-p
(buffer-file-name))
(string-match-p "^[^.]"
(buffer-file-name)))
(emacs-lisp-mode))
(eval font-lock-add-keywords nil
(quote
(("defexamples\\| => "
(0
(quote font-lock-keyword-face))))))
(encoding . utf-8)))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(js2-error-face ((t nil)) t)
'(js2-warning-face ((t nil)) t))
(add-to-list 'auto-mode-alist '("\\.jsx?\\'" . web-mode))
;;configuration for web-mode
(setq web-mode-content-types-alist
'(("jsx" . "\\.jsx?\\'")))
(setq web-mode-code-indent-offset 2)
;;font config
(add-to-list 'initial-frame-alist '(font . "Inconsolata-14" ))
(add-to-list 'default-frame-alist '(font . "Inconsolata-14" ))
;; (set-face-attribute 'default t :font "Inconsolata-12" )
;; set up org mode bullets
(require 'org-bullets)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
(setq auto-save-default nil)
;; set ace-window select keys
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
;; corral
(setq corral-preserve-point t)
;; youdao
(setq url-automatic-caching t)
(global-set-key (kbd "C-c y") 'youdao-dictionary-search-at-point)
;;elixir
;;(eval-after-load 'alchemist-mode '(require 'elixir-mode))
(require 'ag)
;; (require 'wgrep)
;; (autoload 'wgrep-ag-setup "wgrep-ag")
;; (add-hook 'ag-mode-hook 'wgrep-ag-setup)
(require 'elixir-mode)
(require 'alchemist)
(add-hook 'alchemist-mode-hook 'company-mode)
(add-to-list 'elixir-mode-hook
(defun auto-activate-ruby-end-mode-for-elixir-mode ()
(set (make-variable-buffer-local 'ruby-end-expand-keywords-before-re)
"\\(?:^\\|\\s-+\\)\\(?:do\\)")
(set (make-variable-buffer-local 'ruby-end-check-statement-modifiers) nil)
(ruby-end-mode +1)))
;;for golang
(require 'go-mode-autoloads)
(add-hook 'web-mode-hook 'electric-pair-local-mode)
;; jade
;;(add-hook 'js2-mode-hook #'jade-interaction-mode)
;; active Babel languages
;; (require 'ob-clojure)
;; (setq org-babel-clojure-backend 'cider)
;; (org-babel-do-load-languages
;; 'org-babel-load-languages
;; '((R . t)
;; (emacs-lisp . t)
;; (clojure . t)
;; ))
;; js-doc
(require 'js-doc)
;;doom themes
;; (load-theme 'doom-one t) ;; or doom-dark, etc.
;;; OPTIONAL
;; brighter source buffers
;; (add-hook 'find-file-hook 'doom-buffer-mode)
;; brighter minibuffer when active
;; (add-hook 'minibuffer-setup-hook 'doom-buffer-mode)
;;Typescript for angular
(defun setup-tide-mode ()
(interactive)
(tide-setup)
(flycheck-mode +1)
(setq flycheck-check-syntax-automatically '(save mode-enabled))
(eldoc-mode +1)
;; company is an optional dependency. You have to
;; install it separately via package-install
;; `M-x package-install [ret] company`
(company-mode +1))
;; aligns annotation to the right hand side
(setq company-tooltip-align-annotations t)
;; formats the buffer before saving
(add-hook 'before-save-hook 'tide-format-before-save)
(add-hook 'typescript-mode-hook #'setup-tide-mode)
;; format options
(setq tide-format-options '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil))
;; protobuf
(require 'protobuf-mode)
(defconst my-protobuf-style
'((c-basic-offset . 2)
(indent-tabs-mode . nil)))
(add-hook 'protobuf-mode-hook
(lambda () (c-add-style "my-style" my-protobuf-style t)))
;; AUCTeX
(load "auctex.el" nil t t)
;; dired-x
(require 'dired-x)
(load-theme 'material t)