This repository has been archived by the owner on Nov 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.el
135 lines (114 loc) · 3.61 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
;;; init.el --- Define a group for these files
;;; Commentary:
;;; Learning me some emacs.d
;;; Code:
(defgroup emacsd nil
"Configs for my emacs"
:group 'local)
;; Set up a custom caching directory for the local machine
(defcustom emacsd-cache-directory (concat user-emacs-directory ".cache/")
"This is a storage location for backups and other persistent files."
:group 'emacsd)
;; Settings for initialzation
;; Turn off all the nagging menus
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;; to get rid of the splash screen uncomment the following
(setq inhibit-startup-message t)
;; Turns out that Custom adds junk to the init.
;; Lets get rid of that by putting it in a file called custom.el
(when (file-readable-p (expand-file-name "custom.el" user-emacs-directory))
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(load custom-file))
;; use saveplave package
(require 'saveplace)
(setq-default save-place t)
(setq save-place-file
(concat emacsd-cache-directory "places"))
;; set up the backups to go to their own directory
(setq backup-directory-alist
`(("." . ,(expand-file-name
(concat emacsd-cache-directory "backups")))))
(setq auto-save-file-name-transforms
`((".*" ,(expand-file-name
(concat emacsd-cache-directory "autosaves")) t)))
;; Make backup files all the time, even when in versioning
(setq vc-make-backup-files t)
;; Here are some customizations that could be moved later
;; -------------------------------------------
;; add line numbers, because i like to count.
(global-linum-mode t)
(setq linum-delay t)
;; auto-indent
(electric-indent-mode t)
;; Autosave every 500 typed words
(setq auto-save-interval 500)
;; Scrolling
(setq scroll-conservatively 10000) ;; scroll conservatively
(setq scroll-step 1) ;; scroll one line at a time.
(setq scroll-margin 10) ;; scroll when 10 lines from bottom or top.
(setq hscroll-step 1) ;; scroll one column at a time.
(setq hscroll-margin 8) ;; scroll when 8 lines from left or right.
(set-default 'truncate-lines t)
;; Add the config folder to the emacs dir.
(add-to-list 'load-path (concat user-emacs-directory "config"))
;; import modules.
(require 'cl)
(require 'init-packages)
(require 'init-utils)
;; Define modules to import
(defcustom emacsd-modules
'(init-misc
;; init-ido
init-ag
init-helm
init-company
init-flycheck
init-org
init-clojure
init-csharp
init-fsharp
init-ocaml
init-web
init-js
init-eclim
init-magit
init-projectile
init-evil-mode
init-sml
init-spell
init-erc
init-rcirc
init-smartparens)
"Set of my enabled modules."
:group 'emacsd)
;; require all the modules in the above list.
(dolist (module emacsd-modules)
(require module))
;; Mac specific
(when is-mac
(require 'mac))
;; Windows specific
(when is-windows
(require 'windows))
;; if linux -> gimme fullscreen with s-enter!
(when is-linux
(progn
(defun toggle-fullscreen ()
(interactive)
(set-frame-parameter nil 'fullscreen (if (frame-parameter nil 'fullscreen)
nil
'fullboth)))
(global-set-key [(super return)] 'toggle-fullscreen)))
;; emacsclient please.
(require 'server)
(unless (server-running-p)
(server-start))
;; color theme - must come after the packages are loaded!
(use-package flatland-theme
:ensure t
:config
(progn
(load-theme 'flatland t)))
;;; init.el ends here