summaryrefslogtreecommitdiff
path: root/emacs.el
blob: 170e45eef27c4c8173313c5eebacc8a32a5da299 (plain) (blame)
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
;; dotfiles -- emacs.johannst.el
;; author: johannst

(provide 'johannst)

;; config
(custom-set-variables
 '(font-use-system-font t)
 '(indent-tabs-mode nil)
 '(inhibit-startup-screen t)
 '(tool-bar-mode nil)
 '(whitespace-style '(trailing tabs newline tab-mark newline-mark))
 )

;; fix 'bad request' on package-refresh-contents (should be fixed with emcas 26.3)
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")

;; ELPA & MELPA
(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t)
(setq package-enable-at-startup nil)
(package-initialize)

;; bootstrap use-package
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-when-compile
  (require 'use-package))

;; theme
(use-package spacemacs-theme
  :ensure t
  :defer t
  :init
  (load-theme 'spacemacs-dark t)
  )

;; evil
(use-package evil
  :ensure t
  :config
  (evil-mode t)
  )

;; org
(use-package org
  :config
  (setq org-log-done t)
  :bind
  (:map org-mode-map
        ("M-j" . org-metadown)
        ("M-h" . org-metaleft)
        ("M-l" . org-metaright)
        ("M-k" . org-metaup)
        )
  )

;; helm
(use-package helm
  :ensure t
  :config
  (helm-mode t)
  )

;; magit
(use-package magit
  :ensure t
  )

;; company
(use-package company
  :ensure t
  :config
  (setq company-tooltip-align-annotations t)
  )

;; rust-mode
(use-package rust-mode
  :ensure t
  :mode ("\\.rs\\'" . rust-mode)
  )

;; cargo
(use-package cargo
  :ensure t
  :after (rust-mode)
  :hook (rust-mode . cargo-minor-mode)
  )

;; racer
(use-package racer
  :ensure t
  :requires (company)
  :after (rust-mode)
  :hook (
         (rust-mode . racer-mode)
         (racer-mode . company-mode)
         (racer-mode . eldoc-mode)
         )
  :bind
  (:map rust-mode-map
        ("TAB" . company-indent-or-complete-common)
        )
  )