diff options
Diffstat (limited to '.config')
-rw-r--r-- | .config/emacs/exwm/desktop.el | 150 | ||||
-rw-r--r-- | .config/emacs/init.el | 611 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-apps.el | 88 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-custom.el | 36 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-dev.el | 175 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-init.el | 81 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-keys.el | 51 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-org-mode.el | 200 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-ui.el | 154 | ||||
-rw-r--r-- | .config/emacs/jd-exwm/init.el | 149 | ||||
-rw-r--r-- | .config/emacs/jd-exwm/start.sh (renamed from .config/emacs/exwm/start.sh) | 5 | ||||
-rw-r--r-- | .config/emacs/jd/jd-mu4e.el | 17 | ||||
-rw-r--r-- | .config/polybar/config.ini | 3 |
13 files changed, 966 insertions, 754 deletions
diff --git a/.config/emacs/exwm/desktop.el b/.config/emacs/exwm/desktop.el deleted file mode 100644 index 512dbdc..0000000 --- a/.config/emacs/exwm/desktop.el +++ /dev/null | |||
@@ -1,150 +0,0 @@ | |||
1 | (defun jd/exwm-update-class () | ||
2 | (exwm-workspace-rename-buffer exwm-class-name)) | ||
3 | |||
4 | (defun jd-exwm/run-in-background (command) | ||
5 | (let ((command-parts (split-string command "[ ]+"))) | ||
6 | (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) | ||
7 | |||
8 | (defun jd-exwm/restart-process (program-name) | ||
9 | (call-process "killall" nil nil nil program-name) | ||
10 | (jd-exwm/run-in-background program-name)) | ||
11 | |||
12 | (defun jd-exwm/exwm-init-hook () | ||
13 | (jd-exwm/restart-process "polybar") | ||
14 | (jd-exwm/restart-process "nm-applet") | ||
15 | (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") | ||
16 | (jd-exwm/restart-process "blueman-applet") | ||
17 | (jd-exwm/restart-process "pasystray")) | ||
18 | |||
19 | (defun jd-exwm/exwm-update-title () | ||
20 | (exwm-workspace-rename-buffer exwm-title)) | ||
21 | |||
22 | (defun jd-exwm/configure-window-by-class () | ||
23 | (interactive) | ||
24 | (pcase exwm-class-name | ||
25 | ("firefox" (exwm-workspace-move-window 2)) | ||
26 | ("Brave" (exwm-workspace-move-window 2)) | ||
27 | ("qutebrowser" (exwm-workspace-move-window 2)) | ||
28 | ("discord" (exwm-workspace-move-window 5)) | ||
29 | ("obs" (exwm-workspace-move-window 5)) | ||
30 | ("Virt-manager" (exwm-workspace-move-window 4)))) | ||
31 | |||
32 | (use-package exwm | ||
33 | :config | ||
34 | (setq exwm-workspace-number 10) | ||
35 | |||
36 | (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) | ||
37 | (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) | ||
38 | (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) | ||
39 | (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) | ||
40 | |||
41 | (start-process-shell-command "nitrogen" nil "nitrogen --restore") | ||
42 | (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") | ||
43 | (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap") | ||
44 | |||
45 | (require 'exwm-randr) | ||
46 | (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) | ||
47 | (exwm-randr-enable) | ||
48 | |||
49 | (setq exwm-input-simulation-keys | ||
50 | '(([?\C-b] . [left]) | ||
51 | ([?\C-f] . [right]) | ||
52 | ([?\C-p] . [up]) | ||
53 | ([?\C-n] . [down]))) | ||
54 | |||
55 | (setq exwm-input-prefix-keys | ||
56 | '(?\C-x | ||
57 | ?\C-u | ||
58 | ?\C-h | ||
59 | ?\M-x | ||
60 | ?\M-` | ||
61 | ?\M-& | ||
62 | ?\M-: | ||
63 | ?\C-\M-j | ||
64 | ?\C-\ )) | ||
65 | |||
66 | (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) | ||
67 | (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) | ||
68 | |||
69 | (setq exwm-input-global-keys | ||
70 | `(([?\s-R] . exwm-reset) | ||
71 | |||
72 | |||
73 | ([?\s-r] . (lambda (command) | ||
74 | (interactive (list (read-shell-command "$ "))) | ||
75 | (start-process-shell-command command nil command))) | ||
76 | |||
77 | ([?\s-W] . exwm-workspace-move-window) | ||
78 | ([?\s-w] . exwm-workspace-switch) | ||
79 | |||
80 | ,@(mapcar (lambda (i) | ||
81 | `(,(kbd (format "s-%d" i)) . | ||
82 | (lambda () | ||
83 | (interactive) | ||
84 | (exwm-workspace-switch-create ,i)))) | ||
85 | (number-sequence 0 9)))) | ||
86 | |||
87 | (exwm-enable)) | ||
88 | |||
89 | (use-package desktop-environment | ||
90 | :after exwm | ||
91 | :config (desktop-environment-mode) | ||
92 | :custom | ||
93 | (desktop-environment-brightness-small-increment "2%+") | ||
94 | (desktop-environment-brightness-small-decrement "2%-") | ||
95 | (desktop-environment-brightness-normal-increment "5%+") | ||
96 | (desktop-environment-brightness-normal-decrement "5%-")) | ||
97 | |||
98 | (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) | ||
99 | (add-to-list 'default-frame-alist `(alpha . (90 . 90))) | ||
100 | (set-frame-parameter (selected-frame) 'fullscreen 'maximized) | ||
101 | (add-to-list 'default-frame-alist '(fullscreen . maximized)) | ||
102 | |||
103 | (defun jd-exwm/get-color (ATTRIBUTE) | ||
104 | (face-attribute 'default ATTRIBUTE)) | ||
105 | |||
106 | (defun theme-to-xresources () | ||
107 | (interactive) | ||
108 | (require 'term) | ||
109 | (with-temp-buffer | ||
110 | (insert "! Generated by theme-to-xresources\n") | ||
111 | (dolist (spec | ||
112 | '(("emacs.background" :background "E6") | ||
113 | ("emacs.foreground" :foreground ""))) | ||
114 | (let ((color (jd-exwm/get-color (cadr spec)))) | ||
115 | (insert (format "%s: #%s%s\n" | ||
116 | (car spec) | ||
117 | (caddr spec) | ||
118 | (string-remove-prefix "#" color)))) | ||
119 | (write-region (point-min) (point-max) "~/.Xresources"))) | ||
120 | (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources"))) | ||
121 | |||
122 | (defun jd/theme-sync () | ||
123 | (interactive) | ||
124 | (theme-to-xresources) | ||
125 | (setq org-confirm-babel-evaluate nil) | ||
126 | (org-babel-tangle-file "~/dotfiles/Desktop.org") | ||
127 | (setq org-confirm-babel-evaluate 't) | ||
128 | (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history | ||
129 | (jd-exwm/restart-process "polybar")) | ||
130 | |||
131 | (add-hook 'jd/load-theme-hook #'jd/theme-sync) | ||
132 | (add-hook 'exwm-init-hook #'jd/theme-sync) | ||
133 | |||
134 | (defun jd/dunst-show-history () | ||
135 | (interactive) | ||
136 | (start-process-shell-command "dunstctl" nil "dunstctl history-pop")) | ||
137 | |||
138 | (defun jd/dunst-close () | ||
139 | (interactive) | ||
140 | (start-process-shell-command "dunstctl" nil "dunstctl close")) | ||
141 | |||
142 | (defun jd/dunst-close-all () | ||
143 | (interactive) | ||
144 | (start-process-shell-command "dunstctl" nil "dunstctl close-all")) | ||
145 | |||
146 | (jd/leader-key-def | ||
147 | "d" '(nil :which-key "dunst") | ||
148 | "dh" '(jd/dunst-show-history :which-key "show history") | ||
149 | "dc" '(jd/dunst-close :which-key "close") | ||
150 | "da" '(jd/dunst-close-all :which-key "close all")) | ||
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 780a1c6..65a8683 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el | |||
@@ -1,602 +1,17 @@ | |||
1 | (setq gc-cons-threshold (* 50 1000 1000)) | 1 | ;;; Dotfiles --- Jakub Dlugosz emacs config |
2 | ;;; Commentary: | ||
2 | 3 | ||
3 | (defun jd/display-startup-time () | 4 | ;;; Code: |
4 | (message "Emacs loaded in %s with %d garbage collections." | ||
5 | (format "%.2f seconds" | ||
6 | (float-time | ||
7 | (time-subtract after-init-time before-init-time))) | ||
8 | gcs-done)) | ||
9 | 5 | ||
10 | (defun jd/startup () | 6 | (defvar jd/exwmp (not (null (getenv "JD_EXWM"))) |
11 | (electric-pair-mode 1) | 7 | "Return non-nil if Emacs is run as a window manager.") |
12 | (global-company-mode 1) | ||
13 | (jd/display-startup-time)) | ||
14 | 8 | ||
15 | (add-hook 'emacs-startup-hook #'jd/startup) | 9 | (let ((jd-emacs-init (concat user-emacs-directory |
10 | "jd-emacs/jd-emacs-init.el")) | ||
11 | (jd-exwm-init (concat user-emacs-directory | ||
12 | "jd-exwm/init.el"))) | ||
13 | (load jd-emacs-init) | ||
14 | (when jd/exwmp | ||
15 | (load jd-exwm-init))) | ||
16 | 16 | ||
17 | (setq user-full-name "Jakub Dlugosz" | 17 | ;;; init.el ends here |
18 | user-mail-address "jdlugosz963@gmail.com") | ||
19 | |||
20 | (setq backup-directory-alist '(("." . "~/.cache/emacs/backup")) | ||
21 | backup-by-copying t | ||
22 | version-control t | ||
23 | delete-old-versions t | ||
24 | kept-new-versions 20 | ||
25 | kept-old-versions 5) | ||
26 | |||
27 | (setq user-emacs-directory "~/.cache/emacs") | ||
28 | |||
29 | (require 'package) | ||
30 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") | ||
31 | ("org" . "https://orgmode.org/elpa/") | ||
32 | ("gnu-devel" . "https://elpa.gnu.org/devel/") | ||
33 | ("elpa" . "https://elpa.gnu.org/packages/"))) | ||
34 | (package-initialize) | ||
35 | |||
36 | (unless package-archive-contents | ||
37 | (package-refresh-contents)) | ||
38 | |||
39 | (unless (package-installed-p 'use-package) | ||
40 | (package-install 'use-package)) | ||
41 | |||
42 | (setq use-package-always-ensure t) | ||
43 | |||
44 | (add-to-list 'load-path ".config/emacs/jd/") | ||
45 | |||
46 | (require 'use-package) | ||
47 | |||
48 | (use-package general | ||
49 | :config | ||
50 | (general-create-definer jd/leader-key-def | ||
51 | :keymaps '(normal insert visual emacs) | ||
52 | :prefix "SPC" | ||
53 | :global-prefix "C-SPC") | ||
54 | |||
55 | (general-create-definer jd/ctrl-c-keys | ||
56 | :prefix "C-c")) | ||
57 | |||
58 | (use-package undo-tree | ||
59 | :diminish | ||
60 | :config | ||
61 | (setq undo-tree-auto-save-history nil) | ||
62 | (global-undo-tree-mode 1)) | ||
63 | |||
64 | (use-package evil | ||
65 | :init | ||
66 | (setq evil-want-integration t) | ||
67 | (setq evil-want-keybinding nil) | ||
68 | (setq evil-want-C-u-scroll t) | ||
69 | (setq evil-want-Y-yank-to-eol t) | ||
70 | (setq evil-want-C-i-jump nil) | ||
71 | (setq evil-undo-system 'undo-tree) | ||
72 | (setq evil-kill-on-visual-paste nil) | ||
73 | :config | ||
74 | (evil-set-initial-state 'exwm-mode 'emacs) | ||
75 | (evil-mode 1)) | ||
76 | |||
77 | (use-package evil-collection | ||
78 | :after evil | ||
79 | :config | ||
80 | (evil-collection-init)) | ||
81 | |||
82 | (jd/leader-key-def | ||
83 | "w" 'evil-window-map | ||
84 | "wr" '(hydra-resize-window/body :which-key "Rezize window") | ||
85 | "wd" '(evil-window-delete :which-key "Window delete")) | ||
86 | |||
87 | (jd/leader-key-def | ||
88 | "ou" '(undo-tree-visualize :which-key "Open")) | ||
89 | |||
90 | ;; remove . key | ||
91 | (define-key evil-normal-state-map (kbd ".") '()) | ||
92 | |||
93 | (setq inhibit-startup-message t) | ||
94 | (setq visible-bell t) | ||
95 | (scroll-bar-mode -1) | ||
96 | (tool-bar-mode -1) | ||
97 | (tooltip-mode -1) | ||
98 | (menu-bar-mode -1) | ||
99 | (set-fringe-mode 10) | ||
100 | |||
101 | (set-face-attribute 'default nil :font "sourcecodepro" :height 100) | ||
102 | |||
103 | (add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) | ||
104 | |||
105 | (global-set-key (kbd "<escape>") 'keyboard-escape-quit) | ||
106 | |||
107 | (defalias 'yes-or-no-p 'y-or-n-p) | ||
108 | |||
109 | (use-package doom-themes | ||
110 | :config | ||
111 | (load-theme 'doom-ayu-dark t)) | ||
112 | |||
113 | (use-package diminish) | ||
114 | |||
115 | (use-package hl-todo | ||
116 | :init | ||
117 | (setq hl-todo-keyword-faces | ||
118 | '(("TODO" . "#FF0000") | ||
119 | ("FIXME" . "#FF0000") | ||
120 | ("DEBUG" . "#A020F0"))) | ||
121 | :config | ||
122 | (global-hl-todo-mode 1)) | ||
123 | |||
124 | (defun jd/switch-buffer () | ||
125 | (interactive) | ||
126 | (let ((completion-regexp-list '("\\`[^*]" | ||
127 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) | ||
128 | (call-interactively 'counsel-switch-buffer))) | ||
129 | |||
130 | (defvar jd/load-theme-hook nil) | ||
131 | (defun jd/load-theme () | ||
132 | (interactive) | ||
133 | (counsel-load-theme) | ||
134 | (run-hooks 'jd/load-theme-hook)) | ||
135 | |||
136 | (use-package ivy | ||
137 | :diminish | ||
138 | :bind | ||
139 | (("C-s" . swiper) | ||
140 | :map ivy-minibuffer-map | ||
141 | ("C-k" . ivy-previous-line) | ||
142 | ("C-j" . ivy-next-line) | ||
143 | :map ivy-switch-buffer-map | ||
144 | ("C-k" . ivy-previous-line)) | ||
145 | :config | ||
146 | (ivy-mode 1)) | ||
147 | |||
148 | (use-package counsel | ||
149 | :config | ||
150 | (counsel-mode 1)) | ||
151 | |||
152 | (jd/leader-key-def | ||
153 | "t" '(:ignore t :which-key "Toggle") | ||
154 | "tT" '(toggle-truncate-lines :which-key "Toggle truncate lines") | ||
155 | "tt" '(jd/load-theme :which-key "Choose theme")) | ||
156 | |||
157 | (jd/leader-key-def | ||
158 | "bb" '(jd/switch-buffer :which-key "Buffer switch") | ||
159 | "ba" '(counsel-switch-buffer :which-key "Buffer switch") | ||
160 | "b" '(:ignore t :which-key "Buffer") | ||
161 | "," '(counsel-switch-buffer :which-key "Buffer switch")) | ||
162 | |||
163 | (use-package which-key | ||
164 | :diminish | ||
165 | :config | ||
166 | (which-key-mode) | ||
167 | (setq which-key-idle-delay 0.3)) | ||
168 | |||
169 | (use-package all-the-icons) | ||
170 | |||
171 | (use-package doom-modeline | ||
172 | :init (doom-modeline-mode 1) | ||
173 | :custom ((doom-modeline-height 15))) | ||
174 | |||
175 | (use-package hydra | ||
176 | :defer t) | ||
177 | |||
178 | (defun jd/text-scale-increase () | ||
179 | (interactive) | ||
180 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
181 | (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) | ||
182 | |||
183 | (defun jd/text-scale-decrease () | ||
184 | (interactive) | ||
185 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
186 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) | ||
187 | |||
188 | (defhydra hydra-resize-window (:timeout 4) | ||
189 | ("h" evil-window-decrease-width "<") | ||
190 | ("l" evil-window-increase-width ">") | ||
191 | ("k" evil-window-decrease-height "^") | ||
192 | ("j" evil-window-increase-height "v") | ||
193 | ("q" nil "finished" :exit t)) | ||
194 | |||
195 | (defhydra hydra-text-scale-global (:timeout 4) | ||
196 | "scale text" | ||
197 | ("j" jd/text-scale-increase "in") | ||
198 | ("k" jd/text-scale-decrease "out") | ||
199 | ("q" nil "finished" :exit t)) | ||
200 | |||
201 | (defhydra hydra-text-scale (:timeout 4) | ||
202 | "scale text" | ||
203 | ("j" text-scale-increase "in") | ||
204 | ("k" text-scale-decrease "out") | ||
205 | ("q" nil "finished" :exit t)) | ||
206 | |||
207 | (jd/leader-key-def | ||
208 | "tS" '(hydra-text-scale-global/body :which-key "Scale text") | ||
209 | "ts" '(hydra-text-scale/body :which-key "Scale text")) | ||
210 | |||
211 | (use-package beacon | ||
212 | :config | ||
213 | (beacon-mode 1)) | ||
214 | |||
215 | (jd/leader-key-def | ||
216 | "f" '(:ignore t :which-key "Files") | ||
217 | "fs" '(save-buffer :which-key "File save") | ||
218 | "." '(find-file :which-key "Find file") | ||
219 | "ff" '(find-file :which-key "Find file")) | ||
220 | |||
221 | (jd/leader-key-def | ||
222 | "e" '(:ignore t :which-key "Eval") | ||
223 | "eb" '(eval-buffer :which-key "Eval buffer")) | ||
224 | |||
225 | (jd/leader-key-def | ||
226 | :keymaps '(visual) | ||
227 | "er" '(eval-region :which-key "Eval region")) | ||
228 | |||
229 | (defun jd/kill-other-buffers () | ||
230 | (interactive) | ||
231 | (mapc 'kill-buffer (cdr (buffer-list (current-buffer))))) | ||
232 | |||
233 | (jd/leader-key-def | ||
234 | "bK" '(jd/kill-other-buffers :which-key "Kill other buffers") | ||
235 | "bk" '(kill-current-buffer :which-key "Kill buffer") | ||
236 | "bB" '(ibuffer :which-key "Open ibuffer")) | ||
237 | |||
238 | (setq jd/org-home "~/Documents/Org") | ||
239 | (setq jd/org-roam-home (concat jd/org-home "/roam")) | ||
240 | (setq jd/org-roam-daily-home (concat jd/org-home "/roam/daily")) | ||
241 | |||
242 | (defun jd/org-mode-setup () | ||
243 | (org-indent-mode) | ||
244 | (variable-pitch-mode 1) | ||
245 | (visual-line-mode 1)) | ||
246 | |||
247 | (use-package org | ||
248 | :pin org | ||
249 | :commands (org-capture org-agenda) | ||
250 | :hook (org-mode . jd/org-mode-setup) | ||
251 | :config | ||
252 | (setq org-directory (file-truename "~/Documents/Org/")) | ||
253 | (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) | ||
254 | (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg") | ||
255 | (setq org-agenda-files | ||
256 | '("Tasks.org")) | ||
257 | (setq org-ellipsis " ▾") | ||
258 | (setq org-agenda-start-with-log-mode t) | ||
259 | (setq org-log-done 'time) | ||
260 | (setq org-log-into-drawer t) | ||
261 | (setq org-return-follows-link t) | ||
262 | (setq org-capture-templates | ||
263 | `(("t" "Tasks / Projects") | ||
264 | ("tt" "Task" entry (file+olp "Tasks.org" "Inbox") | ||
265 | "* TODO %?\n %t\n %a\n %i" :empty-lines 1) | ||
266 | ("tT" "Task for tomorow" entry (file+olp "Tasks.org" "Inbox") | ||
267 | "* TODO %?\n %t\n SCHEDULED: %(org-insert-time-stamp (org-read-date nil t \"+1d\"))\n %a\n %i" :empty-lines 1) | ||
268 | |||
269 | ("m" "Metrics Capture") | ||
270 | ("mm" "Metrics" table-line (file+headline "Metrics.org" "Metrics") | ||
271 | "| %U | %^{Weight} | %^{Waist} | %^{Notes} |" :kill-buffer t))) | ||
272 | |||
273 | (setq org-latex-listings 'minted | ||
274 | org-latex-packages-alist '(("" "minted")) | ||
275 | org-latex-pdf-process | ||
276 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | ||
277 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | ||
278 | |||
279 | (require 'org-tempo)) | ||
280 | |||
281 | (jd/leader-key-def | ||
282 | "o" '(:ignore t :which-key "Open/Org") | ||
283 | "oc" '(org-capture :which-key "Open org-capture") | ||
284 | "oop" '(org-mobile-pull :which-key "Org mobile pull") | ||
285 | "ooP" '(org-mobile-push :which-key "Org mobile push") | ||
286 | "oa" '(org-agenda :which-key "Open org-agenda")) | ||
287 | |||
288 | (use-package evil-org | ||
289 | :after org | ||
290 | :hook (org-mode . (lambda () evil-org-mode)) | ||
291 | :config | ||
292 | (require 'evil-org-agenda) | ||
293 | (evil-org-agenda-set-keys)) | ||
294 | |||
295 | (use-package toc-org | ||
296 | :config | ||
297 | (add-hook 'org-mode-hook 'toc-org-mode)) | ||
298 | |||
299 | (defun jd/org-font-setup () | ||
300 | ;; Replace list hyphen with dot | ||
301 | (font-lock-add-keywords 'org-mode | ||
302 | '(("^ *\\([-]\\) " | ||
303 | (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•-")))))) | ||
304 | |||
305 | ;; Set faces for heading levels | ||
306 | (dolist (face '((org-level-1 . 1.3) | ||
307 | (org-level-2 . 1.2) | ||
308 | (org-level-3 . 1.1) | ||
309 | (org-level-4 . 1.0) | ||
310 | (org-level-5 . 1.1) | ||
311 | (org-level-6 . 1.1) | ||
312 | (org-level-7 . 1.1) | ||
313 | (org-level-8 . 1.1))) | ||
314 | (set-face-attribute (car face) nil :font "Monospace" :weight 'Bold :height (cdr face))) | ||
315 | |||
316 | ;; Ensure that anything that should be fixed-pitch in Org files appears that way | ||
317 | (set-face-attribute 'org-block nil :font "hack" :inherit 'fixed-pitch) | ||
318 | (set-face-attribute 'org-table nil :inherit 'fixed-pitch) | ||
319 | (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) | ||
320 | (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) | ||
321 | (set-face-attribute 'org-table nil :inherit '(shadow fixed-pitch)) | ||
322 | (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) | ||
323 | (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
324 | (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
325 | (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) | ||
326 | (set-face-attribute 'line-number nil :inherit 'fixed-pitch) | ||
327 | (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) | ||
328 | |||
329 | (with-eval-after-load 'org-faces (jd/org-font-setup)) | ||
330 | |||
331 | (defun jd/org-tempo-setup () | ||
332 | (add-to-list 'org-structure-template-alist '("s" . "src")) | ||
333 | (add-to-list 'org-structure-template-alist '("sql" . "src sql")) | ||
334 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) | ||
335 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) | ||
336 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) | ||
337 | (add-to-list 'org-structure-template-alist '("sc" . "src scheme")) | ||
338 | (add-to-list 'org-structure-template-alist '("ts" . "src typescript")) | ||
339 | (add-to-list 'org-structure-template-alist '("py" . "src python")) | ||
340 | (add-to-list 'org-structure-template-alist '("go" . "src go")) | ||
341 | (add-to-list 'org-structure-template-alist '("yaml" . "src yaml"))) | ||
342 | |||
343 | (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) | ||
344 | |||
345 | (org-babel-do-load-languages | ||
346 | 'org-babel-load-languages | ||
347 | '((emacs-lisp . t) | ||
348 | (python . t))) | ||
349 | |||
350 | (defun jd/org-babel-tangle-config () | ||
351 | (when (string-equal (file-name-directory (buffer-file-name)) | ||
352 | (expand-file-name "~/dotfiles/")) | ||
353 | ;; Dynamic scoping to the rescue | ||
354 | (let ((org-confirm-babel-evaluate nil)) | ||
355 | (org-babel-tangle)))) | ||
356 | |||
357 | (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'jd/org-babel-tangle-config))) | ||
358 | |||
359 | (defun jd/org-mode-visual-fill () | ||
360 | (setq visual-fill-column-width 100 | ||
361 | visual-fill-column-center-text t) | ||
362 | (visual-fill-column-mode 1)) | ||
363 | |||
364 | (use-package visual-fill-column | ||
365 | :hook (org-mode . jd/org-mode-visual-fill)) | ||
366 | |||
367 | (use-package org-superstar | ||
368 | :hook (org-mode . org-superstar-mode) | ||
369 | :init | ||
370 | (setq org-superstar-special-todo-items t) | ||
371 | (setq org-superstar-remove-leading-stars t) | ||
372 | (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) | ||
373 | |||
374 | (defun jd/org-roam-filter-by-tag (tag-name) | ||
375 | (lambda (node) | ||
376 | (member tag-name (org-roam-node-tags node)))) | ||
377 | |||
378 | (defun jd/org-roam-list-notes-by-tag (tag-name) | ||
379 | (mapcar #'org-roam-node-file | ||
380 | (seq-filter | ||
381 | (jd/org-roam-filter-by-tag tag-name) | ||
382 | (org-roam-node-list)))) | ||
383 | |||
384 | (defun jd/org-roam-refreshagenda-list () | ||
385 | (interactive) | ||
386 | (setq org-agenda-files (org-roam-list-files))) | ||
387 | |||
388 | (use-package org-roam | ||
389 | :custom | ||
390 | (org-roam-directory (file-truename jd/org-roam-home)) | ||
391 | :bind (("C-c n l" . org-roam-buffer-toggle) | ||
392 | ("C-c n f" . org-roam-node-find) | ||
393 | ("C-c n g" . org-roam-graph) | ||
394 | ("C-c n i" . org-roam-node-insert) | ||
395 | ("C-c n c" . org-roam-capture) | ||
396 | ;; Dailies | ||
397 | ("C-c n j" . org-roam-dailies-capture-today)) | ||
398 | :bind-keymap | ||
399 | ("C-c n d" . org-roam-dailies-map) | ||
400 | :config | ||
401 | ;; If you're using a vertical completion framework, you might want a more informative completion interface | ||
402 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) | ||
403 | (org-roam-db-autosync-mode)) | ||
404 | |||
405 | (use-package lsp-mode | ||
406 | :commands (lsp lsp-deferred) | ||
407 | :init | ||
408 | (setq lsp-headerline-breadcrumb-enable nil) | ||
409 | (setq lsp-diagnostics-provider :none) | ||
410 | (setq lsp-modeline-diagnostics-enable nil) | ||
411 | (setq lsp-keymap-prefix "C-c l") | ||
412 | :config | ||
413 | (lsp-enable-which-key-integration t)) | ||
414 | |||
415 | (use-package lsp-ivy | ||
416 | :after lsp) | ||
417 | |||
418 | (defun jd/python-mode-setup () | ||
419 | (let ((project-venv-path (concat (projectile-project-root) "venv/"))) | ||
420 | (when (projectile--directory-p project-venv-path) | ||
421 | (pyvenv-activate project-venv-path) | ||
422 | (pyvenv-mode)))) | ||
423 | |||
424 | ;; (use-package python-mode ;;TODO: find alternative | ||
425 | ;; :hook (python-mode . lsp-deferred) | ||
426 | ;; :hook (python-mode . jd/python-mode-setup) | ||
427 | ;; :config | ||
428 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
429 | |||
430 | (use-package pyvenv | ||
431 | :after python-mode) | ||
432 | |||
433 | (use-package typescript-mode | ||
434 | :mode ("\\.ts\\'") | ||
435 | :config | ||
436 | (setq typescript-indent-level 2)) | ||
437 | |||
438 | (defun jd/activate-tide-mode () | ||
439 | (when (and (stringp buffer-file-name) | ||
440 | (string-match "\\.[tj]sx?\\'" buffer-file-name)) | ||
441 | (tide-setup) | ||
442 | (tide-hl-identifier-mode))) | ||
443 | |||
444 | (use-package tide | ||
445 | :after (typescript-mode company web-mode)) | ||
446 | |||
447 | (use-package flycheck | ||
448 | :hook ((after-init . global-flycheck-mode))) | ||
449 | |||
450 | (use-package web-mode | ||
451 | :hook ((web-mode . jd/activate-tide-mode)) | ||
452 | :mode | ||
453 | ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") | ||
454 | :config | ||
455 | (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'"))) | ||
456 | (setq web-mode-markup-indent-offset 2) | ||
457 | (setq web-mode-css-indent-offset 2) | ||
458 | (setq web-mode-code-indent-offset 2) | ||
459 | (setq web-mode-script-padding 2) | ||
460 | (setq web-mode-block-padding 2) | ||
461 | (setq web-mode-style-padding 2) | ||
462 | (setq web-mode-enable-auto-pairing t) | ||
463 | (setq web-mode-enable-auto-closing t) | ||
464 | (setq web-mode-enable-current-element-highlight t)) | ||
465 | |||
466 | (use-package yaml-mode) | ||
467 | |||
468 | (use-package docker) | ||
469 | |||
470 | (jd/leader-key-def | ||
471 | "d" '(:ignore t :which-key "Docker") | ||
472 | "dc" '(docker-containers :which-key "Docker containers") | ||
473 | "dd" '(docker :which-key "Docker")) | ||
474 | |||
475 | (use-package company | ||
476 | :after lsp-mode | ||
477 | :hook (lsp-mode . company-mode) | ||
478 | :bind (:map company-active-map | ||
479 | ("<tab>" . company-complete-selection)) | ||
480 | (:map lsp-mode-map | ||
481 | ("<tab>" . company-indent-or-complete-common)) | ||
482 | :custom | ||
483 | (company-minimum-prefix-length 1) | ||
484 | (company-idle-delay 0.0) | ||
485 | :config | ||
486 | (global-company-mode)) | ||
487 | |||
488 | (use-package company-box | ||
489 | :hook (company-mode . company-box-mode)) | ||
490 | |||
491 | (use-package projectile | ||
492 | :diminish projectile-mode | ||
493 | :init | ||
494 | (when (file-directory-p "~/Documents/code") | ||
495 | (setq projectile-project-search-path '("~/Documents/code/"))) | ||
496 | :custom ((projectile-Completion-system 'ivy)) | ||
497 | :config | ||
498 | (setq projectile-switch-project-action #'projectile-dired) | ||
499 | (projectile-mode)) | ||
500 | |||
501 | (jd/leader-key-def | ||
502 | "p" '(projectile-command-map :which-key "Project") | ||
503 | "p <ESC>" '() | ||
504 | "SPC" '(projectile-find-file :which-key "Find file in project")) | ||
505 | |||
506 | (defun jd/neotree-project-dir () | ||
507 | "Open NeoTree using the git root." | ||
508 | (interactive) | ||
509 | (let ((project-dir (projectile-project-root)) | ||
510 | (file-name (buffer-file-name))) | ||
511 | (neotree-toggle) | ||
512 | (if project-dir | ||
513 | (if (neo-global--window-exists-p) | ||
514 | (progn | ||
515 | (neotree-dir project-dir) | ||
516 | (neotree-find file-name))) | ||
517 | (message "Could not find git project root.")))) | ||
518 | |||
519 | (use-package neotree | ||
520 | :init | ||
521 | (setq neo-theme 'icons) | ||
522 | :config | ||
523 | |||
524 | (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) | ||
525 | (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look) | ||
526 | (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) | ||
527 | (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) | ||
528 | (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) | ||
529 | (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) | ||
530 | (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle)) | ||
531 | |||
532 | (jd/leader-key-def | ||
533 | "op" '(jd/neotree-project-dir :which-key "Open neotree")) | ||
534 | |||
535 | (use-package magit | ||
536 | :custom | ||
537 | (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) | ||
538 | |||
539 | (jd/leader-key-def | ||
540 | "g" '(:ignore t :which-key "Git") | ||
541 | "gg" '(magit-status-here :which-key "Magit status")) | ||
542 | |||
543 | (defun jd/open-new-vterm (&optional jd/vterm-buffer-name) | ||
544 | (interactive) | ||
545 | (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) | ||
546 | (when jd/vterm-buffer-name | ||
547 | (setq buffer-name jd/vterm-buffer-name)) | ||
548 | (switch-to-buffer buffer-name) | ||
549 | (vterm-mode))) | ||
550 | |||
551 | |||
552 | (use-package vterm | ||
553 | :config | ||
554 | (setq vterm-buffer-name "vterm") | ||
555 | (evil-set-initial-state 'vterm-mode 'emacs)) | ||
556 | |||
557 | (jd/leader-key-def | ||
558 | "ot" '(jd/open-new-vterm :which-key "Open terminal in current window")) | ||
559 | |||
560 | (use-package all-the-icons-dired | ||
561 | :hook (dired-mode . all-the-icons-dired-mode)) | ||
562 | |||
563 | (use-package dired-ranger) | ||
564 | |||
565 | (use-package dired | ||
566 | :ensure nil | ||
567 | :commands (dired dired-jump) | ||
568 | :custom ((dired-listing-switches "-agho --group-directories-first")) | ||
569 | :config | ||
570 | (evil-collection-define-key 'normal 'dired-mode-map | ||
571 | "y" 'dired-ranger-copy | ||
572 | "p" 'dired-ranger-paste | ||
573 | "X" 'dired-ranger-move | ||
574 | "h" 'dired-up-directory | ||
575 | "t" 'dired-create-empty-file | ||
576 | "T" 'dired-toggle-marks | ||
577 | "l" 'dired-find-file) | ||
578 | (setq dired-kill-when-opening-new-dired-buffer t) | ||
579 | (evil-define-key 'normal dired-mode-map (kbd "q") 'kill-current-buffer)) | ||
580 | |||
581 | (use-package emms | ||
582 | :config | ||
583 | (require 'emms-setup) | ||
584 | (emms-all) | ||
585 | (emms-standard) | ||
586 | (emms-default-players) | ||
587 | (emms-mode-line-disable) | ||
588 | ; (setq emms-info-functions '(emms-info-tinytag)) | ||
589 | (setq emms-browser-covers 'emms-browser-cache-thumbnail-async) | ||
590 | ;; (setq emms-lyrics-dir "~/Documents/music/lyrics") | ||
591 | (emms-add-directory-tree "~/Documents/Music/")) | ||
592 | |||
593 | (use-package pdf-tools) | ||
594 | |||
595 | (require 'jd-mu4e) | ||
596 | |||
597 | (use-package elfeed | ||
598 | :config | ||
599 | (setq elfeed-feeds | ||
600 | '("https://www.reddit.com/r/emacs.rss"))) | ||
601 | |||
602 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-apps.el b/.config/emacs/jd-emacs/jd-emacs-apps.el new file mode 100644 index 0000000..628039d --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-apps.el | |||
@@ -0,0 +1,88 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defun jd/open-new-vterm (&optional jd/vterm-buffer-name) | ||
7 | (interactive) | ||
8 | (let ((buffer-name (generate-new-buffer-name vterm-buffer-name))) | ||
9 | (when jd/vterm-buffer-name | ||
10 | (setq buffer-name jd/vterm-buffer-name)) | ||
11 | (switch-to-buffer buffer-name) | ||
12 | (vterm-mode))) | ||
13 | |||
14 | |||
15 | (use-package vterm | ||
16 | :init | ||
17 | (add-to-list 'project-switch-commands '(project-vterm "Vterm") t) | ||
18 | (add-to-list 'project-kill-buffer-conditions '(major-mode . vterm-mode)) | ||
19 | (setq vterm-copy-exclude-prompt t) | ||
20 | :config | ||
21 | (setq vterm-buffer-name "vterm") | ||
22 | (evil-set-initial-state 'vterm-mode 'emacs) | ||
23 | (setq vterm-tramp-shells (append '(("ssh" "/bin/bash")) vterm-tramp-shells))) | ||
24 | |||
25 | (jd/leader-key-def | ||
26 | "ot" '(jd/open-new-vterm :which-key "Open terminal in current window")) | ||
27 | |||
28 | (use-package all-the-icons-dired | ||
29 | :hook (dired-mode . all-the-icons-dired-mode)) | ||
30 | |||
31 | (use-package dired-ranger) | ||
32 | |||
33 | (use-package dired | ||
34 | :ensure nil | ||
35 | :commands (dired dired-jump) | ||
36 | :custom ((dired-listing-switches "-agho --group-directories-first")) | ||
37 | :config | ||
38 | (evil-collection-define-key 'normal 'dired-mode-map | ||
39 | "y" 'dired-ranger-copy | ||
40 | "p" 'dired-ranger-paste | ||
41 | "X" 'dired-ranger-move | ||
42 | "h" 'dired-up-directory | ||
43 | "t" 'dired-create-empty-file | ||
44 | "T" 'dired-toggle-marks | ||
45 | "l" 'dired-find-file) | ||
46 | (setq dired-kill-when-opening-new-dired-buffer t) | ||
47 | (evil-define-key 'normal dired-mode-map (kbd "q") 'kill-current-buffer)) | ||
48 | |||
49 | (use-package emms | ||
50 | :config | ||
51 | (require 'emms-setup) | ||
52 | (emms-all) | ||
53 | (emms-standard) | ||
54 | (emms-default-players) | ||
55 | (emms-mode-line-disable) | ||
56 | ; (setq emms-info-functions '(emms-info-tinytag)) | ||
57 | (setq emms-browser-covers 'emms-browser-cache-thumbnail-async) | ||
58 | ;; (setq emms-lyrics-dir "~/Documents/music/lyrics") | ||
59 | (emms-add-directory-tree "~/Documents/Music/")) | ||
60 | |||
61 | (use-package pdf-tools) | ||
62 | |||
63 | (require 'jd-mu4e) | ||
64 | |||
65 | (use-package elfeed | ||
66 | :config | ||
67 | (setq elfeed-feeds | ||
68 | '(("https://www.reddit.com/r/emacs.rss" emacs) | ||
69 | ("https://www.reddit.com/r/gnu.rss" gnu) | ||
70 | ("https://stallman.org/rss/rss.xml" stallman)))) | ||
71 | |||
72 | (use-package langtool | ||
73 | :config | ||
74 | (setq langtool-language-tool-jar "/home/jakub/Documents/LanguageTool-6.0/languagetool-commandline.jar") | ||
75 | (setq langtool-default-language "pl-PL")) | ||
76 | |||
77 | (jd/leader-key-def | ||
78 | "l" '(:ignore t :which-key "langtool") | ||
79 | "lc" 'langtool-check-buffer | ||
80 | "ld" 'langtool-check-done | ||
81 | "li" 'langtool-interactive-correction) | ||
82 | |||
83 | (use-package mastodon | ||
84 | :config | ||
85 | (setq mastodon-active-user "jdlugosz963" | ||
86 | mastodon-instance-url "https://fosstodon.org/")) | ||
87 | |||
88 | ;;; jd-apps.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-custom.el b/.config/emacs/jd-emacs/jd-emacs-custom.el new file mode 100644 index 0000000..aef824f --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-custom.el | |||
@@ -0,0 +1,36 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defun jd/generete-qr-from-clipboard () | ||
7 | (interactive) | ||
8 | (let ((clipboard-value (x-get-clipboard)) | ||
9 | (clipboard-file-path "/tmp/clipboard_value.txt") | ||
10 | (clipboard-out-image "/tmp/qr.png")) | ||
11 | (with-temp-file clipboard-file-path | ||
12 | (insert clipboard-value)) | ||
13 | (shell-command (concat | ||
14 | "qrencode -o " | ||
15 | clipboard-out-image | ||
16 | " < " | ||
17 | clipboard-file-path)) | ||
18 | (find-file clipboard-out-image))) | ||
19 | |||
20 | (defun jd-emacs/erc-notify-sound () | ||
21 | (jd-exwm/run-in-background "mpv /home/jakub/.config/emacs/resources/beep.wav")) | ||
22 | |||
23 | ;; (add-hook 'erc-notifications-mode-hook #'jd-emacs/erc-notify-sound) | ||
24 | |||
25 | (setq | ||
26 | erc-nick "bobbma" | ||
27 | erc-user-full-name "Jakub Dlugosz" | ||
28 | erc-notify-list '("akuleszaa")) | ||
29 | |||
30 | ;; Define a function to connect to a server | ||
31 | (defun hipis-znc () | ||
32 | (interactive) | ||
33 | (erc :server "195.74.91.18" | ||
34 | :port "6697")) | ||
35 | |||
36 | ;;; jd-custom.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-dev.el b/.config/emacs/jd-emacs/jd-emacs-dev.el new file mode 100644 index 0000000..620a7ad --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-dev.el | |||
@@ -0,0 +1,175 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (setq c-default-style "linux" | ||
7 | c-basic-offset 8) | ||
8 | |||
9 | (setq gdb-many-windows t) | ||
10 | |||
11 | (use-package lsp-mode | ||
12 | :commands (lsp lsp-deferred) | ||
13 | :init | ||
14 | (setq lsp-headerline-breadcrumb-enable nil) | ||
15 | (setq lsp-diagnostics-provider :none) | ||
16 | (setq lsp-modeline-diagnostics-enable nil) | ||
17 | (setq lsp-keymap-prefix "C-c l") | ||
18 | :config | ||
19 | (lsp-enable-which-key-integration t)) | ||
20 | |||
21 | (use-package lsp-ivy | ||
22 | :after lsp) | ||
23 | |||
24 | (use-package paredit) | ||
25 | (use-package evil-paredit) | ||
26 | (use-package rainbow-delimiters) | ||
27 | |||
28 | (defun jd/lisp-mode-setup () | ||
29 | (rainbow-delimiters-mode) | ||
30 | (evil-paredit-mode) | ||
31 | (paredit-mode)) | ||
32 | |||
33 | (add-hook 'emacs-startup-hook | ||
34 | (lambda () | ||
35 | (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) | ||
36 | (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) | ||
37 | (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) | ||
38 | (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) | ||
39 | |||
40 | |||
41 | (evil-define-key 'normal paredit-mode-map (kbd "g h") 'paredit-forward-barf-sexp) | ||
42 | (evil-define-key 'normal paredit-mode-map (kbd "g l") 'paredit-forward-slurp-sexp) | ||
43 | |||
44 | (evil-define-key 'normal paredit-mode-map (kbd "g H") 'paredit-backward-slurp-sexp) | ||
45 | (evil-define-key 'normal paredit-mode-map (kbd "g L") 'paredit-backward-barf-sexp) | ||
46 | |||
47 | (use-package geiser) | ||
48 | (use-package geiser-guile) | ||
49 | |||
50 | (defun jd/python-mode-setup () | ||
51 | (let ((project-venv-path (concat (projectile-project-root) "venv/"))) | ||
52 | (when (projectile--directory-p project-venv-path) | ||
53 | (pyvenv-activate project-venv-path) | ||
54 | (pyvenv-mode)))) | ||
55 | |||
56 | ;; (use-package python-mode ;;TODO: find alternative | ||
57 | ;; :hook (python-mode . lsp-deferred) | ||
58 | ;; :hook (python-mode . jd/python-mode-setup) | ||
59 | ;; :config | ||
60 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
61 | |||
62 | (use-package pyvenv | ||
63 | :after python-mode) | ||
64 | |||
65 | (use-package typescript-mode | ||
66 | :mode ("\\.ts\\'") | ||
67 | :config | ||
68 | (setq typescript-indent-level 2)) | ||
69 | |||
70 | (defun jd/activate-tide-mode () | ||
71 | (when (and (stringp buffer-file-name) | ||
72 | (string-match "\\.[tj]sx?\\'" buffer-file-name)) | ||
73 | (tide-setup) | ||
74 | (tide-hl-identifier-mode))) | ||
75 | |||
76 | (use-package tide | ||
77 | :after (typescript-mode company web-mode)) | ||
78 | |||
79 | (use-package flycheck | ||
80 | :hook ((after-init . global-flycheck-mode))) | ||
81 | |||
82 | (use-package web-mode | ||
83 | :hook ((web-mode . jd/activate-tide-mode)) | ||
84 | :mode | ||
85 | ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") | ||
86 | :config | ||
87 | (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'"))) | ||
88 | (setq web-mode-markup-indent-offset 2) | ||
89 | (setq web-mode-css-indent-offset 2) | ||
90 | (setq web-mode-code-indent-offset 2) | ||
91 | (setq web-mode-script-padding 2) | ||
92 | (setq web-mode-block-padding 2) | ||
93 | (setq web-mode-style-padding 2) | ||
94 | (setq web-mode-enable-auto-pairing t) | ||
95 | (setq web-mode-enable-auto-closing t) | ||
96 | (setq web-mode-enable-current-element-highlight t)) | ||
97 | |||
98 | (use-package yaml-mode) | ||
99 | |||
100 | (use-package docker) | ||
101 | |||
102 | (jd/leader-key-def | ||
103 | "d" '(:ignore t :which-key "Docker") | ||
104 | "dc" '(docker-containers :which-key "Docker containers") | ||
105 | "dd" '(docker :which-key "Docker")) | ||
106 | |||
107 | (use-package company | ||
108 | :after lsp-mode | ||
109 | :hook (lsp-mode . company-mode) | ||
110 | :bind (:map company-active-map | ||
111 | ("<tab>" . company-complete-selection)) | ||
112 | (:map lsp-mode-map | ||
113 | ("<tab>" . company-indent-or-complete-common)) | ||
114 | :custom | ||
115 | (company-minimum-prefix-length 1) | ||
116 | (company-idle-delay 0.0) | ||
117 | :config | ||
118 | (global-company-mode)) | ||
119 | |||
120 | (use-package company-box | ||
121 | :hook (company-mode . company-box-mode)) | ||
122 | |||
123 | (use-package projectile | ||
124 | :diminish projectile-mode | ||
125 | :init | ||
126 | (when (file-directory-p "~/Documents/code") | ||
127 | (setq projectile-project-search-path '("~/Documents/code/"))) | ||
128 | :custom ((projectile-Completion-system 'ivy)) | ||
129 | :config | ||
130 | (setq projectile-switch-project-action #'projectile-dired) | ||
131 | (projectile-mode)) | ||
132 | |||
133 | (jd/leader-key-def | ||
134 | "p" '(projectile-command-map :which-key "Project") | ||
135 | "p <ESC>" '() | ||
136 | "SPC" '(projectile-find-file :which-key "Find file in project")) | ||
137 | |||
138 | (defun jd/neotree-project-dir () | ||
139 | "Open NeoTree using the git root." | ||
140 | (interactive) | ||
141 | (let ((project-dir (projectile-project-root)) | ||
142 | (file-name (buffer-file-name))) | ||
143 | (neotree-toggle) | ||
144 | (if project-dir | ||
145 | (if (neo-global--window-exists-p) | ||
146 | (progn | ||
147 | (neotree-dir project-dir) | ||
148 | (neotree-find file-name))) | ||
149 | (message "Could not find git project root.")))) | ||
150 | |||
151 | (use-package neotree | ||
152 | :init | ||
153 | (setq neo-theme 'icons) | ||
154 | :config | ||
155 | |||
156 | (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) | ||
157 | (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look) | ||
158 | (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) | ||
159 | (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) | ||
160 | (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) | ||
161 | (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) | ||
162 | (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle)) | ||
163 | |||
164 | (jd/leader-key-def | ||
165 | "op" '(jd/neotree-project-dir :which-key "Open neotree")) | ||
166 | |||
167 | (use-package magit | ||
168 | :custom | ||
169 | (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) | ||
170 | |||
171 | (jd/leader-key-def | ||
172 | "g" '(:ignore t :which-key "Git") | ||
173 | "gg" '(magit-status-here :which-key "Magit status")) | ||
174 | |||
175 | ;;; jd-dev.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-init.el b/.config/emacs/jd-emacs/jd-emacs-init.el new file mode 100644 index 0000000..7f80cac --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-init.el | |||
@@ -0,0 +1,81 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defvar jd-emacs/directory | ||
7 | (concat user-emacs-directory | ||
8 | "/jd-emacs/") | ||
9 | "Path to jd-emacs config directory.") | ||
10 | |||
11 | (defun jd-emacs/load (file-name) | ||
12 | "Load file from jd-emacs directory. | ||
13 | FILE-NAME - file name to load." | ||
14 | (let ((file (expand-file-name (concat jd-emacs/directory | ||
15 | "jd-emacs-" file-name ".el")))) | ||
16 | (load file))) | ||
17 | |||
18 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
19 | |||
20 | |||
21 | (defun jd/display-startup-time () | ||
22 | (message "Emacs loaded in %s with %d garbage collections." | ||
23 | (format "%.2f seconds" | ||
24 | (float-time | ||
25 | (time-subtract after-init-time before-init-time))) | ||
26 | gcs-done)) | ||
27 | |||
28 | |||
29 | (defun jd-emacs/startup () | ||
30 | "This procedure will run after Emacs startup." | ||
31 | (electric-pair-mode 1) | ||
32 | (global-company-mode 1) | ||
33 | (jd/display-startup-time)) | ||
34 | |||
35 | (setq gc-cons-threshold (* 50 1000 1000)) | ||
36 | (add-hook 'emacs-startup-hook #'jd-emacs/startup) | ||
37 | |||
38 | (setq user-full-name "Jakub Dlugosz" | ||
39 | user-mail-address "jdlugosz963@gmail.com") | ||
40 | |||
41 | (setq backup-directory-alist '(("." . "~/.cache/emacs/backup")) | ||
42 | backup-by-copying t | ||
43 | version-control t | ||
44 | delete-old-versions t | ||
45 | kept-new-versions 20 | ||
46 | kept-old-versions 5) | ||
47 | |||
48 | (setq user-emacs-directory "~/.cache/emacs") | ||
49 | |||
50 | (require 'package) | ||
51 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") | ||
52 | ("org" . "https://orgmode.org/elpa/") | ||
53 | ("gnu-devel" . "https://elpa.gnu.org/devel/") | ||
54 | ("elpa" . "https://elpa.gnu.org/packages/"))) | ||
55 | (package-initialize) | ||
56 | |||
57 | (unless package-archive-contents | ||
58 | (package-refresh-contents)) | ||
59 | |||
60 | (unless (package-installed-p 'use-package) | ||
61 | (package-install 'use-package)) | ||
62 | |||
63 | (setq use-package-always-ensure t) | ||
64 | |||
65 | (add-to-list 'load-path (expand-file-name "~/.config/emacs/jd/")) | ||
66 | |||
67 | (require 'use-package) | ||
68 | |||
69 | |||
70 | (jd-emacs/load "keys") | ||
71 | (jd-emacs/load "ui") | ||
72 | (jd-emacs/load "org-mode") | ||
73 | (jd-emacs/load "dev") | ||
74 | (jd-emacs/load "apps") | ||
75 | (jd-emacs/load "custom") | ||
76 | |||
77 | |||
78 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
79 | |||
80 | |||
81 | ;; jd-int.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-keys.el b/.config/emacs/jd-emacs/jd-emacs-keys.el new file mode 100644 index 0000000..cf7f06c --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-keys.el | |||
@@ -0,0 +1,51 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (use-package general | ||
7 | :config | ||
8 | (general-create-definer jd/leader-key-def | ||
9 | :keymaps '(normal insert visual emacs) | ||
10 | :prefix "SPC" | ||
11 | :global-prefix "C-SPC") | ||
12 | |||
13 | (general-create-definer jd/ctrl-c-keys | ||
14 | :prefix "C-c")) | ||
15 | |||
16 | (use-package undo-tree | ||
17 | :diminish | ||
18 | :config | ||
19 | (setq undo-tree-auto-save-history nil) | ||
20 | (global-undo-tree-mode 1)) | ||
21 | |||
22 | (use-package evil | ||
23 | :init | ||
24 | (setq evil-want-integration t) | ||
25 | (setq evil-want-keybinding nil) | ||
26 | (setq evil-want-C-u-scroll t) | ||
27 | (setq evil-want-Y-yank-to-eol t) | ||
28 | (setq evil-want-C-i-jump nil) | ||
29 | (setq evil-undo-system 'undo-tree) | ||
30 | (setq evil-kill-on-visual-paste nil) | ||
31 | :config | ||
32 | (evil-set-initial-state 'exwm-mode 'emacs) | ||
33 | (evil-mode 1)) | ||
34 | |||
35 | (use-package evil-collection | ||
36 | :after evil | ||
37 | :config | ||
38 | (evil-collection-init)) | ||
39 | |||
40 | (jd/leader-key-def | ||
41 | "w" 'evil-window-map | ||
42 | "wr" '(hydra-resize-window/body :which-key "Rezize window") | ||
43 | "wd" '(evil-window-delete :which-key "Window delete")) | ||
44 | |||
45 | (jd/leader-key-def | ||
46 | "ou" '(undo-tree-visualize :which-key "Open")) | ||
47 | |||
48 | ;; remove . key | ||
49 | (define-key evil-normal-state-map (kbd ".") '()) | ||
50 | |||
51 | ;;; jd-keys.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-org-mode.el b/.config/emacs/jd-emacs/jd-emacs-org-mode.el new file mode 100644 index 0000000..0e5ae42 --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-org-mode.el | |||
@@ -0,0 +1,200 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defvar jd/org-home "~/Documents/Org") | ||
7 | (defvar jd/org-roam-home (concat jd/org-home "/roam")) | ||
8 | (defvar jd/org-roam-daily-home (concat jd/org-home "/roam/daily")) | ||
9 | |||
10 | (defun jd/org-mode-init () | ||
11 | (org-indent-mode) | ||
12 | (variable-pitch-mode 1) | ||
13 | (visual-line-mode 1)) | ||
14 | |||
15 | ;; (defun jd-emacs/org-insert-date (&optional date) | ||
16 | ;; (let ((d (or date "+0d"))) | ||
17 | ;; (org-insert-time-stamp (org-read-date nil t d)))) TODO | ||
18 | |||
19 | |||
20 | (use-package org | ||
21 | :pin org | ||
22 | :commands (org-capture org-agenda) | ||
23 | :hook (org-mode . jd/org-mode-init) | ||
24 | :config | ||
25 | (setq org-directory (file-truename "~/Documents/Org/")) | ||
26 | (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) | ||
27 | (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg") | ||
28 | (setq org-agenda-files | ||
29 | '("Tasks.org")) | ||
30 | (setq org-ellipsis " ▾") | ||
31 | (setq org-agenda-start-with-log-mode t) | ||
32 | (setq org-log-done 'time) | ||
33 | (setq org-log-into-drawer t) | ||
34 | (setq org-return-follows-link t) | ||
35 | (setq org-capture-templates | ||
36 | `(("t" "Tasks / Projects") | ||
37 | ("tt" "Task" entry (file+olp "Tasks.org" "Inbox") | ||
38 | "* TODO %?\n %t\n %a\n %i" :empty-lines 1) | ||
39 | ("tT" "Task for tomorow" entry (file+olp "Tasks.org" "Inbox") | ||
40 | "* TODO %?\n %t\n SCHEDULED: %(jd-emacs/org-insert-date \"+1d\")>\n %a\n %i" :empty-lines 1) | ||
41 | |||
42 | ("m" "Metrics Capture") | ||
43 | ("mm" "Metrics" table-line (file+headline "Metrics.org" "Metrics") | ||
44 | "| %U | %^{Weight} | %^{Waist} | %^{Notes} |" :kill-buffer t) | ||
45 | ("sh" "School Homework" entry (file+olp "school/todo(jd-emacs/org-insert-date \"1\").org")))) | ||
46 | |||
47 | (setq org-latex-listings 'minted | ||
48 | org-latex-packages-alist '(("" "minted")) | ||
49 | org-latex-pdf-process | ||
50 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | ||
51 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | ||
52 | (require 'org-tempo)) | ||
53 | (jd/leader-key-def | ||
54 | "o" '(:ignore t :which-key "Open/Org") | ||
55 | "oc" '(org-capture :which-key "Open org-capture") | ||
56 | "oop" '(org-mobile-pull :which-key "Org mobile pull") | ||
57 | "ooP" '(org-mobile-push :which-key "Org mobile push") | ||
58 | "oa" '(org-agenda :which-key "Open org-agenda")) | ||
59 | |||
60 | (use-package evil-org | ||
61 | :after org | ||
62 | :hook (org-mode . (lambda () evil-org-mode)) | ||
63 | :config | ||
64 | (require 'evil-org-agenda) | ||
65 | (evil-org-agenda-set-keys)) | ||
66 | |||
67 | (use-package toc-org | ||
68 | :config | ||
69 | (add-hook 'org-mode-hook 'toc-org-mode)) | ||
70 | |||
71 | (defun jd/org-font-setup () | ||
72 | ;; Replace list hyphen with dot | ||
73 | (font-lock-add-keywords 'org-mode | ||
74 | '(("^ *\\([-]\\) " | ||
75 | (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•-")))))) | ||
76 | |||
77 | ;; Set faces for heading levels | ||
78 | (dolist (face '((org-level-1 . 1.3) | ||
79 | (org-level-2 . 1.2) | ||
80 | (org-level-3 . 1.1) | ||
81 | (org-level-4 . 1.0) | ||
82 | (org-level-5 . 1.0) | ||
83 | (org-level-6 . 1.0) | ||
84 | (org-level-7 . 1.0) | ||
85 | (org-level-8 . 1.0))) | ||
86 | (set-face-attribute (car face) nil :font "Terminus" :weight 'Bold :height (cdr face))) | ||
87 | |||
88 | ;; Ensure that anything that should be fixed-pitch in Org files appears that way | ||
89 | (set-face-attribute 'org-block nil :font "Terminus" :inherit 'fixed-pitch :height 100) | ||
90 | (set-face-attribute 'org-table nil :inherit 'fixed-pitch) | ||
91 | (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) | ||
92 | (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) | ||
93 | (set-face-attribute 'org-table nil :font "Terminus" :inherit '(shadow fixed-pitch)) | ||
94 | (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) | ||
95 | (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
96 | (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
97 | (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) | ||
98 | (set-face-attribute 'line-number nil :inherit 'fixed-pitch) | ||
99 | (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) | ||
100 | |||
101 | (with-eval-after-load 'org (jd/org-font-setup)) | ||
102 | |||
103 | (defun jd-emacs/org-timer-stop () | ||
104 | (start-process-shell-command "notify-send" nil "notify-send Zakonczono odliczanie")) | ||
105 | |||
106 | |||
107 | (add-hook 'org-timer-stop-hook #'jd-emacs/org-timer-stop) | ||
108 | |||
109 | (defun jd/org-tempo-setup () | ||
110 | (add-to-list 'org-structure-template-alist '("s" . "src")) | ||
111 | (add-to-list 'org-structure-template-alist '("sql" . "src sql")) | ||
112 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) | ||
113 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) | ||
114 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) | ||
115 | (add-to-list 'org-structure-template-alist '("sc" . "src scheme")) | ||
116 | (add-to-list 'org-structure-template-alist '("ts" . "src typescript")) | ||
117 | (add-to-list 'org-structure-template-alist '("py" . "src python")) | ||
118 | (add-to-list 'org-structure-template-alist '("go" . "src go")) | ||
119 | (add-to-list 'org-structure-template-alist '("yaml" . "src yaml"))) | ||
120 | |||
121 | (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) | ||
122 | |||
123 | (org-babel-do-load-languages | ||
124 | 'org-babel-load-languages | ||
125 | '((emacs-lisp . t) | ||
126 | (python . t))) | ||
127 | |||
128 | (defun jd/org-babel-tangle-config () | ||
129 | (when (string-equal (file-name-directory (buffer-file-name)) | ||
130 | (expand-file-name "~/dotfiles/")) | ||
131 | ;; Dynamic scoping to the rescue | ||
132 | (let ((org-confirm-babel-evaluate nil)) | ||
133 | (org-babel-tangle)))) | ||
134 | |||
135 | (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'jd/org-babel-tangle-config))) | ||
136 | |||
137 | (defun jd/org-mode-visual-fill () | ||
138 | (setq visual-fill-column-width 100 | ||
139 | visual-fill-column-center-text t) | ||
140 | (visual-fill-column-mode 1)) | ||
141 | |||
142 | (use-package visual-fill-column | ||
143 | :hook (org-mode . jd/org-mode-visual-fill)) | ||
144 | |||
145 | (use-package org-superstar | ||
146 | :hook (org-mode . org-superstar-mode) | ||
147 | :init | ||
148 | (setq org-superstar-special-todo-items t) | ||
149 | (setq org-superstar-remove-leading-stars t) | ||
150 | (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) | ||
151 | |||
152 | (defun jd/org-roam-filter-by-tag (tag-name) | ||
153 | (lambda (node) | ||
154 | (member tag-name (org-roam-node-tags node)))) | ||
155 | |||
156 | (defun jd/org-roam-list-notes-by-tag (tag-name) | ||
157 | (mapcar #'org-roam-node-file | ||
158 | (seq-filter | ||
159 | (jd/org-roam-filter-by-tag tag-name) | ||
160 | (org-roam-node-list)))) | ||
161 | |||
162 | (defun jd/org-roam-refreshagenda-list () | ||
163 | (interactive) | ||
164 | (setq org-agenda-files (org-roam-list-files))) | ||
165 | |||
166 | (use-package org-roam | ||
167 | :custom | ||
168 | (org-roam-directory (file-truename jd/org-roam-home)) | ||
169 | :bind (("C-c n l" . org-roam-buffer-toggle) | ||
170 | ("C-c n f" . org-roam-node-find) | ||
171 | ("C-c n g" . org-roam-graph) | ||
172 | ("C-c n i" . org-roam-node-insert) | ||
173 | ("C-c n c" . org-roam-capture) | ||
174 | ;; Dailies | ||
175 | ("C-c n j" . org-roam-dailies-capture-today)) | ||
176 | :bind-keymap | ||
177 | ("C-c n d" . org-roam-dailies-map) | ||
178 | :config | ||
179 | ;; If you're using a vertical completion framework, you might want a more informative completion interface | ||
180 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) | ||
181 | (setq org-roam-capture-templates | ||
182 | '(("a" "workstuff" plain (file (concat org-roam-directory "/work")) | ||
183 | :target (file+head "work/%<%Y%m%d%H%M%S>-${slug}.org" | ||
184 | "#+title: ${title}\n") :unnarrowed t) | ||
185 | ("b" "research" plain (file "~/Documents/roam/study/templates/research.org") | ||
186 | :target (file+head "study/%<%Y%m%d%H%M%S>-${slug}.org" | ||
187 | "#+title: ${title}\n") :unnarrowed t) | ||
188 | ("s" "School" plain nil | ||
189 | :target (file+head | ||
190 | "school/%<%Y%m%d%H%M%S>-${slug}.org" | ||
191 | "#+title: ${title}\n") | ||
192 | :unnarrowed t) | ||
193 | ("d" "default" plain nil | ||
194 | :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" | ||
195 | "#+title: ${title}\n") :unnarrowed t) | ||
196 | )) | ||
197 | |||
198 | (org-roam-db-autosync-mode)) | ||
199 | |||
200 | ;;; jd-emacs-org-mode.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-ui.el b/.config/emacs/jd-emacs/jd-emacs-ui.el new file mode 100644 index 0000000..c8236af --- /dev/null +++ b/.config/emacs/jd-emacs/jd-emacs-ui.el | |||
@@ -0,0 +1,154 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (setq inhibit-startup-message t) | ||
7 | (setq visible-bell t) | ||
8 | (scroll-bar-mode -1) | ||
9 | (tool-bar-mode -1) | ||
10 | (tooltip-mode -1) | ||
11 | (menu-bar-mode -1) | ||
12 | (set-fringe-mode 10) | ||
13 | |||
14 | (set-face-attribute 'default nil :font "Terminus" :height 100) | ||
15 | |||
16 | (add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) | ||
17 | |||
18 | (global-set-key (kbd "<escape>") 'keyboard-escape-quit) | ||
19 | |||
20 | (global-prettify-symbols-mode 1) | ||
21 | |||
22 | (defalias 'yes-or-no-p 'y-or-n-p) | ||
23 | |||
24 | (use-package doom-themes | ||
25 | :config | ||
26 | (load-theme 'ujelly t)) | ||
27 | |||
28 | (use-package diminish) | ||
29 | |||
30 | (use-package hl-todo | ||
31 | :init | ||
32 | (setq hl-todo-keyword-faces | ||
33 | '(("TODO" . "#FF0000") | ||
34 | ("FIXME" . "#FF0000") | ||
35 | ("DEBUG" . "#A020F0"))) | ||
36 | :config | ||
37 | (global-hl-todo-mode 1)) | ||
38 | |||
39 | (defun jd/switch-buffer () | ||
40 | (interactive) | ||
41 | (let ((completion-regexp-list '("\\`[^*]" | ||
42 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) | ||
43 | (call-interactively 'counsel-switch-buffer))) | ||
44 | |||
45 | (defvar jd/load-theme-hook nil) | ||
46 | (defun jd/load-theme () | ||
47 | (interactive) | ||
48 | (counsel-load-theme) | ||
49 | (run-hooks 'jd/load-theme-hook)) | ||
50 | |||
51 | (use-package ivy | ||
52 | :diminish | ||
53 | :bind | ||
54 | (("C-s" . swiper) | ||
55 | :map ivy-minibuffer-map | ||
56 | ("C-k" . ivy-previous-line) | ||
57 | ("C-j" . ivy-next-line) | ||
58 | :map ivy-switch-buffer-map | ||
59 | ("C-k" . ivy-previous-line)) | ||
60 | :config | ||
61 | (ivy-mode 1)) | ||
62 | |||
63 | (use-package counsel | ||
64 | :config | ||
65 | (counsel-mode 1)) | ||
66 | |||
67 | (jd/leader-key-def | ||
68 | "t" '(:ignore t :which-key "Toggle") | ||
69 | "tT" '(toggle-truncate-lines :which-key "Toggle truncate lines") | ||
70 | "tt" '(jd/load-theme :which-key "Choose theme")) | ||
71 | |||
72 | (jd/leader-key-def | ||
73 | "bb" '(jd/switch-buffer :which-key "Buffer switch") | ||
74 | "ba" '(counsel-switch-buffer :which-key "Buffer switch") | ||
75 | "b" '(:ignore t :which-key "Buffer") | ||
76 | "," '(counsel-switch-buffer :which-key "Buffer switch")) | ||
77 | |||
78 | (use-package which-key | ||
79 | :diminish | ||
80 | :config | ||
81 | (which-key-mode) | ||
82 | (setq which-key-idle-delay 0.3)) | ||
83 | |||
84 | (use-package all-the-icons) | ||
85 | |||
86 | (use-package doom-modeline | ||
87 | ; :init (doom-modeline-mode 0) | ||
88 | :custom ((doom-modeline-height 15))) | ||
89 | |||
90 | (use-package hydra | ||
91 | :defer t) | ||
92 | |||
93 | (defun jd/text-scale-increase () | ||
94 | (interactive) | ||
95 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
96 | (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) | ||
97 | |||
98 | (defun jd/text-scale-decrease () | ||
99 | (interactive) | ||
100 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
101 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) | ||
102 | |||
103 | (defhydra hydra-resize-window (:timeout 4) | ||
104 | ("h" evil-window-decrease-width "<") | ||
105 | ("l" evil-window-increase-width ">") | ||
106 | ("k" evil-window-decrease-height "^") | ||
107 | ("j" evil-window-increase-height "v") | ||
108 | ("q" nil "finished" :exit t)) | ||
109 | |||
110 | (defhydra hydra-text-scale-global (:timeout 4) | ||
111 | "scale text" | ||
112 | ("j" jd/text-scale-increase "in") | ||
113 | ("k" jd/text-scale-decrease "out") | ||
114 | ("q" nil "finished" :exit t)) | ||
115 | |||
116 | (defhydra hydra-text-scale (:timeout 4) | ||
117 | "scale text" | ||
118 | ("j" text-scale-increase "in") | ||
119 | ("k" text-scale-decrease "out") | ||
120 | ("q" nil "finished" :exit t)) | ||
121 | |||
122 | (jd/leader-key-def | ||
123 | "tS" '(hydra-text-scale-global/body :which-key "Scale text") | ||
124 | "ts" '(hydra-text-scale/body :which-key "Scale text")) | ||
125 | |||
126 | (use-package beacon | ||
127 | :config | ||
128 | (beacon-mode 1)) | ||
129 | |||
130 | (jd/leader-key-def | ||
131 | "f" '(:ignore t :which-key "Files") | ||
132 | "fs" '(save-buffer :which-key "File save") | ||
133 | "." '(find-file :which-key "Find file") | ||
134 | "ff" '(find-file :which-key "Find file")) | ||
135 | |||
136 | (jd/leader-key-def | ||
137 | "e" '(:ignore t :which-key "Eval") | ||
138 | "eb" '(eval-buffer :which-key "Eval buffer") | ||
139 | "ee" '(eval-defun :which-key "Eval defun")) | ||
140 | |||
141 | (jd/leader-key-def | ||
142 | :keymaps '(visual) | ||
143 | "er" '(eval-region :which-key "Eval region")) | ||
144 | |||
145 | (defun jd/kill-other-buffers () | ||
146 | (interactive) | ||
147 | (mapc 'kill-buffer (cdr (buffer-list (current-buffer))))) | ||
148 | |||
149 | (jd/leader-key-def | ||
150 | "bK" '(jd/kill-other-buffers :which-key "Kill other buffers") | ||
151 | "bk" '(kill-current-buffer :which-key "Kill buffer") | ||
152 | "bB" '(ibuffer :which-key "Open ibuffer")) | ||
153 | |||
154 | ;;; jd-ui.el ends here | ||
diff --git a/.config/emacs/jd-exwm/init.el b/.config/emacs/jd-exwm/init.el new file mode 100644 index 0000000..cf043fb --- /dev/null +++ b/.config/emacs/jd-exwm/init.el | |||
@@ -0,0 +1,149 @@ | |||
1 | (defun jd/exwm-update-class () | ||
2 | (exwm-workspace-rename-buffer exwm-class-name)) | ||
3 | |||
4 | (defun jd-exwm/run-in-background (command) | ||
5 | (let ((command-parts (split-string command "[ ]+"))) | ||
6 | (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) | ||
7 | |||
8 | (defun jd-exwm/restart-process (program-name) | ||
9 | (call-process "killall" nil nil nil program-name) | ||
10 | (jd-exwm/run-in-background program-name)) | ||
11 | |||
12 | (defun jd-exwm/exwm-init-hook () | ||
13 | (jd-exwm/run-in-background "nitrogen --restore") | ||
14 | (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") | ||
15 | (start-process-shell-command "syndaemon" nil "syndaemon -i 0.8 -K -R -d") | ||
16 | |||
17 | (jd-exwm/restart-process "polybar") | ||
18 | (jd-exwm/restart-process "nm-applet") | ||
19 | (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") | ||
20 | (jd-exwm/restart-process "blueman-applet")) | ||
21 | |||
22 | (defun jd-exwm/exwm-update-title () | ||
23 | (exwm-workspace-rename-buffer exwm-title)) | ||
24 | |||
25 | (defun jd-exwm/configure-window-by-class () | ||
26 | (interactive) | ||
27 | (pcase exwm-class-name | ||
28 | ("firefox" (exwm-workspace-move-window 2)) | ||
29 | ("Brave" (exwm-workspace-move-window 2)) | ||
30 | ("qutebrowser" (exwm-workspace-move-window 2)) | ||
31 | ("discord" (exwm-workspace-move-window 5)) | ||
32 | ("obs" (exwm-workspace-move-window 5)) | ||
33 | ("Virt-manager" (exwm-workspace-move-window 4)))) | ||
34 | |||
35 | (use-package exwm | ||
36 | :config | ||
37 | (setq exwm-workspace-number 10) | ||
38 | |||
39 | (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) | ||
40 | (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) | ||
41 | (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) | ||
42 | (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) | ||
43 | |||
44 | (require 'exwm-randr) | ||
45 | (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) | ||
46 | (exwm-randr-enable) | ||
47 | |||
48 | (setq exwm-input-simulation-keys | ||
49 | '(([?\C-h] . [left]) | ||
50 | ([?\C-l] . [right]) | ||
51 | ([?\C-k] . [up]) | ||
52 | ([?\C-j] . [down]))) | ||
53 | |||
54 | (setq exwm-input-prefix-keys | ||
55 | '(?\C-x | ||
56 | ?\C-u | ||
57 | ?\C-h | ||
58 | ?\M-x | ||
59 | ?\M-` | ||
60 | ?\M-& | ||
61 | ?\M-: | ||
62 | ?\C-\M-j | ||
63 | ?\C-\ )) | ||
64 | |||
65 | (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) | ||
66 | (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) | ||
67 | |||
68 | (setq exwm-input-global-keys | ||
69 | `(([?\s-R] . exwm-reset) | ||
70 | |||
71 | |||
72 | ([?\s-r] . (lambda (command) | ||
73 | (interactive (list (read-shell-command "$ "))) | ||
74 | (start-process-shell-command command nil command))) | ||
75 | |||
76 | ([?\s-W] . exwm-workspace-move-window) | ||
77 | ([?\s-w] . exwm-workspace-switch) | ||
78 | |||
79 | ,@(mapcar (lambda (i) | ||
80 | `(,(kbd (format "s-%d" i)) . | ||
81 | (lambda () | ||
82 | (interactive) | ||
83 | (exwm-workspace-switch-create ,i)))) | ||
84 | (number-sequence 0 9)))) | ||
85 | |||
86 | (exwm-enable)) | ||
87 | |||
88 | (use-package desktop-environment | ||
89 | :after exwm | ||
90 | :config (desktop-environment-mode) | ||
91 | :custom | ||
92 | (desktop-environment-brightness-small-increment "2%+") | ||
93 | (desktop-environment-brightness-small-decrement "2%-") | ||
94 | (desktop-environment-brightness-normal-increment "5%+") | ||
95 | (desktop-environment-brightness-normal-decrement "5%-")) | ||
96 | |||
97 | (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) | ||
98 | (add-to-list 'default-frame-alist `(alpha . (90 . 90))) | ||
99 | (set-frame-parameter (selected-frame) 'fullscreen 'maximized) | ||
100 | (add-to-list 'default-frame-alist '(fullscreen . maximized)) | ||
101 | |||
102 | (defun jd-exwm/get-color (ATTRIBUTE) | ||
103 | (face-attribute 'default ATTRIBUTE)) | ||
104 | |||
105 | (defun theme-to-xresources () | ||
106 | (interactive) | ||
107 | (require 'term) | ||
108 | (with-temp-buffer | ||
109 | (insert "! Generated by theme-to-xresources\n") | ||
110 | (dolist (spec | ||
111 | '(("emacs.background" :background "E6") | ||
112 | ("emacs.foreground" :foreground ""))) | ||
113 | (let ((color (jd-exwm/get-color (cadr spec)))) | ||
114 | (insert (format "%s: #%s%s\n" | ||
115 | (car spec) | ||
116 | (caddr spec) | ||
117 | (string-remove-prefix "#" color)))) | ||
118 | (write-region (point-min) (point-max) "~/.Xresources"))) | ||
119 | (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources"))) | ||
120 | |||
121 | (defun jd/theme-sync () | ||
122 | (interactive) | ||
123 | (theme-to-xresources) | ||
124 | (setq org-confirm-babel-evaluate nil) | ||
125 | (org-babel-tangle-file "~/dotfiles/Desktop.org") | ||
126 | (setq org-confirm-babel-evaluate 't) | ||
127 | (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history | ||
128 | (jd-exwm/restart-process "polybar")) | ||
129 | |||
130 | (add-hook 'jd/load-theme-hook #'jd/theme-sync) | ||
131 | (add-hook 'exwm-init-hook #'jd/theme-sync) | ||
132 | |||
133 | (defun jd/dunst-show-history () | ||
134 | (interactive) | ||
135 | (start-process-shell-command "dunstctl" nil "dunstctl history-pop")) | ||
136 | |||
137 | (defun jd/dunst-close () | ||
138 | (interactive) | ||
139 | (start-process-shell-command "dunstctl" nil "dunstctl close")) | ||
140 | |||
141 | (defun jd/dunst-close-all () | ||
142 | (interactive) | ||
143 | (start-process-shell-command "dunstctl" nil "dunstctl close-all")) | ||
144 | |||
145 | (jd/leader-key-def | ||
146 | "d" '(nil :which-key "dunst") | ||
147 | "dh" '(jd/dunst-show-history :which-key "show history") | ||
148 | "dc" '(jd/dunst-close :which-key "close") | ||
149 | "da" '(jd/dunst-close-all :which-key "close all")) | ||
diff --git a/.config/emacs/exwm/start.sh b/.config/emacs/jd-exwm/start.sh index 127e858..98149b6 100644 --- a/.config/emacs/exwm/start.sh +++ b/.config/emacs/jd-exwm/start.sh | |||
@@ -1,6 +1,6 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | picom & | 3 | # picom & |
4 | 4 | ||
5 | xss-lock -- slock & | 5 | xss-lock -- slock & |
6 | 6 | ||
@@ -8,5 +8,8 @@ export VISUAL="emacsclient -a vim" | |||
8 | export EDITOR="$VISUAL" | 8 | export EDITOR="$VISUAL" |
9 | export GTK_THEME="Adwaita:dark" | 9 | export GTK_THEME="Adwaita:dark" |
10 | export CALIBRE_USE_DARK_PALETTE=1 | 10 | export CALIBRE_USE_DARK_PALETTE=1 |
11 | export JD_EXWM=1 | ||
12 | |||
13 | gentoo-pipewire-launcher & | ||
11 | 14 | ||
12 | exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el | 15 | exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el |
diff --git a/.config/emacs/jd/jd-mu4e.el b/.config/emacs/jd/jd-mu4e.el index cc0eb24..0f45f15 100644 --- a/.config/emacs/jd/jd-mu4e.el +++ b/.config/emacs/jd/jd-mu4e.el | |||
@@ -1,13 +1,14 @@ | |||
1 | (add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e") | 1 | (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") |
2 | 2 | ||
3 | (use-package org-msg) | 3 | (use-package org-msg) |
4 | 4 | ||
5 | (use-package mu4e | 5 | (use-package mu4e |
6 | :defer 20 | 6 | :defer 10 |
7 | :ensure nil | 7 | :ensure nil |
8 | :config | 8 | :config |
9 | (require 'org-mu4e) | 9 | (require 'org-mu4e) |
10 | 10 | ||
11 | (setq mu4e-mu-binary "/usr/local/bin/mu") | ||
11 | (setq mu4e-update-interval (* 10 60)) | 12 | (setq mu4e-update-interval (* 10 60)) |
12 | (setq mu4e-get-mail-command "mbsync -a") | 13 | (setq mu4e-get-mail-command "mbsync -a") |
13 | (setq mu4e-maildir "~/Mail") | 14 | (setq mu4e-maildir "~/Mail") |
@@ -54,12 +55,22 @@ | |||
54 | smtpmail-smtp-service 465 | 55 | smtpmail-smtp-service 465 |
55 | smtpmail-stream-type 'ssl) | 56 | smtpmail-stream-type 'ssl) |
56 | 57 | ||
58 | (setq mu4e-compose-signature (concat | ||
59 | "Pozdrawiam,\n" | ||
60 | "Jakub Długosz")) | ||
61 | |||
57 | (mu4e t)) | 62 | (mu4e t)) |
58 | 63 | ||
64 | (use-package mu4e-alert | ||
65 | :defer 20 | ||
66 | :config | ||
67 | (mu4e-alert-set-default-style 'libnotify) | ||
68 | (mu4e-alert-enable-mode-line-display) | ||
69 | (mu4e-alert-enable-notifications)) | ||
70 | |||
59 | (jd/leader-key-def | 71 | (jd/leader-key-def |
60 | "m" '(:ignore t :which-key "mail") | 72 | "m" '(:ignore t :which-key "mail") |
61 | "mm" 'mu4e | 73 | "mm" 'mu4e |
62 | "mc" 'mu4e-compose-new) | 74 | "mc" 'mu4e-compose-new) |
63 | 75 | ||
64 | |||
65 | (provide 'jd-mu4e) | 76 | (provide 'jd-mu4e) |
diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini index 4af4e40..d43ee51 100644 --- a/.config/polybar/config.ini +++ b/.config/polybar/config.ini | |||
@@ -1,6 +1,5 @@ | |||
1 | [settings] | 1 | [settings] |
2 | screenchange-reload = true | 2 | screenchange-reload = true |
3 | pseudo-transparency = true | ||
4 | 3 | ||
5 | [colors] | 4 | [colors] |
6 | background = ${xrdb:emacs.background} | 5 | background = ${xrdb:emacs.background} |
@@ -25,7 +24,7 @@ module-margin = 1 | |||
25 | separator = | | 24 | separator = | |
26 | separator-foreground = ${colors.disabled} | 25 | separator-foreground = ${colors.disabled} |
27 | 26 | ||
28 | font-0 = "sourcecodepro:size=11" | 27 | font-0 = "Terminus:size=15" |
29 | font-1 = "FontAwesome" | 28 | font-1 = "FontAwesome" |
30 | 29 | ||
31 | modules-left = xworkspaces | 30 | modules-left = xworkspaces |