-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
86 lines (71 loc) · 2.23 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
;;; emacs-init --- My init file
;;; Commentary:
;;; Code:
(add-to-list 'load-path "~/.emacs.d/modules")
(setq custom-file "~/.emacs.d/custom.el")
(load custom-file 'noerror)
(setq backup-directory-alist '(("." . "~/.emacs_saves"))
backup-by-copying t)
(ido-mode 1) ; enable ido mode
(global-set-key (kbd "C-x C-b") 'ibuffer)
(global-set-key (kbd "C-x r") 'revert-buffer)
;; window size
(setq default-frame-alist '((top . 0) (left . 0) (width . 200) (height . 55)))
;; follow symlinks
(setq vc-follow-symlinks t)
(setq package-archives
'(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("elpa" . "http://tromey.com/elpa/")
("melpa" . "http://melpa.org/packages/")))
(package-initialize)
(require 'use-package)
;; zenburn theme
(use-package zenburn-theme
:ensure t
:demand
:config (progn
(add-hook 'after-init-hook '(lambda () (interactive) (load-theme 'zenburn)))
(setq frame-background-mode 'dark)))
;; syntax error highliting
(use-package flycheck
:ensure t
:init (global-flycheck-mode 1))
;; rust mode
(use-package rust-mode
:ensure t)
;; toml mode
(use-package toml-mode
:ensure t)
;; project management
(use-package projectile
:ensure t
:init (projectile-global-mode 1))
;; easy lisp editing, brackets balancing
(use-package paredit
:ensure t
:init (add-hook 'emacs-lisp-mode-hook
(lambda ()
(paredit-mode 1))))
;; apply cmake parameters to company mode
(use-package cpputils-cmake
:ensure t
:init (add-hook 'c-mode-common-hook
(lambda()
(when (derived-mode-p 'c-mode 'c++-mode)
(cppcm-reload-all)))))
;; code autocompletion tool
(use-package company
:ensure t
:defer 5
:config (progn
(setq company-idle-delay 0.25)
(add-hook 'c++-mode-hook
#'(lambda ()
(make-local-variable 'company-clang-arguments)
(setq company-clang-arguments '("-std=c++11"))
(cppcm-reload-all)))
(add-hook 'eshell-mode-hook '(lambda () (company-mode 0)))
(add-hook 'org-mode-hook '(lambda () (company-mode 0)))
(global-company-mode 1))
:bind ("C-c v" . company-complete))