-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.el
More file actions
118 lines (92 loc) · 3.35 KB
/
init.el
File metadata and controls
118 lines (92 loc) · 3.35 KB
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
; list the packages you want (see: https://stackoverflow.com/a/10093312)
(setq package-list '(paredit nord-theme yaml-mode use-package ido-ubiquitous))
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
(add-to-list 'package-pinned-packages '(cider . "melpa-stable") t)
;; activate all the packages (in particular autoloads)
(package-initialize)
;; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
; install the missing packages
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))
(require 'cl)
(add-to-list 'load-path "~/.emacs.d/lib")
(defun load-my (file)
(load (concat "~/.emacs.d/my/" (symbol-name file))))
;; see https://github.com/purcell/exec-path-from-shell
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
;; global
(load-my 'general)
(load-my 'auto-save)
(load-my 'keys)
(load-my 'hippie-expand)
(load-my 'browse-url)
(load-my 'smooth-scrolling)
(load-my 'printing)
;; modes
(load-my 'magit)
(load-my 'org)
;; ido
(load-my 'ido)
(load-my 'ido-goto-symbol)
;; lisp
(load-my 'paredit)
(load-my 'elisp)
(load-my 'clojure)
(load-my 'cider)
(load-my 'shortcuts)
(load-my 'ssh)
(load-my 'theme)
(load-my 'xml)
(load-my 'rgrep)
(require 'yaml-mode)
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("\\.yaml$" . yaml-mode))
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode))
(add-hook 'json-mode-hook
(lambda ()
(make-local-variable 'js-indent-level)
(setq js-indent-level 2)))
;; avoids "too long for Unix domain socket" on ssh over tramp (see
;; also
;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-01/msg00890.html):
(setq tramp-use-ssh-controlmaster-options nil)
;; Emacs tends to get super slow, if there are very long text lines
;; (like Clojure REPL output of a long sequence). If you use
;; profiler-start move the text cursor on a long text line, you see
;; that line-move-visual needs the most computing power. See
;; https://groups.google.com/forum/#!topic/gnu.emacs.help/vZKrLfxPI7E
;; and http://ergoemacs.org/emacs/emacs_line_move_visual.html
;; (setq line-move-visual nil)
;; lsp-mode
(setq lsp-keymap-prefix "C-ö")
(use-package lsp-mode
:ensure t
:hook ((clojure-mode . lsp)
(clojurec-mode . lsp)
(clojurescript-mode . lsp))
:config
;; add paths to your local installation of project mgmt tools, like lein
(setenv "PATH" (concat
"/usr/local/bin" path-separator
(getenv "PATH")))
(dolist (m '(clojure-mode
clojurec-mode
clojurescript-mode
clojurex-mode))
(add-to-list 'lsp-language-id-configuration `(,m . "clojure")))
(setq lsp-clojure-server-command '("bash" "-c" "clojure-lsp") ;; Optional: In case `clojure-lsp` is not in your PATH
lsp-enable-indentation nil))
;; performance tuning for lsp-mode: https://emacs-lsp.github.io/lsp-mode/page/performance/
(setq gc-cons-threshold 100000000)
(setq read-process-output-max (* 1024 1024)) ;; 1mb
(global-set-key (kbd "\C-c q") 'xref-find-references) ;; finds usages of a symbol
;; mouse support for emacs -nw
(xterm-mouse-mode 1)