-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
111 lines (86 loc) · 2.76 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
;;; init.el --- enorris' .emacs file
;;; Commentary:
;;
;;; Code:
;; Bootstrap built-in package management
(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
'(("GNU" . "https://elpa.gnu.org/packages/")
("MELPA Stable" . "https://stable.melpa.org/packages/")
("MELPA" . "https://melpa.org/packages/")))
(defvar package-archive-priorities)
(setq package-archive-priorities
'(("MELPA" . 10)
("MELPA Stable" . 5)
("GNU" . 0)))
(package-initialize)
;; Bootstrap use-package package management
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
(eval-when-compile
(require 'use-package))
;; Ensure packages are up to date
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-delete-old-versions t)
(setq auto-package-update-hide-results t)
(auto-package-update-maybe))
;; Add includes to the load path
(add-to-list 'load-path "~/.emacs.d/includes/")
;; Put customizations in a .gitignore'd file
(write-region "" nil "~/.emacs.d/customizations.el" t)
(setq custom-file "~/.emacs.d/customizations.el")
(load custom-file)
;; Put autosaves in a different directory, turn off backups
(setq auto-save-file-name-transforms`((".*" ,"~/.emacs.d/saves/" t)))
(setq auto-save-list-file-name nil)
(setq auto-save-list-file-prefix nil)
(setq make-backup-files nil)
;; Disable the menu bar at all times
(menu-bar-mode -1)
;; Install the zenburn-theme (make sure the tty matches these colors)
(use-package zenburn-theme
:ensure t
:init (load-theme 'zenburn t))
;; Flycheck install
(use-package flycheck-color-mode-line
:ensure t
:commands (flycheck-color-mode-line-mode))
(use-package flycheck
:ensure t
:commands global-flycheck-mode
:init
(global-flycheck-mode)
(setq flycheck-highlighting-mode 'lines)
(setq flycheck-emacs-lisp-load-path 'inherit)
:config
(add-hook 'flycheck-mode-hook 'flycheck-color-mode-line-mode))
;; fzf install
(require 'vc-git)
(defun fzf-keybind-hook ()
(interactive)
(if (vc-git-root (or buffer-file-name default-directory))
(fzf-git)
(fzf)))
(use-package fzf
:ensure t
:bind ("C-x f" . fzf-keybind-hook)
:config
(setenv
"FZF_DEFAULT_COMMAND"
(cond ((executable-find "rg") "rg --files --hidden --glob \!.git")
((executable-find "ag") "ag --hidden --ignore .git -l -g \"\""))))
;; General editor settings
(setq-default indent-tabs-mode nil)
(setq-default show-trailing-whitespace t)
(setq-default column-number-mode t)
(setq-default require-final-newline t)
(setq-default tab-width 4)
(setq-default c-basic-offset 4)
;; Require all files in the autoload directory
(require 'require-directory)
(require-directory "~/.emacs.d/autoload/")
;;; init.el ends here