-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.el
174 lines (147 loc) · 4 KB
/
init.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
;;; Commentary:
;;; Entry Point for Emacs customization
;;; Code:
;;; Begin initialization
;; Turn off mouse interface early in startup to avoid momentary display
(when window-system
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(tooltip-mode -1))
;; Add Line numbers onto a sidebar
(global-display-line-numbers-mode)
;; Backup File Directory
(let ((backup-dir "~/tmp/emacs/backups")
(auto-saves-dir "~/tmp/emacs/auto-saves/"))
(dolist (dir (list backup-dir auto-saves-dir))
(when (not (file-directory-p dir))
(make-directory dir t)))
(setq backup-directory-alist `(("." . ,backup-dir))
auto-save-file-name-transforms `((".*" ,auto-saves-dir t))
auto-save-list-file-prefix (concat auto-saves-dir ".saves-")
tramp-backup-directory-alist `((".*" . ,backup-dir))
tramp-auto-save-directory auto-saves-dir))
(setq inhibit-startup-message t)
(setq initial-scratch-message "")
;;; Load Custom Set Variables
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file)
;;; Set up package
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(defun internet-up-p (&optional host)
(= 0 (call-process "ping" nil nil nil "-c" "1" "-W" "1"
(if host host "www.google.com"))))
;;; Themeing
(use-package doom-themes
:ensure t
:init
(progn
(require 'doom-themes)
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t
doom-vibrant-brighter-modeline nil
org-hide-leading-stars nil) ; if nil, italics is universally disabled
(load-theme 'doom-gruvbox t)
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)
;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config)))
(use-package nyan-mode
:ensure t
:init
;; Fix up Nyan Cat cause she's pretty
(setq nyan-animate-nyancat t
nyan-wavy-trail t)
(nyan-mode))
;;; Rainbow Delimeters
(use-package rainbow-delimiters
:ensure t
:hook (rustic-mode
terraform-mode
emacs-lisp-mode))
;;; Dired
(use-package dired-narrow
:ensure t
:config
(bind-keys :map dired-mode-map
("f" . dired-narrow-fuzzy)))
;;; Undo-tree
(use-package undo-tree
:ensure t
:diminish undo-tree-mode
:init
(global-undo-tree-mode))
;;; Expand Region
(use-package expand-region
:ensure t
:bind (("C-=" . er/expand-region)
("C--" . er/contract-region)))
;;; Ivy and Consel
(use-package ivy
:ensure t
:bind (("C-s" . swiper)
("C-S-s" . isearch-forward))
:diminish ivy-mode
:init (ivy-mode 1))
(use-package counsel
:ensure t
:bind (("C-c g" . counsel-rg)))
;;; SmartParens
(use-package smartparens-mode
:ensure smartparens ;; install the package
:hook (prog-mode
text-mode
markdown-mode
rustic-mode
terraform-mode) ;; add `smartparens-mode` to these hooks
:bind ("C-<left>" . sp-forward-slurp-sexp)
:config
;; load default config
(require 'smartparens-config))
;;; Magit
(use-package magit
:ensure t
:bind (("C-c m" . magit-status)))
;;; Rust
(use-package rustic
:ensure t
:config
(setq rustic-format-on-save t)
:custom
(rustic-analyzer-command '("rustup" "run" "stable" "rust-analyzer")))
;;; Terraform
(use-package terraform-mode
:ensure t)
;;; web-mode
(use-package web-mode
:ensure t
:mode (".svelte$"))
;;; yaml
(use-package yaml-ts-mode
:mode ("\\.yml\\'" "\\.yaml\\'"))
;;; Prettier
(use-package prettier-js
:ensure t
:mode (("\\.tsx\\'" . prettier-js-mode)
("\\.json\\'" . prettier-js-mode)))
(use-package tsx-ts-mode
:mode "\\.tsx\\'")
;;; Lsp-mode
(use-package lsp-mode
:ensure t
:init
;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l")
(setq lsp-keymap-prefix "C-c l")
:hook ((terraform-mode . lsp)
(tsx-ts-mode . lsp))
:magic (".svelte$" . lsp)
:commands lsp)
(use-package lsp-ui
:ensure t)
(provide 'init.el)
;;; init.el ends here
(put 'upcase-region 'disabled nil)