-
Notifications
You must be signed in to change notification settings - Fork 1
/
dot-emacs
46 lines (40 loc) · 1.42 KB
/
dot-emacs
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
;; global variables/settings
;; no backup files!
(setq make-backup-files nil)
;; show column numbers
(setq column-number-mode t)
;; protobuf mode
(add-to-list 'load-path "~/.emacs.d/protobuf/")
(require 'protobuf-mode)
;; load emacs 24's package system. Add MELPA repository.
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
'("melpa" . "https://melpa.org/packages/")
t))
(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.
'(package-selected-packages '(typescript-mode go-mode)))
(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.
)
;; go-mode --> run goimports on save
(defun my-go-mode-hook ()
; Use goimports instead of go-fmt
(setq gofmt-command "goimports")
; Call Gofmt before saving
(add-hook 'before-save-hook 'gofmt-before-save)
)
(add-hook 'go-mode-hook 'my-go-mode-hook)
(defun my-typescript-mode-hook ()
(setq indent-tabs-mode 'nil)
)
(add-hook 'typescript-mode-hook 'my-typescript-mode-hook)