diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 15:07:07 +0200 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2023-07-02 15:07:07 +0200 |
commit | 6156f86dd5797de5ea4f912b70d38963c6cf4ad4 (patch) | |
tree | d578204262209695d995e3f639076e91dcb85354 | |
parent | ef565a486511cbbb86e0d1f80264b3b57d2ac88a (diff) | |
download | dotfiles-6156f86dd5797de5ea4f912b70d38963c6cf4ad4.tar.gz dotfiles-6156f86dd5797de5ea4f912b70d38963c6cf4ad4.zip |
New Emacs config and change location of Emacs home dir.
-rw-r--r-- | .config/emacs/init.el | 17 | ||||
-rw-r--r-- | .config/emacs/jd-emacs/jd-emacs-apps.el | 88 | ||||
-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 | 15 | ||||
-rw-r--r-- | .emacs.d/.gitignore | 9 | ||||
-rwxr-xr-x | .emacs.d/init.el | 122 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-apps.el | 87 | ||||
-rwxr-xr-x[-rw-r--r--] | .emacs.d/jd/jd-custom.el (renamed from .config/emacs/jd-emacs/jd-emacs-custom.el) | 15 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-dev.el | 173 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-exwm.el | 171 | ||||
-rwxr-xr-x[-rw-r--r--] | .emacs.d/jd/jd-gym.el (renamed from .config/emacs/jd/jd-gym.el) | 0 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-keys.el | 115 | ||||
-rwxr-xr-x[-rw-r--r--] | .emacs.d/jd/jd-mu4e.el (renamed from .config/emacs/jd/jd-mu4e.el) | 21 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-org.el | 198 | ||||
-rwxr-xr-x | .emacs.d/jd/jd-ui.el | 102 |
20 files changed, 994 insertions, 949 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el deleted file mode 100644 index 65a8683..0000000 --- a/.config/emacs/init.el +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (defvar jd/exwmp (not (null (getenv "JD_EXWM"))) | ||
7 | "Return non-nil if Emacs is run as a window manager.") | ||
8 | |||
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 | |||
17 | ;;; init.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-apps.el b/.config/emacs/jd-emacs/jd-emacs-apps.el deleted file mode 100644 index 628039d..0000000 --- a/.config/emacs/jd-emacs/jd-emacs-apps.el +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
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-dev.el b/.config/emacs/jd-emacs/jd-emacs-dev.el deleted file mode 100644 index 620a7ad..0000000 --- a/.config/emacs/jd-emacs/jd-emacs-dev.el +++ /dev/null | |||
@@ -1,175 +0,0 @@ | |||
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 deleted file mode 100644 index 7f80cac..0000000 --- a/.config/emacs/jd-emacs/jd-emacs-init.el +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
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 deleted file mode 100644 index cf7f06c..0000000 --- a/.config/emacs/jd-emacs/jd-emacs-keys.el +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
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 deleted file mode 100644 index 0e5ae42..0000000 --- a/.config/emacs/jd-emacs/jd-emacs-org-mode.el +++ /dev/null | |||
@@ -1,200 +0,0 @@ | |||
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 deleted file mode 100644 index c8236af..0000000 --- a/.config/emacs/jd-emacs/jd-emacs-ui.el +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
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 deleted file mode 100644 index cf043fb..0000000 --- a/.config/emacs/jd-exwm/init.el +++ /dev/null | |||
@@ -1,149 +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/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/jd-exwm/start.sh b/.config/emacs/jd-exwm/start.sh deleted file mode 100644 index 98149b6..0000000 --- a/.config/emacs/jd-exwm/start.sh +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # picom & | ||
4 | |||
5 | xss-lock -- slock & | ||
6 | |||
7 | export VISUAL="emacsclient -a vim" | ||
8 | export EDITOR="$VISUAL" | ||
9 | export GTK_THEME="Adwaita:dark" | ||
10 | export CALIBRE_USE_DARK_PALETTE=1 | ||
11 | export JD_EXWM=1 | ||
12 | |||
13 | gentoo-pipewire-launcher & | ||
14 | |||
15 | exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el | ||
diff --git a/.emacs.d/.gitignore b/.emacs.d/.gitignore new file mode 100644 index 0000000..d3d6223 --- /dev/null +++ b/.emacs.d/.gitignore | |||
@@ -0,0 +1,9 @@ | |||
1 | auto-save-list/ | ||
2 | eln-cache/ | ||
3 | elpa/ | ||
4 | eshell/ | ||
5 | transient/ | ||
6 | ido.last | ||
7 | projectile-bookmarks.eld | ||
8 | projects | ||
9 | session.* \ No newline at end of file | ||
diff --git a/.emacs.d/init.el b/.emacs.d/init.el new file mode 100755 index 0000000..d4fc30a --- /dev/null +++ b/.emacs.d/init.el | |||
@@ -0,0 +1,122 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | (setq gc-cons-threshold (* 50 1000 1000)) | ||
7 | |||
8 | (defvar jd/manifest-list | ||
9 | nil | ||
10 | "List that contain Emacs packages for GNU/Guix." ) | ||
11 | |||
12 | (defvar jd/exwm-p | ||
13 | (or (not (null (getenv "JD_EXWM"))) | ||
14 | (and (seq-contains command-line-args "exwm" #'string-match) | ||
15 | t)) | ||
16 | "Is non-nil when Emacs is run as a window manager.") | ||
17 | |||
18 | (defvar jd/guix-p | ||
19 | (and (eq system-type 'gnu/linux) | ||
20 | (file-exists-p "/etc/os-release") | ||
21 | (with-temp-buffer | ||
22 | (insert-file-contents "/etc/os-release") | ||
23 | (search-forward "ID=guix" nil t)) | ||
24 | t) | ||
25 | "Is non-nil when Emacs packages are installed by GNU/Guix package manager.") | ||
26 | |||
27 | (defun jd/add-package-to-manifest (guix-package-name) | ||
28 | "Add GUIX-PACKAGE-NAME to jd/manifest-list." | ||
29 | (unless (member guix-package-name jd/manifest-list) | ||
30 | (setq jd/manifest-list | ||
31 | (cons guix-package-name jd/manifest-list)))) | ||
32 | |||
33 | (add-to-list 'load-path (concat user-emacs-directory "/jd")) | ||
34 | |||
35 | (defun jd/display-startup-time () | ||
36 | (message "Emacs loaded in %s with %d garbage collections." | ||
37 | (format "%.2f seconds" | ||
38 | (float-time | ||
39 | (time-subtract after-init-time before-init-time))) | ||
40 | gcs-done)) | ||
41 | |||
42 | (defun jd-emacs/startup () | ||
43 | "This procedure will run after Emacs startup." | ||
44 | (electric-pair-mode 1) | ||
45 | (global-company-mode 1) | ||
46 | (jd/display-startup-time)) | ||
47 | |||
48 | (add-hook 'emacs-startup-hook #'jd-emacs/startup) | ||
49 | |||
50 | (setq user-full-name "Jakub Dlugosz" | ||
51 | user-mail-address "jdlugosz963@gmail.com") | ||
52 | |||
53 | (setq backup-directory-alist '(("." . "~/.cache/emacs/backup")) | ||
54 | backup-by-copying t | ||
55 | version-control t | ||
56 | delete-old-versions t | ||
57 | kept-new-versions 20 | ||
58 | kept-old-versions 5) | ||
59 | |||
60 | ;; (setq user-emacs-directory "~/.cache/emacs") | ||
61 | |||
62 | (require 'package) | ||
63 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") | ||
64 | ("org" . "https://orgmode.org/elpa/") | ||
65 | ("gnu-devel" . "https://elpa.gnu.org/devel/") | ||
66 | ("elpa" . "https://elpa.gnu.org/packages/"))) | ||
67 | (package-initialize) | ||
68 | |||
69 | (unless package-archive-contents | ||
70 | (package-refresh-contents)) | ||
71 | |||
72 | (jd/add-package-to-manifest "emacs-use-package") | ||
73 | (unless jd/guix-p | ||
74 | (unless (package-installed-p 'use-package) | ||
75 | (package-install 'use-package))) | ||
76 | |||
77 | (require 'use-package) | ||
78 | |||
79 | (setq use-package-always-ensure (not jd/guix-p)) | ||
80 | |||
81 | (defmacro jd/use-package (package-name | ||
82 | guix-package-name | ||
83 | &rest body) | ||
84 | `(progn | ||
85 | ,(when guix-package-name | ||
86 | `(jd/add-package-to-manifest ,guix-package-name)) | ||
87 | (use-package ,package-name ,@body))) | ||
88 | |||
89 | (defun jd/manifest-generate-to-file (file-name) | ||
90 | "Generate GNU/Guix Emacs manifest to output file provided in: FILE-NAME." | ||
91 | (interactive | ||
92 | (list (read-from-minibuffer "Output file: " ))) | ||
93 | (with-temp-file file-name | ||
94 | (insert | ||
95 | (with-temp-buffer | ||
96 | (insert (format ";; This file is auto-generated by Emacs function: jd/manifest-generate-to-file\n%s" | ||
97 | `(specifications->manifest | ||
98 | '(,@(mapcar #'(lambda (guix-package-name) | ||
99 | (concat "\"" | ||
100 | guix-package-name | ||
101 | "\"\n")) | ||
102 | jd/manifest-list))))) | ||
103 | (pp-buffer) | ||
104 | (buffer-string))))) | ||
105 | |||
106 | (jd/add-package-to-manifest "emacs") | ||
107 | (jd/add-package-to-manifest "emacs-guix") | ||
108 | |||
109 | (require 'jd-keys) | ||
110 | (require 'jd-ui) | ||
111 | (require 'jd-org) | ||
112 | (require 'jd-dev) | ||
113 | (require 'jd-apps) | ||
114 | (require 'jd-custom) | ||
115 | (require 'jd-mu4e) | ||
116 | |||
117 | (when jd/exwm-p | ||
118 | (require 'jd-exwm)) | ||
119 | |||
120 | (setq gc-cons-threshold (* 2 1000 1000)) | ||
121 | |||
122 | ;;; init.el ends here | ||
diff --git a/.emacs.d/jd/jd-apps.el b/.emacs.d/jd/jd-apps.el new file mode 100755 index 0000000..5064ff9 --- /dev/null +++ b/.emacs.d/jd/jd-apps.el | |||
@@ -0,0 +1,87 @@ | |||
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 | (jd/use-package vterm "emacs-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 "ot" '(jd/open-new-vterm :which-key "Open terminal in current window"))) | ||
26 | |||
27 | (jd/use-package all-the-icons-dired "emacs-all-the-icons-dired" | ||
28 | :hook (dired-mode . all-the-icons-dired-mode)) | ||
29 | |||
30 | ;; (jd/use-package dired-ranger nil) | ||
31 | |||
32 | (jd/use-package dired nil | ||
33 | :ensure nil | ||
34 | :commands (dired dired-jump) | ||
35 | :custom ((dired-listing-switches "-agho --group-directories-first")) | ||
36 | :config | ||
37 | ;; (evil-collection-define-key 'normal 'dired-mode-map | ||
38 | ;; "y" 'dired-ranger-copy | ||
39 | ;; "p" 'dired-ranger-paste | ||
40 | ;; "X" 'dired-ranger-move | ||
41 | ;; "h" 'dired-up-directory | ||
42 | ;; "t" 'dired-create-empty-file | ||
43 | ;; "T" 'dired-toggle-marks | ||
44 | ;; "l" 'dired-find-file) | ||
45 | (setq dired-kill-when-opening-new-dired-buffer t) | ||
46 | ;; (evil-define-key 'normal dired-mode-map (kbd "q") 'kill-current-buffer) | ||
47 | ) | ||
48 | |||
49 | ;; (jd/use-package emms "emacs-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-browser-covers 'emms-browser-cache-thumbnail-async) | ||
57 | ;; (emms-add-directory-tree "~/Documents/Music/")) | ||
58 | |||
59 | (jd/use-package pdf-tools "emacs-pdf-tools") | ||
60 | |||
61 | (jd/use-package elfeed "emacs-elfeed" | ||
62 | :config | ||
63 | (setq elfeed-feeds | ||
64 | '(("https://www.reddit.com/r/emacs.rss" emacs) | ||
65 | ("https://www.reddit.com/r/gnu.rss" gnu) | ||
66 | ("https://stallman.org/rss/rss.xml" stallman) | ||
67 | ("https://news.ycombinator.com/rss" hacker-news)))) | ||
68 | |||
69 | ;; (jd/use-package langtool | ||
70 | ;; :config | ||
71 | ;; (setq langtool-language-tool-jar "/home/jakub/Documents/LanguageTool-6.0/languagetool-commandline.jar") | ||
72 | ;; (setq langtool-default-language "pl-PL")) | ||
73 | |||
74 | ;; (jd/leader-key-def | ||
75 | ;; "l" '(:ignore t :which-key "langtool") | ||
76 | ;; "lc" 'langtool-check-buffer | ||
77 | ;; "ld" 'langtool-check-done | ||
78 | ;; "li" 'langtool-interactive-correction) | ||
79 | |||
80 | (jd/use-package mastodon "emacs-mastodon" | ||
81 | :config | ||
82 | (setq mastodon-active-user "jdlugosz963" | ||
83 | mastodon-instance-url "https://fosstodon.org/")) | ||
84 | |||
85 | (provide 'jd-apps) | ||
86 | |||
87 | ;;; jd-apps.el ends here | ||
diff --git a/.config/emacs/jd-emacs/jd-emacs-custom.el b/.emacs.d/jd/jd-custom.el index aef824f..96d13c6 100644..100755 --- a/.config/emacs/jd-emacs/jd-emacs-custom.el +++ b/.emacs.d/jd/jd-custom.el | |||
@@ -17,20 +17,15 @@ | |||
17 | clipboard-file-path)) | 17 | clipboard-file-path)) |
18 | (find-file clipboard-out-image))) | 18 | (find-file clipboard-out-image))) |
19 | 19 | ||
20 | (defun jd-emacs/erc-notify-sound () | 20 | (setq erc-nick "bobbma" |
21 | (jd-exwm/run-in-background "mpv /home/jakub/.config/emacs/resources/beep.wav")) | 21 | erc-user-full-name "Jakub Dlugosz" |
22 | erc-notify-list '("akuleszaa")) | ||
22 | 23 | ||
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 () | 24 | (defun hipis-znc () |
32 | (interactive) | 25 | (interactive) |
33 | (erc :server "195.74.91.18" | 26 | (erc :server "195.74.91.18" |
34 | :port "6697")) | 27 | :port "6697")) |
35 | 28 | ||
29 | (provide 'jd-custom) | ||
30 | |||
36 | ;;; jd-custom.el ends here | 31 | ;;; jd-custom.el ends here |
diff --git a/.emacs.d/jd/jd-dev.el b/.emacs.d/jd/jd-dev.el new file mode 100755 index 0000000..d69313e --- /dev/null +++ b/.emacs.d/jd/jd-dev.el | |||
@@ -0,0 +1,173 @@ | |||
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 | (jd/use-package lsp-mode "emacs-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 | (jd/use-package lsp-ivy "emacs-lsp-ivy" | ||
22 | :after lsp) | ||
23 | |||
24 | (jd/use-package paredit "emacs-paredit") | ||
25 | ;; (jd/use-package evil-paredit "emacs-evil-paredit" | ||
26 | ;; :config | ||
27 | ;; (defun jd/lisp-mode-setup () | ||
28 | ;; (rainbow-delimiters-mode) | ||
29 | ;; (evil-paredit-mode) | ||
30 | ;; (paredit-mode)) | ||
31 | ;; (add-hook 'emacs-startup-hook | ||
32 | ;; (lambda () | ||
33 | ;; (add-hook 'scheme-mode-hook 'jd/lisp-mode-setup) | ||
34 | ;; (add-hook 'emacs-lisp-mode-hook 'jd/lisp-mode-setup) | ||
35 | ;; (add-hook 'clojure-mode-hook 'jd/lisp-mode-setup) | ||
36 | ;; (add-hook 'lisp-mode-hook 'jd/lisp-mode-setup))) | ||
37 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g h") 'paredit-forward-barf-sexp) | ||
38 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g l") 'paredit-forward-slurp-sexp) | ||
39 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g H") 'paredit-backward-slurp-sexp) | ||
40 | ;; (evil-define-key 'normal paredit-mode-map (kbd "g L") 'paredit-backward-barf-sexp)) | ||
41 | (jd/use-package rainbow-delimiters "emacs-rainbow-delimiters") | ||
42 | |||
43 | (jd/use-package geiser "emacs-geiser") | ||
44 | (jd/use-package geiser-guile "emacs-geiser-guile") | ||
45 | |||
46 | ;; (defun jd/python-mode-setup () | ||
47 | ;; (let ((project-venv-path (concat (projectile-project-root) "venv/"))) | ||
48 | ;; (when (projectile--directory-p project-venv-path) | ||
49 | ;; (pyvenv-activate project-venv-path) | ||
50 | ;; (pyvenv-mode)))) | ||
51 | |||
52 | ;; (jd/use-package python-mode ;;TODO: find alternative | ||
53 | ;; :hook (python-mode . lsp-deferred) | ||
54 | ;; :hook (python-mode . jd/python-mode-setup) | ||
55 | ;; :config | ||
56 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | ||
57 | |||
58 | (jd/use-package pyvenv "emacs-pyvenv" | ||
59 | :after python-mode) | ||
60 | |||
61 | (jd/use-package typescript-mode "emacs-typescript-mode" | ||
62 | :mode ("\\.ts\\'") | ||
63 | :config | ||
64 | (setq typescript-indent-level 2)) | ||
65 | |||
66 | ;; (defun jd/activate-tide-mode () | ||
67 | ;; (when (and (stringp buffer-file-name) | ||
68 | ;; (string-match "\\.[tj]sx?\\'" buffer-file-name)) | ||
69 | ;; (tide-setup) | ||
70 | ;; (tide-hl-identifier-mode))) | ||
71 | |||
72 | (jd/use-package tide "emacs-tide" | ||
73 | :after (typescript-mode company web-mode)) | ||
74 | |||
75 | (jd/use-package flycheck "emacs-flycheck" | ||
76 | :hook ((after-init . global-flycheck-mode))) | ||
77 | |||
78 | (jd/use-package web-mode "emacs-web-mode" | ||
79 | :hook ((web-mode . jd/activate-tide-mode)) | ||
80 | :mode | ||
81 | ("\\.ejs\\'" "\\.hbs\\'" "\\.html\\'" "\\.php\\'" "\\.[jt]sx?\\'") | ||
82 | :config | ||
83 | (setq web-mode-content-types-alist '(("jsx" . "\\.[jt]sx?\\'"))) | ||
84 | (setq web-mode-markup-indent-offset 2) | ||
85 | (setq web-mode-css-indent-offset 2) | ||
86 | (setq web-mode-code-indent-offset 2) | ||
87 | (setq web-mode-script-padding 2) | ||
88 | (setq web-mode-block-padding 2) | ||
89 | (setq web-mode-style-padding 2) | ||
90 | (setq web-mode-enable-auto-pairing t) | ||
91 | (setq web-mode-enable-auto-closing t) | ||
92 | (setq web-mode-enable-current-element-highlight t)) | ||
93 | |||
94 | (jd/use-package yaml-mode "emacs-yaml-mode") | ||
95 | |||
96 | (jd/use-package docker "emacs-docker" | ||
97 | :config | ||
98 | (jd/leader-key-def | ||
99 | "d" '(:ignore t :which-key "Docker") | ||
100 | "dc" '(docker-containers :which-key "Docker containers") | ||
101 | "dd" '(docker :which-key "Docker"))) | ||
102 | |||
103 | (jd/use-package company "emacs-company" | ||
104 | :after lsp-mode | ||
105 | :hook (lsp-mode . company-mode) | ||
106 | :bind (:map company-active-map | ||
107 | ("<tab>" . company-complete-selection)) | ||
108 | (:map lsp-mode-map | ||
109 | ("<tab>" . company-indent-or-complete-common)) | ||
110 | :custom | ||
111 | (company-minimum-prefix-length 1) | ||
112 | (company-idle-delay 0.0) | ||
113 | :config | ||
114 | (global-company-mode)) | ||
115 | |||
116 | (jd/use-package company-box "emacs-company-box" | ||
117 | :hook (company-mode . company-box-mode)) | ||
118 | |||
119 | (jd/use-package projectile "emacs-projectile" | ||
120 | :diminish projectile-mode | ||
121 | :init | ||
122 | (when (file-directory-p "~/Documents/code") | ||
123 | (setq projectile-project-search-path '("~/Documents/code/"))) | ||
124 | :custom ((projectile-Completion-system 'ivy)) | ||
125 | :config | ||
126 | (setq projectile-switch-project-action #'projectile-dired) | ||
127 | (projectile-mode) | ||
128 | |||
129 | (jd/leader-key-def | ||
130 | "p" '(projectile-command-map :which-key "Project") | ||
131 | "p <ESC>" '() | ||
132 | "SPC" '(projectile-find-file :which-key "Find file in project"))) | ||
133 | |||
134 | (jd/use-package neotree "emacs-neotree" | ||
135 | :init | ||
136 | (setq neo-theme 'icons) | ||
137 | :config | ||
138 | |||
139 | ;; (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) | ||
140 | ;; (evil-define-key 'normal neotree-mode-map (kbd "C-RET") 'neotree-quick-look) | ||
141 | ;; (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) | ||
142 | ;; (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) | ||
143 | ;; (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) | ||
144 | ;; (evil-define-key 'normal neotree-mode-map (kbd "A") 'neotree-stretch-toggle) | ||
145 | ;; (evil-define-key 'normal neotree-mode-map (kbd "H") 'neotree-hidden-file-toggle) | ||
146 | |||
147 | (jd/leader-key-def | ||
148 | "op" '(jd/neotree-project-dir :which-key "Open neotree")) | ||
149 | |||
150 | (defun jd/neotree-project-dir () | ||
151 | "Open NeoTree using the git root." | ||
152 | (interactive) | ||
153 | (let ((project-dir (projectile-project-root)) | ||
154 | (file-name (buffer-file-name))) | ||
155 | (neotree-toggle) | ||
156 | (if project-dir | ||
157 | (if (neo-global--window-exists-p) | ||
158 | (progn | ||
159 | (neotree-dir project-dir) | ||
160 | (neotree-find file-name))) | ||
161 | (message "Could not find git project root."))))) | ||
162 | |||
163 | (jd/use-package magit "emacs-magit" | ||
164 | :custom | ||
165 | (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) | ||
166 | |||
167 | (jd/leader-key-def | ||
168 | "g" '(:ignore t :which-key "Git") | ||
169 | "gg" '(magit-status-here :which-key "Magit status"))) | ||
170 | |||
171 | (provide 'jd-dev) | ||
172 | |||
173 | ;;; jd-dev.el ends here | ||
diff --git a/.emacs.d/jd/jd-exwm.el b/.emacs.d/jd/jd-exwm.el new file mode 100755 index 0000000..5e95a63 --- /dev/null +++ b/.emacs.d/jd/jd-exwm.el | |||
@@ -0,0 +1,171 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | |||
7 | (jd/use-package exwm "emacs-exwm" | ||
8 | :config | ||
9 | (defun jd/exwm-update-class () | ||
10 | (exwm-workspace-rename-buffer exwm-class-name)) | ||
11 | |||
12 | (defun jd-exwm/run-in-background (command) | ||
13 | (let ((command-parts (split-string command "[ ]+"))) | ||
14 | (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) | ||
15 | |||
16 | (defun jd-exwm/restart-process (program-name) | ||
17 | (call-process "killall" nil nil nil program-name) | ||
18 | (jd-exwm/run-in-background program-name)) | ||
19 | |||
20 | (defun jd-exwm/exwm-init-hook () | ||
21 | (jd-exwm/run-in-background "nitrogen --restore") | ||
22 | (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") | ||
23 | (start-process-shell-command "syndaemon" nil "syndaemon -i 0.8 -K -R -d") | ||
24 | |||
25 | (jd-exwm/restart-process "polybar") | ||
26 | (jd-exwm/restart-process "nm-applet") | ||
27 | (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") | ||
28 | (jd-exwm/restart-process "blueman-applet")) | ||
29 | |||
30 | (defun jd-exwm/exwm-update-title () | ||
31 | (exwm-workspace-rename-buffer exwm-title)) | ||
32 | |||
33 | (defun jd-exwm/configure-window-by-class () | ||
34 | (interactive) | ||
35 | (pcase exwm-class-name | ||
36 | ("firefox" (exwm-workspace-move-window 2)) | ||
37 | ("Brave" (exwm-workspace-move-window 2)) | ||
38 | ("qutebrowser" (exwm-workspace-move-window 2)) | ||
39 | ("discord" (exwm-workspace-move-window 5)) | ||
40 | ("obs" (exwm-workspace-move-window 5)) | ||
41 | ("Virt-manager" (exwm-workspace-move-window 4)))) | ||
42 | |||
43 | (setq exwm-workspace-number 10) | ||
44 | |||
45 | ;; (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) | ||
46 | (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) | ||
47 | (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) | ||
48 | (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) | ||
49 | |||
50 | (require 'exwm-randr) | ||
51 | (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) | ||
52 | (exwm-randr-enable) | ||
53 | |||
54 | (setq exwm-input-simulation-keys | ||
55 | '(([?\C-b] . [left]) | ||
56 | ([?\C-f] . [right]) | ||
57 | ([?\C-p] . [up]) | ||
58 | ([?\C-n] . [down]) | ||
59 | ([?\C-a] . [home]) | ||
60 | ([?\C-e] . [end]) | ||
61 | ([?\C-k] . [S-end delete]) | ||
62 | ([?\M-w] . [C-c]) | ||
63 | ([?\C-y] . [C-v]) | ||
64 | ([?\C-v] . [next]) | ||
65 | ([?\C-\M-v] . [prior]) | ||
66 | )) | ||
67 | |||
68 | (setq exwm-input-prefix-keys | ||
69 | '(?\C-x | ||
70 | ?\C-u | ||
71 | ?\C-h | ||
72 | ?\M-x | ||
73 | ?\M-` | ||
74 | ?\M-& | ||
75 | ?\M-: | ||
76 | ?\C-\M-j | ||
77 | ?\C-\ )) | ||
78 | |||
79 | (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) | ||
80 | (exwm-input-set-key (kbd "s-p") 'counsel-linux-app) | ||
81 | |||
82 | (setq exwm-input-global-keys | ||
83 | `(([?\s-R] . exwm-reset) | ||
84 | |||
85 | |||
86 | ([?\s-r] . (lambda (command) | ||
87 | (interactive (list (read-shell-command "$ "))) | ||
88 | (start-process-shell-command command nil command))) | ||
89 | |||
90 | ([?\s-W] . exwm-workspace-move-window) | ||
91 | ([?\s-w] . exwm-workspace-switch) | ||
92 | |||
93 | ,@(mapcar (lambda (i) | ||
94 | `(,(kbd (format "s-%d" i)) . | ||
95 | (lambda () | ||
96 | (interactive) | ||
97 | (exwm-workspace-switch-create ,i)))) | ||
98 | (number-sequence 0 9)))) | ||
99 | |||
100 | (exwm-enable)) | ||
101 | |||
102 | (jd/use-package desktop-environment "emacs-desktop-environment" | ||
103 | :after exwm | ||
104 | :custom | ||
105 | (desktop-environment-brightness-small-increment "2%+") | ||
106 | (desktop-environment-brightness-small-decrement "2%-") | ||
107 | (desktop-environment-brightness-normal-increment "5%+") | ||
108 | (desktop-environment-brightness-normal-decrement "5%-") | ||
109 | |||
110 | :config | ||
111 | (defun jd/dunst-show-history () | ||
112 | (interactive) | ||
113 | (start-process-shell-command "dunstctl" nil "dunstctl history-pop")) | ||
114 | |||
115 | (defun jd/dunst-close () | ||
116 | (interactive) | ||
117 | (start-process-shell-command "dunstctl" nil "dunstctl close")) | ||
118 | |||
119 | (defun jd/dunst-close-all () | ||
120 | (interactive) | ||
121 | (start-process-shell-command "dunstctl" nil "dunstctl close-all")) | ||
122 | |||
123 | (jd/leader-key-def | ||
124 | "d" '(nil :which-key "dunst") | ||
125 | "dh" '(jd/dunst-show-history :which-key "show history") | ||
126 | "dc" '(jd/dunst-close :which-key "close") | ||
127 | "da" '(jd/dunst-close-all :which-key "close all")) | ||
128 | |||
129 | (desktop-environment-mode)) | ||
130 | |||
131 | (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) | ||
132 | (add-to-list 'default-frame-alist `(alpha . (90 . 90))) | ||
133 | (set-frame-parameter (selected-frame) 'fullscreen 'maximized) | ||
134 | (add-to-list 'default-frame-alist '(fullscreen . maximized)) | ||
135 | |||
136 | (defun jd-exwm/get-color (ATTRIBUTE) | ||
137 | (face-attribute 'default ATTRIBUTE)) | ||
138 | |||
139 | (defun theme-to-xresources () | ||
140 | (interactive) | ||
141 | (require 'term) | ||
142 | (with-temp-buffer | ||
143 | (insert "! Generated by theme-to-xresources\n") | ||
144 | (dolist (spec | ||
145 | '(("emacs.background" :background "E6") | ||
146 | ("emacs.foreground" :foreground ""))) | ||
147 | (let ((color (jd-exwm/get-color (cadr spec)))) | ||
148 | (insert (format "%s: #%s%s\n" | ||
149 | (car spec) | ||
150 | (caddr spec) | ||
151 | (string-remove-prefix "#" color)))) | ||
152 | jd | ||
153 | (write-region (point-min) (point-max) "~/.Xresources"))) | ||
154 | (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources"))) | ||
155 | |||
156 | (defun jd/theme-sync () | ||
157 | (interactive) | ||
158 | (theme-to-xresources) | ||
159 | (setq org-confirm-babel-evaluate nil) | ||
160 | (org-babel-tangle-file "~/dotfiles/Desktop.org") | ||
161 | (setq org-confirm-babel-evaluate 't) | ||
162 | (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history | ||
163 | (jd-exwm/restart-process "polybar")) | ||
164 | |||
165 | ;; (add-hook 'jd/load-theme-hook #'jd/theme-sync) | ||
166 | ;; (add-hook 'exwm-init-hook #'jd/theme-sync) | ||
167 | |||
168 | (provide 'jd-exwm) | ||
169 | |||
170 | ;;; jd-exwm.el ends here | ||
171 | |||
diff --git a/.config/emacs/jd/jd-gym.el b/.emacs.d/jd/jd-gym.el index 2602e3e..2602e3e 100644..100755 --- a/.config/emacs/jd/jd-gym.el +++ b/.emacs.d/jd/jd-gym.el | |||
diff --git a/.emacs.d/jd/jd-keys.el b/.emacs.d/jd/jd-keys.el new file mode 100755 index 0000000..7c0d6b2 --- /dev/null +++ b/.emacs.d/jd/jd-keys.el | |||
@@ -0,0 +1,115 @@ | |||
1 | ;;; Dotfiles --- Jakub Dlugosz emacs config | ||
2 | ;;; Commentary: | ||
3 | |||
4 | ;;; Code: | ||
5 | |||
6 | ;; (jd/use-package evil "emacs-evil" | ||
7 | ;; :init | ||
8 | ;; (setq evil-want-integration t) | ||
9 | ;; (setq evil-want-keybinding nil) | ||
10 | ;; (setq evil-want-C-u-scroll t) | ||
11 | ;; (setq evil-want-Y-yank-to-eol t) | ||
12 | ;; (setq evil-want-C-i-jump nil) | ||
13 | ;; (setq evil-undo-system 'undo-tree) | ||
14 | ;; (setq evil-kill-on-visual-paste nil) | ||
15 | ;; :config | ||
16 | ;; (evil-set-initial-state 'exwm-mode 'emacs) | ||
17 | ;; (evil-mode 1)) | ||
18 | |||
19 | (jd/use-package general "emacs-general" | ||
20 | :config | ||
21 | (general-create-definer jd/leader-key-def | ||
22 | :keymaps '(normal insert visual emacs) | ||
23 | :prefix "SPC" | ||
24 | :global-prefix "C-z") | ||
25 | |||
26 | (general-create-definer jd/ctrl-c-keys | ||
27 | :prefix "C-c") | ||
28 | |||
29 | ;; (jd/leader-key-def | ||
30 | ;; "w" 'evil-window-map | ||
31 | ;; "wr" '(hydra-resize-window/body :which-key "Rezize window") | ||
32 | ;; "wd" '(evil-window-delete :which-key "Window delete")) | ||
33 | |||
34 | (jd/leader-key-def | ||
35 | "ou" '(undo-tree-visualize :which-key "Open")) | ||
36 | |||
37 | ;; remove . key | ||
38 | ;; (define-key evil-normal-state-map (kbd ".") '()) | ||
39 | (jd/leader-key-def | ||
40 | "f" '(:ignore t :which-key "Files") | ||
41 | "fs" '(save-buffer :which-key "File save") | ||
42 | "." '(find-file :which-key "Find file") | ||
43 | "ff" '(find-file :which-key "Find file")) | ||
44 | |||
45 | (jd/leader-key-def | ||
46 | "e" '(:ignore t :which-key "Eval") | ||
47 | "eb" '(eval-buffer :which-key "Eval buffer") | ||
48 | "ee" '(eval-defun :which-key "Eval defun")) | ||
49 | |||
50 | (jd/leader-key-def | ||
51 | :keymaps '(visual) | ||
52 | "er" '(eval-region :which-key "Eval region")) | ||
53 | |||
54 | (defun jd/kill-other-buffers () | ||
55 | (interactive) | ||
56 | (mapc 'kill-buffer (cdr (buffer-list (current-buffer))))) | ||
57 | |||
58 | (jd/leader-key-def | ||
59 | "bK" '(jd/kill-other-buffers :which-key "Kill other buffers") | ||
60 | "bk" '(kill-current-buffer :which-key "Kill buffer") | ||
61 | "bB" '(ibuffer :which-key "Open ibuffer"))) | ||
62 | |||
63 | |||
64 | (jd/use-package hydra "emacs-hydra" | ||
65 | ;; :defer t | ||
66 | :config | ||
67 | (defun jd/text-scale-increase () | ||
68 | (interactive) | ||
69 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
70 | (set-face-attribute 'default nil :height (+ old-face-attribute 10)))) | ||
71 | |||
72 | (defun jd/text-scale-decrease () | ||
73 | (interactive) | ||
74 | (let ((old-face-attribute (face-attribute 'default :height))) | ||
75 | (set-face-attribute 'default nil :height (- old-face-attribute 10)))) | ||
76 | |||
77 | ;; (defhydra hydra-resize-window (:timeout 4) | ||
78 | ;; ("h" evil-window-decrease-width "<") | ||
79 | ;; ("l" evil-window-increase-width ">") | ||
80 | ;; ("k" evil-window-decrease-height "^") | ||
81 | ;; ("j" evil-window-increase-height "v") | ||
82 | ;; ("q" nil "finished" :exit t)) | ||
83 | |||
84 | (defhydra hydra-text-scale-global (:timeout 4) | ||
85 | "scale text" | ||
86 | ("j" jd/text-scale-increase "in") | ||
87 | ("k" jd/text-scale-decrease "out") | ||
88 | ("q" nil "finished" :exit t)) | ||
89 | |||
90 | (defhydra hydra-text-scale (:timeout 4) | ||
91 | "scale text" | ||
92 | ("j" text-scale-increase "in") | ||
93 | ("k" text-scale-decrease "out") | ||
94 | ("q" nil "finished" :exit t)) | ||
95 | |||
96 | (jd/leader-key-def | ||
97 | "tS" '(hydra-text-scale-global/body :which-key "Scale text") | ||
98 | "ts" '(hydra-text-scale/body :which-key "Scale text"))) | ||
99 | |||
100 | |||
101 | (jd/use-package undo-tree "emacs-undo-tree" | ||
102 | :diminish | ||
103 | :config | ||
104 | (setq undo-tree-auto-save-history nil) | ||
105 | (global-undo-tree-mode 1)) | ||
106 | |||
107 | ;; (jd/use-package evil-collection "emacs-evil-collection" | ||
108 | ;; :after evil | ||
109 | ;; :config | ||
110 | ;; (evil-collection-init)) | ||
111 | |||
112 | |||
113 | (provide 'jd-keys) | ||
114 | |||
115 | ;;; jd-keys.el ends here | ||
diff --git a/.config/emacs/jd/jd-mu4e.el b/.emacs.d/jd/jd-mu4e.el index 0f45f15..e97c4fc 100644..100755 --- a/.config/emacs/jd/jd-mu4e.el +++ b/.emacs.d/jd/jd-mu4e.el | |||
@@ -1,8 +1,11 @@ | |||
1 | (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e") | 1 | (when (not jd/guix-p) |
2 | (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")) | ||
2 | 3 | ||
3 | (use-package org-msg) | 4 | (jd/use-package htmlize "emacs-htmlize") |
4 | 5 | ||
5 | (use-package mu4e | 6 | ; (jd/add-package-to-manifest "mbsync") ;; TODO: Define guix mbsync package? |
7 | |||
8 | (jd/use-package mu4e "mu" | ||
6 | :defer 10 | 9 | :defer 10 |
7 | :ensure nil | 10 | :ensure nil |
8 | :config | 11 | :config |
@@ -61,16 +64,16 @@ | |||
61 | 64 | ||
62 | (mu4e t)) | 65 | (mu4e t)) |
63 | 66 | ||
64 | (use-package mu4e-alert | 67 | (jd/use-package mu4e-alert "emacs-mu4e-alert" |
65 | :defer 20 | 68 | :defer 20 |
66 | :config | 69 | :config |
67 | (mu4e-alert-set-default-style 'libnotify) | 70 | (mu4e-alert-set-default-style 'libnotify) |
68 | (mu4e-alert-enable-mode-line-display) | 71 | (mu4e-alert-enable-mode-line-display) |
69 | (mu4e-alert-enable-notifications)) | 72 | (mu4e-alert-enable-notifications) |
70 | 73 | ||
71 | (jd/leader-key-def | 74 | (jd/leader-key-def |
72 | "m" '(:ignore t :which-key "mail") | 75 | "m" '(:ignore t :which-key "mail") |
73 | "mm" 'mu4e | 76 | "mm" 'mu4e |
74 | "mc" 'mu4e-compose-new) | 77 | "mc" 'mu4e-compose-new)) |
75 | 78 | ||
76 | (provide 'jd-mu4e) | 79 | (provide 'jd-mu4e) |
diff --git a/.emacs.d/jd/jd-org.el b/.emacs.d/jd/jd-org.el new file mode 100755 index 0000000..cd05d72 --- /dev/null +++ b/.emacs.d/jd/jd-org.el | |||
@@ -0,0 +1,198 @@ | |||
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)))) | ||
18 | |||
19 | (jd/use-package org "emacs-org" | ||
20 | :pin org | ||
21 | :commands (org-capture org-agenda) | ||
22 | :hook (org-mode . jd/org-mode-init) | ||
23 | :config | ||
24 | (setq org-directory (file-truename "~/Documents/Org/")) | ||
25 | (setq org-mobile-inbox-for-pull (concat org-directory "flagged.org")) | ||
26 | (setq org-mobile-directory "~/Dropbox/Apps/MobileOrg") | ||
27 | (setq org-agenda-files | ||
28 | '("Tasks.org")) | ||
29 | (setq org-ellipsis " ▾") | ||
30 | (setq org-agenda-start-with-log-mode t) | ||
31 | (setq org-log-done 'time) | ||
32 | (setq org-log-into-drawer t) | ||
33 | (setq org-return-follows-link t) | ||
34 | (setq org-capture-templates | ||
35 | `(("t" "Tasks / Projects") | ||
36 | ("tt" "Task" entry (file+olp "Tasks.org" "Inbox") | ||
37 | "* TODO %?\n %t\n %a\n %i" :empty-lines 1) | ||
38 | ("tT" "Task for tomorow" entry (file+olp "Tasks.org" "Inbox") | ||
39 | "* TODO %?\n %t\n SCHEDULED: %(jd-emacs/org-insert-date \"+1d\")>\n %a\n %i" :empty-lines 1) | ||
40 | |||
41 | ("m" "Metrics Capture") | ||
42 | ("mm" "Metrics" table-line (file+headline "Metrics.org" "Metrics") | ||
43 | "| %U | %^{Weight} | %^{Waist} | %^{Notes} |" :kill-buffer t) | ||
44 | ("sh" "School Homework" entry (file+olp "school/todo(jd-emacs/org-insert-date \"1\").org")))) | ||
45 | |||
46 | (setq org-latex-listings 'minted | ||
47 | org-latex-packages-alist '(("" "minted")) | ||
48 | org-latex-pdf-process | ||
49 | '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" | ||
50 | "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f")) | ||
51 | (require 'org-tempo) | ||
52 | |||
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 | (defun jd/org-font-setup () | ||
61 | ;; Replace list hyphen with dot | ||
62 | (font-lock-add-keywords 'org-mode | ||
63 | '(("^ *\\([-]\\) " | ||
64 | (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•-")))))) | ||
65 | |||
66 | ;; Set faces for heading levels | ||
67 | (dolist (face '((org-level-1 . 1.3) | ||
68 | (org-level-2 . 1.2) | ||
69 | (org-level-3 . 1.1) | ||
70 | (org-level-4 . 1.0) | ||
71 | (org-level-5 . 1.0) | ||
72 | (org-level-6 . 1.0) | ||
73 | (org-level-7 . 1.0) | ||
74 | (org-level-8 . 1.0))) | ||
75 | (set-face-attribute (car face) nil :font "Terminus" :weight 'Bold :height (cdr face))) | ||
76 | |||
77 | ;; Ensure that anything that should be fixed-pitch in Org files appears that way | ||
78 | (set-face-attribute 'org-block nil :font "Terminus" :inherit 'fixed-pitch :height 100) | ||
79 | (set-face-attribute 'org-table nil :inherit 'fixed-pitch) | ||
80 | (set-face-attribute 'org-formula nil :inherit 'fixed-pitch) | ||
81 | (set-face-attribute 'org-code nil :inherit '(shadow fixed-pitch)) | ||
82 | (set-face-attribute 'org-table nil :font "Terminus" :inherit '(shadow fixed-pitch)) | ||
83 | (set-face-attribute 'org-verbatim nil :inherit '(shadow fixed-pitch)) | ||
84 | (set-face-attribute 'org-special-keyword nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
85 | (set-face-attribute 'org-meta-line nil :inherit '(font-lock-comment-face fixed-pitch)) | ||
86 | (set-face-attribute 'org-checkbox nil :inherit 'fixed-pitch) | ||
87 | (set-face-attribute 'line-number nil :inherit 'fixed-pitch) | ||
88 | (set-face-attribute 'line-number-current-line nil :inherit 'fixed-pitch)) | ||
89 | |||
90 | (with-eval-after-load 'org (jd/org-font-setup)) | ||
91 | |||
92 | (defun jd-emacs/org-timer-stop () | ||
93 | (start-process-shell-command "notify-send" nil "notify-send Zakonczono odliczanie")) | ||
94 | |||
95 | |||
96 | (add-hook 'org-timer-stop-hook #'jd-emacs/org-timer-stop) | ||
97 | |||
98 | (defun jd/org-tempo-setup () | ||
99 | (add-to-list 'org-structure-template-alist '("s" . "src")) | ||
100 | (add-to-list 'org-structure-template-alist '("sql" . "src sql")) | ||
101 | (add-to-list 'org-structure-template-alist '("sh" . "src sh")) | ||
102 | (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) | ||
103 | (add-to-list 'org-structure-template-alist '("li" . "src lisp")) | ||
104 | (add-to-list 'org-structure-template-alist '("sc" . "src scheme")) | ||
105 | (add-to-list 'org-structure-template-alist '("ts" . "src typescript")) | ||
106 | (add-to-list 'org-structure-template-alist '("py" . "src python")) | ||
107 | (add-to-list 'org-structure-template-alist '("go" . "src go")) | ||
108 | (add-to-list 'org-structure-template-alist '("yaml" . "src yaml"))) | ||
109 | |||
110 | (with-eval-after-load 'org-tempo (jd/org-tempo-setup)) | ||
111 | |||
112 | (org-babel-do-load-languages | ||
113 | 'org-babel-load-languages | ||
114 | '((emacs-lisp . t) | ||
115 | (python . t))) | ||
116 | |||
117 | (defun jd/org-babel-tangle-config () | ||
118 | (when (string-equal (file-name-directory (buffer-file-name)) | ||
119 | (expand-file-name "~/dotfiles/")) | ||
120 | ;; Dynamic scoping to the rescue | ||
121 | (let ((org-confirm-babel-evaluate nil)) | ||
122 | (org-babel-tangle)))) | ||
123 | |||
124 | (add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'jd/org-babel-tangle-config))) | ||
125 | |||
126 | (defun jd/org-mode-visual-fill () | ||
127 | (setq visual-fill-column-width 100 | ||
128 | visual-fill-column-center-text t) | ||
129 | (visual-fill-column-mode 1))) | ||
130 | |||
131 | ;; (jd/use-package evil-org "emacs-evil-org" | ||
132 | ;; :after org | ||
133 | ;; :hook (org-mode . (lambda () evil-org-mode)) | ||
134 | ;; :config | ||
135 | ;; (require 'evil-org-agenda) | ||
136 | ;; (evil-org-agenda-set-keys)) | ||
137 | |||
138 | (jd/use-package visual-fill-column "emacs-visual-fill-column" | ||
139 | :hook (org-mode . jd/org-mode-visual-fill)) | ||
140 | |||
141 | (jd/use-package org-superstar "emacs-org-superstar" | ||
142 | :hook (org-mode . org-superstar-mode) | ||
143 | :init | ||
144 | (setq org-superstar-special-todo-items t) | ||
145 | (setq org-superstar-remove-leading-stars t) | ||
146 | (setq org-superstar-headline-bullets-list '("◉" "○" "●" "○" "●" "○" "●"))) | ||
147 | |||
148 | ; (jd/add-package-to-manifest "emacs-emacsql-sqlite3") | ||
149 | (jd/use-package org-roam "emacs-org-roam" | ||
150 | :custom | ||
151 | (org-roam-directory (file-truename jd/org-roam-home)) | ||
152 | :bind (("C-c n l" . org-roam-buffer-toggle) | ||
153 | ("C-c n f" . org-roam-node-find) | ||
154 | ("C-c n g" . org-roam-graph) | ||
155 | ("C-c n i" . org-roam-node-insert) | ||
156 | ("C-c n c" . org-roam-capture) | ||
157 | ;; Dailies | ||
158 | ("C-c n j" . org-roam-dailies-capture-today)) | ||
159 | :bind-keymap | ||
160 | ("C-c n d" . org-roam-dailies-map) | ||
161 | :config | ||
162 | (defun jd/org-roam-filter-by-tag (tag-name) | ||
163 | (lambda (node) | ||
164 | (member tag-name (org-roam-node-tags node)))) | ||
165 | |||
166 | (defun jd/org-roam-list-notes-by-tag (tag-name) | ||
167 | (mapcar #'org-roam-node-file | ||
168 | (seq-filter | ||
169 | (jd/org-roam-filter-by-tag tag-name) | ||
170 | (org-roam-node-list)))) | ||
171 | |||
172 | (defun jd/org-roam-refreshagenda-list () | ||
173 | (interactive) | ||
174 | (setq org-agenda-files (org-roam-list-files))) | ||
175 | |||
176 | (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) | ||
177 | (setq org-roam-capture-templates | ||
178 | '(("a" "workstuff" plain (file (concat org-roam-directory "/work")) | ||
179 | :target (file+head "work/%<%Y%m%d%H%M%S>-${slug}.org" | ||
180 | "#+title: ${title}\n") :unnarrowed t) | ||
181 | ("b" "research" plain (file "~/Documents/roam/study/templates/research.org") | ||
182 | :target (file+head "study/%<%Y%m%d%H%M%S>-${slug}.org" | ||
183 | "#+title: ${title}\n") :unnarrowed t) | ||
184 | ("s" "School" plain nil | ||
185 | :target (file+head | ||
186 | "school/%<%Y%m%d%H%M%S>-${slug}.org" | ||
187 | "#+title: ${title}\n") | ||
188 | :unnarrowed t) | ||
189 | ("d" "default" plain nil | ||
190 | :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" | ||
191 | "#+title: ${title}\n") :unnarrowed t) | ||
192 | )) | ||
193 | |||
194 | (org-roam-db-autosync-mode)) | ||
195 | |||
196 | (provide 'jd-org) | ||
197 | |||
198 | ;;; jd-org.el ends here | ||
diff --git a/.emacs.d/jd/jd-ui.el b/.emacs.d/jd/jd-ui.el new file mode 100755 index 0000000..4c8e04b --- /dev/null +++ b/.emacs.d/jd/jd-ui.el | |||
@@ -0,0 +1,102 @@ | |||
1 | |||
2 | ;; Dotfiles --- Jakub Dlugosz emacs config | ||
3 | ;;; Commentary: | ||
4 | |||
5 | ;;; Code: | ||
6 | |||
7 | (setq inhibit-startup-message t) | ||
8 | (setq visible-bell t) | ||
9 | (scroll-bar-mode -1) | ||
10 | (tool-bar-mode -1) | ||
11 | (tooltip-mode -1) | ||
12 | (menu-bar-mode -1) | ||
13 | (set-fringe-mode 10) | ||
14 | |||
15 | (set-face-attribute 'default nil :font "Terminus" :height 100) | ||
16 | |||
17 | (add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) | ||
18 | |||
19 | (global-set-key (kbd "<escape>") 'keyboard-escape-quit) | ||
20 | |||
21 | (global-prettify-symbols-mode 1) | ||
22 | |||
23 | (defalias 'yes-or-no-p 'y-or-n-p) | ||
24 | |||
25 | (jd/use-package doom-themes "emacs-doom-themes" | ||
26 | :config | ||
27 | ;; (load-theme 'manoj-black t) | ||
28 | ) | ||
29 | |||
30 | (load-theme 'manoj-dark t) | ||
31 | |||
32 | (jd/use-package diminish "emacs-diminish") | ||
33 | |||
34 | (jd/use-package hl-todo "emacs-hl-todo" | ||
35 | :init | ||
36 | (setq hl-todo-keyword-faces | ||
37 | '(("TODO" . "#FF0000") | ||
38 | ("FIXME" . "#FF0000") | ||
39 | ("DEBUG" . "#A020F0"))) | ||
40 | :config | ||
41 | (global-hl-todo-mode 1)) | ||
42 | |||
43 | (defun jd/switch-buffer () | ||
44 | (interactive) | ||
45 | (let ((completion-regexp-list '("\\`[^*]" | ||
46 | "\\`\\([^T]\\|T\\($\\|[^A]\\|A\\($\\|[^G]\\|G\\($\\|[^S]\\|S.\\)\\)\\)\\).*"))) | ||
47 | (call-interactively 'counsel-switch-buffer))) | ||
48 | |||
49 | (defvar jd/load-theme-hook nil) | ||
50 | (defun jd/load-theme () | ||
51 | (interactive) | ||
52 | (counsel-load-theme) | ||
53 | (run-hooks 'jd/load-theme-hook)) | ||
54 | |||
55 | (jd/use-package ivy "emacs-ivy" | ||
56 | :diminish | ||
57 | :bind | ||
58 | (("C-s" . swiper) | ||
59 | ;; :map ivy-minibuffer-map | ||
60 | ;; ("C-k" . ivy-previous-line) | ||
61 | ;; ("C-j" . ivy-next-line) | ||
62 | ;; :map ivy-switch-buffer-map | ||
63 | ;; ("C-k" . ivy-previous-line) | ||
64 | ) | ||
65 | :config | ||
66 | (ivy-mode 1)) | ||
67 | |||
68 | (jd/use-package counsel "emacs-counsel" | ||
69 | :config | ||
70 | (counsel-mode 1) | ||
71 | |||
72 | (jd/leader-key-def | ||
73 | "t" '(:ignore t :which-key "Toggle") | ||
74 | "tT" '(toggle-truncate-lines :which-key "Toggle truncate lines") | ||
75 | "tt" '(jd/load-theme :which-key "Choose theme")) | ||
76 | |||
77 | (jd/leader-key-def | ||
78 | "bb" '(jd/switch-buffer :which-key "Buffer switch") | ||
79 | "ba" '(counsel-switch-buffer :which-key "Buffer switch") | ||
80 | "b" '(:ignore t :which-key "Buffer") | ||
81 | "," '(counsel-switch-buffer :which-key "Buffer switch"))) | ||
82 | |||
83 | (jd/use-package which-key "emacs-which-key" | ||
84 | :diminish | ||
85 | :config | ||
86 | (which-key-mode) | ||
87 | (setq which-key-idle-delay 0.3)) | ||
88 | |||
89 | (jd/use-package all-the-icons "emacs-all-the-icons") | ||
90 | |||
91 | (jd/use-package doom-modeline "emacs-doom-modeline" | ||
92 | ; :init (doom-modeline-mode 0) | ||
93 | :custom ((doom-modeline-height 15))) | ||
94 | |||
95 | (jd/use-package beacon "emacs-beacon" | ||
96 | :config | ||
97 | (beacon-mode 1)) | ||
98 | |||
99 | |||
100 | (provide 'jd-ui) | ||
101 | |||
102 | ;;; jd-ui.el ends here | ||