-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.emacs
147 lines (129 loc) · 4.46 KB
/
.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
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
136
137
138
139
140
141
142
143
144
145
146
147
;; Compat shit {{{
; Hack for ~ on Windows referring to %APPDATA% rather than home
; (and there not being an easy way to get the home directory reliably
; on windows, at least using environment variables or other syntax standards)
(if (eq system-type 'windows-nt)
; if
(setq SPECIAL_HOME (substitute-env-vars "C:/Users/$USERNAME"))
; else
(setq SPECIAL_HOME "~")
)
(setq ORG_HOME (format "%s/%s" SPECIAL_HOME "Documents/Syncthing/Orgzly/"))
;; }}}
;; Init package manager {{{
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/")
)
(package-initialize)
;(package-refresh-contents)
;; }}}
;; Packages {{{
;; Make emacs usable (evil mode + compat keybinds) {{{
(unless (package-installed-p 'evil)
(package-install 'evil)
)
(require 'evil)
(evil-mode 1)
; Buffer navigation
(global-set-key (kbd "C-k") 'windmove-up)
(global-set-key (kbd "C-j") 'windmove-down)
(global-set-key (kbd "C-h") 'windmove-left)
(global-set-key (kbd "C-l") 'windmove-right)
;; }}}
;; Meta displays {{{
(unless (package-installed-p 'dashboard)
(package-install 'dashboard)
)
(require 'dashboard)
(dashboard-setup-startup-hook)
;; }}}
;; Orgmode {{{
; Annoys the shit out of me that they named the package just org
; Tbf, evil is consistent with this naming convention, but still.
(unless (package-installed-p 'org)
(package-install 'org)
)
(require 'org)
; Make tab do something rather than nothing (why the fuck is indentation so fucking shit?)
(setq org-adapt-indentation t)
(add-to-list 'org-agenda-files ORG_HOME)
(global-set-key "\C-ca" 'org-agenda)
; The week starts on Monday, not Sunday >:(
(setq org-agenda-start-on-weekday 1)
(setq calendar-week-start-day 1)
;; }}}
;; File support {{{
(unless (package-installed-p 'markdown-mode)
(package-install 'markdown-mode)
)
;; }}}
;; Nav {{{
(unless (package-installed-p 'dired-sidebar)
(package-install 'dired-sidebar)
)
(require 'dired-sidebar)
(global-set-key (kbd "<f2>") 'dired-sidebar-toggle-sidebar)
;; }}}
;; Theming {{{
;; TODO: Shit theme, change when it isn't 2 in the morning
(unless (package-installed-p 'kaolin-themes)
(package-install 'kaolin-themes)
)
(load-theme 'kaolin-light t)
;; TODO: make compatible with other NF naming conventions for other OSes
(set-frame-font "SauceCodePro Nerd Font 13" nil t)
(set-cursor-color "#FF00EF")
;; }}}
;; }}}
;; Config {{{
(setq inhibit-startup-screen t) ; Get rid of the built-in start screen
(setq ring-bell-function 'ignore) ; Fuck bells
(global-display-line-numbers-mode) ; Line numbers
(setq default-directory ORG_HOME)
(menu-bar-mode -1)
(tool-bar-mode -1) ; Remove toolbar and GUI noise
; Syntax stuff
(setq font-lock-maximum-decoration t)
; Get rid of or move auto-generated files {{{
; Yeet autosaves elsewhere
; I'm not sure if make-directory is recursive, and I don't care enough to look it up
(unless (file-directory-p "~/.emacs.d")
(make-directory "~/.emacs.d/")
)
(unless (file-directory-p "~/.emacs.d/.autosaves")
(make-directory "~/.emacs.d/.autosaves/")
)
(setq auto-save-file-name-transforms
`((".*" ,"~/.emacs.d/.autosaves/" t)))
; Kill lockfiles (.# files)
(setq create-lockfiles nil)
; Disable file backups
; I really don't see the point in them. Autosaves, yes; they can avoid data loss if
; the editor suddenly dies. But file backups? Seems like it's just git but lazy
(setq make-backup-files nil)
; }}}
; Spaces my beloved
; This is not enough to force 4 spaces and no tabs in all files, because some major modes
; override it. Absolutely fucking moronic, but it's fine. I just need emacs to work for
; orgmode. Guess I won't bother configuring it generally in case I end up considering
; switching to it for More Stuff:tm:
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;; }}}
;; Don't touch; auto-generated shit {{{
(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.
'(custom-safe-themes
'("2ce76d65a813fae8cfee5c207f46f2a256bac69dacbb096051a7a8651aa252b0" "5a00018936fa1df1cd9d54bee02c8a64eafac941453ab48394e2ec2c498b834a" default))
'(package-selected-packages '(evil)))
(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.
)
;; }}}