]> git.armaanb.net Git - config.org.git/blob - config.org
Fix visual line mode hook
[config.org.git] / config.org
1 #+TITLE: System Configuration
2 #+DESCRIPTION: Personal system configuration in org-mode format.
3 #+AUTHOR: Armaan Bhojwani
4 #+EMAIL: me@armaanb.net
5
6 * Welcome
7 Welcome to my system configuration! This file contains my Emacs configuration, but also my config files for many of the other programs on my system!
8 ** Compatability
9 I am currently using Emacs 28 with native compilation, so some settings and packages may not be available for older versions of Emacs. This is a purely personal configuration, so while I can guarantee that it works on my setup, it might not work for you.
10 ** Choices
11 I chose to create a powerful, yet not overly heavy Emacs configuration. Things like a fancy modeline, icons, or LSP mode do not increase my productivity, and create visual clutter, and thus have been excluded.
12
13 Another important choice has been to integrate Emacs into a large part of my computing environment (see [[*Emacs OS]]). I use email, IRC, RSS, et cetera, all through Emacs which simplifies my workflow and creates an amazingly integrated environment.
14
15 Lastly, I use Evil mode. Modal keybindings are simpler and more ergonomic than standard Emacs style, and Vim keybindings are what I'm comfortable with and are pervasive throughout computing.
16 ** License
17 Released under the [[https://opensource.org/licenses/MIT][MIT license]] by Armaan Bhojwani, 2021. Note that many snippets are taken from online, and other sources, who are credited for their work near their contributions.
18 * Package management
19 ** Bootstrap straight.el
20 straight.el is really nice for managing package, and it integrates nicely with use-package. It uses the bootstrapping system defined here for installation.
21 #+begin_src emacs-lisp
22   (defvar native-comp-deferred-compilation-deny-list ())
23   (defvar bootstrap-version)
24   (let ((bootstrap-file
25          (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
26         (bootstrap-version 5))
27     (unless (file-exists-p bootstrap-file)
28       (with-current-buffer
29           (url-retrieve-synchronously
30            "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
31            'silent 'inhibit-cookies)
32         (goto-char (point-max))
33         (eval-print-last-sexp)))
34     (load bootstrap-file nil 'nomessage))
35 #+end_src
36 ** Replace package.el with straight
37 #+begin_src emacs-lisp
38   (straight-use-package 'use-package)
39   (setq straight-use-package-by-default t)
40 #+end_src
41 * Visual options
42 ** Theme
43 Use the Modus Operandi theme by Protesilaos Stavrou. Its the best theme for Emacs by far, because how clear and readable it is. It is highly customizable, but I just set a few options here.
44 #+begin_src emacs-lisp
45   (setq modus-themes-slanted-constructs t
46         modus-themes-bold-constructs t
47         modus-themes-mode-line '3d
48         modus-themes-scale-headings t
49         modus-themes-diffs 'desaturated)
50   (load-theme 'modus-vivendi t)
51 #+end_src
52 ** Typography
53 *** Font
54 JetBrains Mono is a great programming font with ligatures. The "NF" means that it has been patched with the [[https://www.nerdfonts.com/][Nerd Fonts]].
55 #+begin_src emacs-lisp
56   (add-to-list 'default-frame-alist '(font . "JetBrainsMonoNF-12"))
57 #+end_src
58 *** Ligatures
59 #+begin_src emacs-lisp
60   (use-package ligature
61     :straight (ligature :type git :host github :repo "mickeynp/ligature.el")
62     :config
63     (ligature-set-ligatures
64      '(prog-mode text-mode)
65      '("-|" "-~" "---" "-<<" "-<" "--" "->" "->>" "-->" "/=" "/=="
66        "/>" "//" "/*" "*>" "*/" "<-" "<<-" "<=>" "<=" "<|" "<||"
67        "<|||" "<|>" "<:" "<>" "<-<" "<<<" "<==" "<<=" "<=<" "<==>"
68        "<-|" "<<" "<~>" "<=|" "<~~" "<~" "<$>" "<$" "<+>" "<+" "</>"
69        "</" "<*" "<*>" "<->" "<!--" ":>" ":<" ":::" "::" ":?" ":?>"
70        ":=" "::=" "=>>" "==>" "=/=" "=!=" "=>" "===" "=:=" "==" "!=="
71        "!!" "!=" ">]" ">:" ">>-" ">>=" ">=>" ">>>" ">-" ">=" "&&&"
72        "&&" "|||>" "||>" "|>" "|]" "|}" "|=>" "|->" "|=" "||-" "|-"
73        "||=" "||" ".." ".?" ".=" ".-" "..<" "..." "+++" "+>" "++"
74        "[||]" "[<" "[|" "{|" "?." "?=" "?:" "##" "###" "####" "#["
75        "#{" "#=" "#!" "#:" "#_(" "#_" "#?" "#(" ";;" "_|_" "__" "~~"
76        "~~>" "~>" "~-" "~@" "$>" "^=" "]#"))
77     (global-ligature-mode t))
78 #+end_src
79 ** Line numbers
80 Display relative line numbers except in certain modes.
81 #+begin_src emacs-lisp
82   (global-display-line-numbers-mode)
83   (setq display-line-numbers-type 'relative)
84   (dolist (no-line-num '(term-mode-hook
85                          pdf-view-mode-hook
86                          shell-mode-hook
87                          org-mode-hook
88                          circe-mode-hook
89                          eshell-mode-hook))
90     (add-hook no-line-num (lambda () (display-line-numbers-mode 0))))
91 #+end_src
92 ** Highlight matching parenthesis
93 #+begin_src emacs-lisp
94   (use-package paren
95     :config (show-paren-mode)
96     :custom (show-paren-style 'parenthesis))
97 #+end_src
98 ** Modeline
99 *** Show current function
100 #+begin_src emacs-lisp
101   (which-function-mode)
102 #+end_src
103 *** Make position in file more descriptive
104 Show current column and file size.
105 #+begin_src emacs-lisp
106   (column-number-mode)
107   (size-indication-mode)
108 #+end_src
109 *** Hide minor modes
110 #+begin_src emacs-lisp
111   (use-package minions
112     :config (minions-mode))
113 #+end_src
114 ** Ruler
115 Show a ruler at a certain number of chars depending on mode.
116 #+begin_src emacs-lisp
117   (setq display-fill-column-indicator-column 80)
118   (global-display-fill-column-indicator-mode)
119 #+end_src
120 ** Highlight todo items in comments
121 #+begin_src emacs-lisp
122   (use-package hl-todo
123     :straight (hl-todo :type git :host github :repo "tarsius/hl-todo")
124     :config (global-hl-todo-mode 1))
125 #+end_src
126 ** Blink cursor
127 #+begin_src emacs-lisp
128   (blink-cursor-mode)
129 #+end_src
130 ** Visual line mode
131 Soft wrap words and do operations by visual lines in some modes.
132 #+begin_src emacs-lisp
133   (dolist (hook '(text-mode-hook
134                   org-mode-hook
135                   markdown-mode-hook
136                   mu4e-view-mode-hook))
137     (add-hook hook (lambda () (visual-line-mode 1))))
138 #+end_src
139 ** Display number of matches in search
140 #+begin_src emacs-lisp
141   (use-package anzu
142     :config (global-anzu-mode)
143     :bind
144     ([remap query-replace] . anzu-query-replace)
145     ([remap query-replace-regexp] . anzu-query-replace-regexp))
146 #+end_src
147 *** TODO This config doesn't work right
148 ** Visual bell
149 Invert modeline color instead of audible bell or the standard visual bell.
150 #+begin_src emacs-lisp
151   (setq visible-bell nil
152         ring-bell-function
153         (lambda () (invert-face 'mode-line)
154           (run-with-timer 0.1 nil #'invert-face 'mode-line)))
155 #+end_src
156 * Evil mode
157 ** General
158 #+begin_src emacs-lisp
159   (use-package evil
160     :custom (select-enable-clipboard nil)
161     :config
162     (evil-mode)
163     (fset 'evil-visual-update-x-selection 'ignore) ;; Keep clipboard and register seperate
164     ;; Use visual line motions even outside of visual-line-mode buffers
165     (evil-global-set-key 'motion "j" 'evil-next-visual-line)
166     (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
167     (global-set-key (kbd "<escape>") 'keyboard-escape-quit))
168 #+end_src
169 ** Evil collection
170 Evil bindings for tons of packages.
171 #+begin_src emacs-lisp
172   (use-package evil-collection
173     :after evil
174     :init (evil-collection-init)
175     :custom (evil-collection-setup-minibuffer t))
176 #+end_src
177 ** Surround
178 tpope prevails!
179 #+begin_src emacs-lisp
180   (use-package evil-surround
181     :config (global-evil-surround-mode))
182 #+end_src
183 ** Nerd commenter
184 Makes commenting super easy
185 #+begin_src emacs-lisp
186   (use-package evil-nerd-commenter
187     :bind (:map evil-normal-state-map
188                 ("gc" . evilnc-comment-or-uncomment-lines))
189     :custom (evilnc-invert-comment-line-by-line nil))
190 #+end_src
191 ** Undo redo
192 Fix the oopsies!
193 #+begin_src emacs-lisp
194   (evil-set-undo-system 'undo-redo)
195 #+end_src
196 ** Number incrementing
197 Add back C-a/C-x bindings.
198 #+begin_src emacs-lisp
199   (use-package evil-numbers
200     :straight (evil-numbers :type git :host github :repo "juliapath/evil-numbers")
201     :bind (:map evil-normal-state-map
202                 ("C-M-a" . evil-numbers/inc-at-pt)
203                 ("C-M-x" . evil-numbers/dec-at-pt)))
204 #+end_src
205 ** Evil org
206 #+begin_src emacs-lisp
207   (use-package evil-org
208     :after org
209     :hook (org-mode . evil-org-mode)
210     :config
211     (evil-org-set-key-theme '(textobjects insert navigation shift todo)))
212
213   (use-package evil-org-agenda
214     :straight (:type built-in)
215     :after evil-org
216     :config (evil-org-agenda-set-keys))
217 #+end_src
218 * Org mode
219 ** General
220 #+begin_src emacs-lisp
221   (use-package org
222     :straight (:type built-in)
223     :commands (org-capture org-agenda)
224     :custom
225     (org-ellipsis " ▾")
226     (org-agenda-start-with-log-mode t)
227     (org-agenda-files (quote ("~/Org/tasks.org" "~/Org/break.org")))
228     (org-log-done 'time)
229     (org-log-into-drawer t)
230     (org-src-tab-acts-natively t)
231     (org-src-fontify-natively t)
232     (org-startup-indented t)
233     (org-hide-emphasis-markers t)
234     (org-fontify-whole-block-delimiter-line nil)
235     (org-archive-default-command 'org-archive-to-archive-sibling)
236     :bind
237     ("C-c a" . org-agenda)
238     (:map evil-normal-state-map ("ga" . org-archive-subtree-default)))
239 #+end_src
240 ** Tempo
241 Define templates for lots of common structure elements. Mostly just used within this file.
242 #+begin_src emacs-lisp
243   (use-package org-tempo
244     :after org
245     :straight (:type built-in)
246     :config
247     (dolist (addition '(("el" . "src emacs-lisp")
248                         ("el" . "src emacs-lisp")
249                         ("sp" . "src conf :tangle ~/.spectrwm.conf")
250                         ("ash" . "src shell :tangle ~/.config/ash/ashrc")
251                         ("pi" . "src conf :tangle ~/.config/picom/picom.conf")
252                         ("git" . "src conf :tangle ~/.gitconfig")
253                         ("du" . "src conf :tangle ~/.config/dunst/dunstrc")
254                         ("za" . "src conf :tangle ~/.config/zathura/zathurarc")
255                         ("ff1" . "src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css")
256                         ("ff2" . "src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css")
257                         ("xr" . "src conf :tangle ~/.Xresources")
258                         ("tm" . "src conf :tangle ~/.tmux.conf")
259                         ("gp" . "src conf :tangle ~/.gnupg/gpg.conf")
260                         ("ag" . "src conf :tangle ~/.gnupg/gpg-agent.conf")))
261       (add-to-list 'org-structure-template-alist addition)))
262 #+end_src
263 * Autocompletion
264 ** Ivy
265 A well balanced completion framework.
266 #+begin_src emacs-lisp
267   (use-package ivy
268     :config (ivy-mode))
269 #+end_src
270 ** Ivy-rich
271 #+begin_src emacs-lisp
272   (use-package ivy-rich
273     :after (ivy counsel)
274     :config (ivy-rich-mode))
275 #+end_src
276 ** Counsel
277 Ivy everywhere.
278 #+begin_src emacs-lisp
279   (use-package counsel
280     :config (counsel-mode))
281 #+end_src
282 ** Remember frequent commands
283 #+begin_src emacs-lisp
284   (use-package ivy-prescient
285     :after counsel
286     :config
287     (prescient-persist-mode)
288     (ivy-prescient-mode))
289 #+end_src
290 * Emacs OS
291 ** RSS
292 Use elfeed for reading RSS. I have another file with all the feeds in it that I'd rather keep private.
293 #+begin_src emacs-lisp
294   (use-package elfeed
295     :bind (("C-c e" . elfeed))
296     :config (load "~/.emacs.d/feeds.el")
297     :bind (:map elfeed-search-mode-map ("C-c C-o" . 'elfeed-show-visit)))
298 #+end_src
299 ** Email
300 Use mu4e for reading emails.
301 Contexts are a not very well known feature of mu4e that makes it super easy to manage multiple accounts. Much better than some of the hacky methods and external packages that I've seen.
302 *** TODO Switch to mbsync
303 =offlineimap= really crappy (slow and requires python2), and I need to replace it with =mbsync=.
304 *** TODO Include mbsync/offlineimap config
305 *** TODO Split up and document this config a bit
306 *** Setup
307 #+begin_src emacs-lisp
308   (use-package smtpmail
309     :straight (:type built-in))
310   (use-package mu4e
311     :load-path "/usr/share/emacs/site-lisp/mu4e"
312     :straight (:build nil)
313     :bind (("C-c m" . mu4e))
314     :config
315     (setq user-full-name "Armaan Bhojwani"
316           smtpmail-local-domain "armaanb.net"
317           smtpmail-stream-type 'ssl
318           smtpmail-smtp-service '465
319           mu4e-change-filenames-when-moving t
320           mu4e-get-mail-command "offlineimap -q"
321           message-citation-line-format "On %a %d %b %Y at %R, %f wrote:\n"
322           message-citation-line-function 'message-insert-formatted-citation-line
323           mu4e-completing-read-function 'ivy-completing-read
324           mu4e-confirm-quit nil
325           mu4e-view-use-gnus t
326           mail-user-agent 'mu4e-user-agent
327           mail-context-policy 'pick-first
328           mu4e-contexts
329           `( ,(make-mu4e-context
330                :name "school"
331                :enter-func (lambda () (mu4e-message "Entering school context"))
332                :leave-func (lambda () (mu4e-message "Leaving school context"))
333                :match-func (lambda (msg)
334                              (when msg
335                                (string-match-p "^/school" (mu4e-message-field msg :maildir))))
336                :vars '((user-mail-address . "abhojwani22@nobles.edu")
337                        (mu4e-sent-folder . "/school/Sent")
338                        (mu4e-drafts-folder . "/school/Drafts")
339                        (mu4e-trash-folder . "/school/Trash")
340                        (mu4e-refile-folder . "/school/Archive")
341                        (message-cite-reply-position . above)
342                        (user-mail-address . "abhojwani22@nobles.edu")
343                        (smtpmail-smtp-user . "abhojwani22@nobles.edu")
344                        (smtpmail-smtp-server . "smtp.gmail.com")))
345              ,(make-mu4e-context
346                :name "personal"
347                :enter-func (lambda () (mu4e-message "Entering personal context"))
348                :leave-func (lambda () (mu4e-message "Leaving personal context"))
349                :match-func (lambda (msg)
350                              (when msg
351                                (string-match-p "^/personal" (mu4e-message-field msg :maildir))))
352                :vars '((mu4e-sent-folder . "/personal/Sent")
353                        (mu4e-drafts-folder . "/personal/Drafts")
354                        (mu4e-trash-folder . "/personal/Trash")
355                        (mu4e-refile-folder . "/personal/Archive")
356                        (user-mail-address . "me@armaanb.net")
357                        (message-cite-reply-position . below)
358                        (smtpmail-smtp-user . "me@armaanb.net")
359                        (smtpmail-smtp-server . "smtp.mailbox.org")))))
360     (add-to-list 'mu4e-bookmarks
361                  '(:name "Unified inbox"
362                          :query "maildir:\"/personal/INBOX\" or maildir:\"/school/INBOX\""
363                          :key ?b))
364     :hook ((mu4e-compose-mode . flyspell-mode)
365            (mu4e-compose-mode . auto-fill-mode)
366            (message-send-hook . (lambda () (unless (yes-or-no-p "Ya sure 'bout that?")
367                                              (signal 'quit nil))))))
368 #+end_src
369 *** Discourage Gnus from displaying HTML emails
370 #+begin_src emacs-lisp
371   (with-eval-after-load "mm-decode"
372     (add-to-list 'mm-discouraged-alternatives "text/html")
373     (add-to-list 'mm-discouraged-alternatives "text/richtext"))
374 #+end_src
375 ** Default browser
376 Set EWW as default browser except for multimedia which should open in MPV.
377 #+begin_src emacs-lisp
378   (defun browse-url-mpv (url &optional new-window)
379     "Open URL in MPV."
380     (interactive)
381     (start-process "mpv" "*mpv*" "mpv" url))
382
383   (setq browse-url-handlers
384         (quote
385          (("youtu\\.?be" . browse-url-mpv)
386           ("peertube.*" . browse-url-mpv)
387           ("vid.*" . browse-url-mpv)
388           ("vid.*" . browse-url-mpv)
389           ("*.mp4" . browse-url-mpv)
390           ("*.mp3" . browse-url-mpv)
391           ("*.ogg" . browse-url-mpv)
392           ("." . eww-browse-url)
393           )))
394 #+end_src
395 ** EWW
396 Some EWW enhancements.
397 *** Give buffer a useful name
398 #+begin_src emacs-lisp
399   ;; From https://protesilaos.com/dotemacs/
400   (defun prot-eww--rename-buffer ()
401     "Rename EWW buffer using page title or URL.
402         To be used by `eww-after-render-hook'."
403     (let ((name (if (eq "" (plist-get eww-data :title))
404                     (plist-get eww-data :url)
405                   (plist-get eww-data :title))))
406       (rename-buffer (format "*%s # eww*" name) t)))
407
408   (use-package eww
409     :straight (:type built-in)
410     :bind (("C-c w" . eww))
411     :hook (eww-after-render-hook prot-eww--rename-buffer))
412 #+end_src
413 *** Keybinding
414 #+begin_src emacs-lisp
415   (global-set-key (kbd "C-c w") 'eww)
416 #+end_src
417 ** IRC
418 Circe is a really nice IRC client that claims to be above RCIRC and below ERC in terms of features. ERC felt a bit messy and finicky to me, and Circe has all the features that I need. This setup gets the password for my bouncer (Pounce) instances via my =~/.authinfo.gpg= file.
419 #+begin_src emacs-lisp
420   (defun fetch-password (&rest params)
421     (require 'auth-source)
422     (let ((match (car (apply 'auth-source-search params))))
423       (if match
424           (let ((secret (plist-get match :secret)))
425             (if (functionp secret)
426                 (funcall secret)
427               secret))
428         (error "Password not found for %S" params))))
429
430   (use-package circe
431     :config
432     (enable-lui-track)
433     (enable-circe-color-nicks)
434     (setq circe-network-defaults '(("libera"
435                                     :host "irc.armaanb.net"
436                                     :nick "emacs"
437                                     :user "emacs"
438                                     :use-tls t
439                                     :port 6698
440                                     :pass (lambda (null) (fetch-password
441                                                           :login "emacs"
442                                                           :machine "irc.armaanb.net"
443                                                           :port 6698)))
444                                    ("oftc"
445                                     :host "irc.armaanb.net"
446                                     :nick "emacs"
447                                     :user "emacs"
448                                     :use-tls t
449                                     :port 6699
450                                     :pass (lambda (null) (fetch-password
451                                                           :login "emacs"
452                                                           :machine "irc.armaanb.net"
453                                                           :port 6699)))
454                                    ("tilde"
455                                     :host "irc.armaanb.net"
456                                     :nick "emacs"
457                                     :user "emacs"
458                                     :use-tls t
459                                     :port 6696
460                                     :pass (lambda (null) (fetch-password
461                                                           :login "emacs"
462                                                           :machine "irc.armaanb.net"
463                                                           :port 6696)))))
464     :custom (circe-default-part-message "goodbye!")
465     :bind (:map circe-mode-map ("C-c C-r" . circe-reconnect-all)))
466
467   (defun acheam-irc ()
468     "Open circe"
469     (interactive)
470     (if (get-buffer "irc.armaanb.net:6696")
471         (switch-to-buffer "irc.armaanb.net:6696")
472       (progn (circe "libera")
473              (circe "oftc")
474              (circe "tilde"))))
475
476   (global-set-key (kbd "C-c i") 'acheam-irc)
477 #+end_src
478 ** Calendar
479 Still experimenting with this setup. Not sure if I will keep it, but it works well for seeing my calendar events. I use =vdirsyncer= to sync my calendar events which I'm really not happy with.
480 #+begin_src emacs-lisp
481   (defun sync-calendar ()
482     "Sync calendars with vdirsyncer"
483     (interactive)
484     (async-shell-command "vdirsyncer sync"))
485
486   (use-package calfw
487     :bind (:map cfw:calendar-mode-map ("C-S-u" . sync-calendar)))
488   (use-package calfw-ical)
489   (use-package calfw-org)
490
491   (defun acheam-calendar ()
492     "Open calendars"
493     (interactive)
494     (cfw:open-calendar-buffer
495      :contents-sources (list
496                         (cfw:org-create-source "Green")
497                         (cfw:ical-create-source
498                          "Personal"
499                          "~/.local/share/vdirsyncer/mailbox/Y2FsOi8vMC8zMQ.ics"
500                          "Gray")
501                         (cfw:ical-create-source
502                          "Personal"
503                          "~/.local/share/vdirsyncer/mailbox/Y2FsOi8vMC8zMQ.ics"
504                          "Red")
505                         (cfw:ical-create-source
506                          "School"
507                          "~/.local/share/vdirsyncer/school/abhojwani22@nobles.edu.ics"
508                          "Cyan"))
509      :view 'week))
510
511   (global-set-key (kbd "C-c c") 'acheam-calendar)
512 #+end_src
513 ** PDF reader
514 #+begin_src emacs-lisp
515   (use-package pdf-tools
516     :hook (pdf-view-mode . pdf-view-midnight-minor-mode))
517 #+end_src
518 * Emacs IDE
519 ** Python formatting
520 #+begin_src emacs-lisp
521   (use-package blacken
522     :hook (python-mode . blacken-mode)
523     :custom (blacken-line-length 79))
524
525 #+end_src
526 ** Strip trailing whitespace
527 #+begin_src emacs-lisp
528   (use-package ws-butler
529     :config (ws-butler-global-mode))
530 #+end_src
531 ** Flycheck
532 Automatic linting. I need to look into configuring this more.
533 #+begin_src emacs-lisp
534   (use-package flycheck
535     :config (global-flycheck-mode))
536 #+end_src
537 ** Project management
538 I never use this, but apparently its very powerful. Another item on my todo list.
539 #+begin_src emacs-lisp
540   (use-package projectile
541     :config (projectile-mode)
542     :custom ((projectile-completion-system 'ivy))
543     :bind-keymap
544     ("C-c p" . projectile-command-map)
545     :init
546     (when (file-directory-p "~/Code")
547       (setq projectile-project-search-path '("~/Code")))
548     (setq projectile-switch-project-action #'projectile-dired))
549
550   (use-package counsel-projectile
551     :after projectile
552     :config (counsel-projectile-mode))
553 #+end_src
554 ** Dired
555 The best file manager!
556 #+begin_src emacs-lisp
557   (use-package dired
558     :straight (:type built-in)
559     :commands (dired dired-jump)
560     :custom ((dired-listing-switches "-agho --group-directories-first"))
561     :config (evil-collection-define-key 'normal 'dired-mode-map
562               "h" 'dired-single-up-directory
563               "l" 'dired-single-buffer))
564
565   (use-package dired-single
566     :commands (dired dired-jump))
567
568   (use-package dired-open
569     :commands (dired dired-jump)
570     :custom (dired-open-extensions '(("png" . "feh")
571                                      ("mkv" . "mpv"))))
572
573   (use-package dired-hide-dotfiles
574     :hook (dired-mode . dired-hide-dotfiles-mode)
575     :config
576     (evil-collection-define-key 'normal 'dired-mode-map
577       "H" 'dired-hide-dotfiles-mode))
578 #+end_src
579 ** Git
580 *** Magit
581 A very good Git interface.
582 #+begin_src emacs-lisp
583   (use-package magit)
584 #+end_src
585 *** Email
586 #+begin_src emacs-lisp
587   (use-package piem)
588   (use-package git-email
589     :straight (git-email :repo "https://git.sr.ht/~yoctocell/git-email")
590     :config (git-email-piem-mode))
591 #+end_src
592 * General text editing
593 ** Indentation
594 Automatically indent after every change. I'm not sure how much I like this. It slows down the editor and code sometimes ends up in a half-indented state meaning I have to manually reformat using "==" anyways.
595 #+begin_src emacs-lisp
596   (use-package aggressive-indent
597     :config (global-aggressive-indent-mode))
598 #+end_src
599 ** Spell checking
600 Spell check in text mode, and in prog-mode comments.
601 #+begin_src emacs-lisp
602   (dolist (hook '(text-mode-hook))
603     (add-hook hook (lambda () (flyspell-mode))))
604   (dolist (hook '(change-log-mode-hook log-edit-mode-hook))
605     (add-hook hook (lambda () (flyspell-mode -1))))
606   (add-hook 'prog-mode (lambda () (flyspell-prog mode)))
607   (setq ispell-silently-savep t)
608 #+end_src
609 ** Sane tab width
610 #+begin_src emacs-lisp
611   (setq-default tab-width 2)
612 #+end_src
613 ** Save place
614 Opens file where you left it.
615 #+begin_src emacs-lisp
616   (save-place-mode)
617 #+end_src
618 ** Writing mode
619 Distraction free writing a la junegunn/goyo.
620 #+begin_src emacs-lisp
621   (use-package olivetti
622     :bind ("C-c o" . olivetti-mode))
623 #+end_src
624 ** Abbreviations
625 Abbreviate things! I just use this for things like my email address and copyright notice.
626 #+begin_src emacs-lisp
627   (setq abbrev-file-name "~/.emacs.d/abbrevs.el")
628   (setq save-abbrevs 'silent)
629   (setq-default abbrev-mode t)
630 #+end_src
631 ** TRAMP
632 #+begin_src emacs-lisp
633   (setq tramp-default-method "ssh")
634 #+end_src
635 ** Follow version controlled symlinks
636 #+begin_src emacs-lisp
637   (setq vc-follow-symlinks t)
638 #+end_src
639 ** Open file as root
640 #+begin_src emacs-lisp
641   (defun doas-edit (&optional arg)
642     "Edit currently visited file as root.
643
644     With a prefix ARG prompt for a file to visit.
645     Will also prompt for a file to visit if current
646     buffer is not visiting a file.
647
648     Modified from Emacs Redux."
649     (interactive "P")
650     (if (or arg (not buffer-file-name))
651         (find-file (concat "/doas:root@localhost:"
652                            (ido-read-file-name "Find file(as root): ")))
653       (find-alternate-file (concat "/doas:root@localhost:" buffer-file-name))))
654
655     (global-set-key (kbd "C-x C-r") #'doas-edit)
656 #+end_src
657 ** Markdown mode
658 #+begin_src emacs-lisp
659   (use-package markdown-mode)
660 #+end_src
661 * Keybindings
662 ** Switch windows
663 #+begin_src emacs-lisp
664   (use-package ace-window
665     :bind ("M-o" . ace-window))
666 #+end_src
667 ** Kill current buffer
668 Makes "C-x k" binding faster.
669 #+begin_src emacs-lisp
670   (substitute-key-definition 'kill-buffer 'kill-buffer-and-window global-map)
671 #+end_src
672 * Other settings
673 ** OpenSCAD syntax
674 #+begin_src emacs-lisp
675   (use-package scad-mode)
676 #+end_src
677 ** Control backup and lock files
678 Stop backup files from spewing everywhere.
679 #+begin_src emacs-lisp
680   (setq backup-directory-alist `(("." . "~/.emacs.d/backups"))
681         create-lockfiles nil)
682 #+end_src
683 ** Make yes/no easier
684 #+begin_src emacs-lisp
685   (defalias 'yes-or-no-p 'y-or-n-p)
686 #+end_src
687 ** Move customize file
688 No more clogging up init.el.
689 #+begin_src emacs-lisp
690   (setq custom-file "~/.emacs.d/custom.el")
691   (load custom-file)
692 #+end_src
693 ** Better help
694 #+begin_src emacs-lisp
695   (use-package helpful
696     :commands (helpful-callable helpful-variable helpful-command helpful-key)
697     :custom
698     (counsel-describe-function-function #'helpful-callable)
699     (counsel-describe-variable-function #'helpful-variable)
700     :bind
701     ([remap describe-function] . counsel-describe-function)
702     ([remap describe-command] . helpful-command)
703     ([remap describe-variable] . counsel-describe-variable)
704     ([remap describe-key] . helpful-key))
705 #+end_src
706 ** GPG
707 #+begin_src emacs-lisp
708   (use-package epa-file
709     :straight (:type built-in)
710     :custom
711     (epa-file-select-keys nil)
712     (epa-file-encrypt-to '("me@armaanb.net"))
713     (password-cache-expiry (* 60 15)))
714
715   (use-package pinentry
716     :config (pinentry-start))
717 #+end_src
718 ** Pastebin
719 #+begin_src emacs-lisp
720   (use-package 0x0
721     :straight (0x0 :type git :repo "https://git.sr.ht/~zge/nullpointer-emacs")
722     :custom (0x0-default-service 'envs))
723 #+end_src
724 *** TODO Replace this with uploading to my own server
725 Similar to the ufile alias in my ashrc
726 ** Automatically clean buffers
727 Automatically close unused buffers (except those of Circe) at midnight.
728 #+begin_src emacs-lisp
729   (midnight-mode)
730   (add-to-list 'clean-buffer-list-kill-never-regexps (lambda (buffer-name)
731                                                        (with-current-buffer buffer-name
732                                                          (derived-mode-p 'lui-mode))))
733 #+end_src
734 * Tangles
735 ** Spectrwm
736 Spectrwm is a really awesome window manager! Would highly recommend.
737 *** General settings
738 #+begin_src conf :tangle ~/.spectrwm.conf
739   workspace_limit = 5
740   warp_pointer = 1
741   modkey = Mod4
742   autorun = ws[1]:/home/armaa/Code/scripts/autostart
743 #+end_src
744 *** Bar
745 Disable the bar by default (it can still be brought back up with MOD+b). The font just needs to be set to something that you have installed, otherwise spectrwm won't launch.
746 #+begin_src conf :tangle ~/.spectrwm.conf
747   bar_enabled = 0
748   bar_font = xos4 JetBrains Mono:pixelsize=14:antialias=true # any installed font
749 #+end_src
750 *** Keybindings
751 I'm not a huge fan of how spectrwm handles keybindings, probably my biggest gripe with it.
752 **** WM actions
753 #+begin_src conf :tangle ~/.spectrwm.conf
754   program[term] = st -e tmux
755   program[screenshot_all] = flameshot gui
756   program[notif] = /home/armaa/Code/scripts/setter status
757   program[pass] = /home/armaa/Code/scripts/passmenu
758
759   bind[notif] = MOD+n
760   bind[pass] = MOD+Shift+p
761 #+end_src
762 **** Media keys
763 #+begin_src conf :tangle ~/.spectrwm.conf
764   program[paup] = /home/armaa/Code/scripts/setter audio +5
765   program[padown] = /home/armaa/Code/scripts/setter audio -5
766   program[pamute] = /home/armaa/Code/scripts/setter audio
767   program[brigup] = /home/armaa/Code/scripts/setter brightness +10%
768   program[brigdown] = /home/armaa/Code/scripts/setter brightness 10%-
769   program[next] = playerctl next
770   program[prev] = playerctl previous
771   program[pause] = playerctl play-pause
772
773   bind[padown] = XF86AudioLowerVolume
774   bind[paup] = XF86AudioRaiseVolume
775   bind[pamute] = XF86AudioMute
776   bind[brigdown] = XF86MonBrightnessDown
777   bind[brigup] = XF86MonBrightnessUp
778   bind[pause] = XF86AudioPlay
779   bind[next] = XF86AudioNext
780   bind[prev] = XF86AudioPrev
781 #+end_src
782 **** HJKL
783 #+begin_src conf :tangle ~/.spectrwm.conf
784   program[h] = xdotool keyup h key --clearmodifiers Left
785   program[j] = xdotool keyup j key --clearmodifiers Down
786   program[k] = xdotool keyup k key --clearmodifiers Up
787   program[l] = xdotool keyup l key --clearmodifiers Right
788
789   bind[h] = MOD + Control + h
790   bind[j] = MOD + Control + j
791   bind[k] = MOD + Control + k
792   bind[l] = MOD + Control + l
793 #+end_src
794 **** Programs
795 #+begin_src conf :tangle ~/.spectrwm.conf
796   program[email] = emacsclient -ce "(mu4e)"
797   program[irc] = emacsclient -ce '(acheam-irc)'
798   program[rss] = emacsclient -ce '(elfeed)'
799   program[calendar] = emacsclient -ce '(acheam-calendar)'
800   program[calc] = emacsclient -ce '(progn (calc) (windmove-up) (delete-window))'
801   program[firefox] = firefox
802   program[emacs] = emacsclient -c
803
804   bind[email] = MOD+Control+1
805   bind[irc] = MOD+Control+2
806   bind[rss] = MOD+Control+3
807   bind[calendar] = MOD+Control+4
808   bind[calc] = MOD+Control+5
809   bind[firefox] = MOD+Control+0
810   bind[emacs] = MOD+Control+Return
811 #+end_src
812 *** Quirks
813 Float some specific programs by default.
814 #+begin_src conf :tangle ~/.spectrwm.conf
815   quirk[Castle Menu] = FLOAT
816   quirk[momen] = FLOAT
817 #+end_src
818 ** Ash
819 *** Options
820 Use the vi editing mode. I still haven't found a good way to show visual feedback of the current mode. Ideally the cursor would change to a beam when in insert mode, and a box when in normal mode.
821 #+begin_src conf :tangle ~/.config/ash/ashrc
822   set -o vi
823 #+end_src
824 *** Functions
825 **** Finger
826 #+begin_src shell :tangle ~/.config/ash/ashrc
827   finger() {
828       user=$(echo "$1" | cut -f 1 -d '@')
829       host=$(echo "$1" | cut -f 2 -d '@')
830       echo $user | nc "$host" 79
831   }
832 #+end_src
833 **** Upload to ftp.armaanb.net
834 #+begin_src shell :tangle ~/.config/ash/ashrc
835   _uprint() {
836       echo "https://l.armaanb.net/$(basename "$1")" | tee /dev/tty | xclip -sel c
837   }
838
839   _uup() {
840       rsync "$1" "root@armaanb.net:/var/ftp/pub/$2" --chmod 644
841   }
842
843   ufile() {
844       _uup "$1" "$2"
845       _uprint "$1"
846   }
847
848   uclip() {
849       tmp=$(mktemp)
850       xclip -o -sel c >> "$tmp"
851       basetmp=$(echo "$tmp" | tail -c +5)
852       _uup "$tmp" "$basetmp"
853       _uprint "$basetmp"
854       rm -f "$tmp"
855   }
856 #+end_src
857 *** Exports
858 #+begin_src shell :tangle ~/.config/ash/ashrc
859   export EDITOR="emacsclient -c"
860   export VISUAL="$EDITOR"
861   export TERM=xterm-256color # for compatability
862
863   export GPG_TTY="$(tty)"
864   export MANPAGER='nvim +Man!'
865   export PAGER='less'
866
867   export GTK_USE_PORTAL=1
868
869   export PATH="/home/armaa/.local/bin:$PATH" # prioritize .local/bin
870   export PATH="/home/armaa/Code/scripts:$PATH" # prioritize my scripts
871   export PATH="/home/armaa/Code/scripts/bin:$PATH" # prioritize my bins
872   export PATH="$PATH:/home/armaa/.cargo/bin"
873   export PATH="$PATH:/home/armaa/.local/share/gem/ruby/2.7.0/bin"
874   export PATH="$PATH:/usr/sbin"
875   export PATH="$PATH:/opt/FreeTube/freetube"
876
877   export LC_ALL="en_US.UTF-8"
878   export LC_CTYPE="en_US.UTF-8"
879   export LANGUAGE="en_US.UTF-8"
880
881   export KISS_PATH="/home/armaa/Virtual/kiss/home/armaa/kiss-repo"
882   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/core"
883   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/extra"
884   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/xorg"
885   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/testing"
886   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-community/community"
887   export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
888 #+end_src
889 *** Aliases
890 **** SSH
891 #+begin_src shell :tangle ~/.config/ash/ashrc
892   alias bhoji-drop='ssh -p 23 root@armaanb.net'
893   alias irc='ssh root@armaanb.net -t abduco -A irc catgirl freenode'
894   alias union='ssh 192.168.1.18'
895   alias mine='ssh -p 23 root@pickupserver.cc'
896   alias tcf='ssh root@204.48.23.68'
897   alias ngmun='ssh root@157.245.89.25'
898   alias prox='ssh root@192.168.1.224'
899   alias ncq='ssh root@143.198.123.17'
900   alias envs='ssh acheam@envs.net'
901 #+end_src
902 **** File management
903 #+begin_src shell :tangle ~/.config/ash/ashrc
904   alias ls='ls -lh --group-directories-first'
905   alias la='ls -A'
906   alias df='df -h / /boot'
907   alias du='du -h'
908   alias free='free -m'
909   alias cp='cp -riv'
910   alias rm='rm -iv'
911   alias mv='mv -iv'
912   alias ln='ln -v'
913   alias grep='grep -in'
914   alias mkdir='mkdir -pv'
915   alias lanex='java -jar ~/.local/share/lxc/lanxchange.jar'
916   emacs() { $EDITOR "$@" & }
917   alias vim="emacs"
918 #+end_src
919 **** System management
920 #+begin_src shell :tangle ~/.config/ash/ashrc
921   alias crontab='crontab-argh'
922   alias sudo='doas'
923   alias pasu='git -C ~/.password-store push'
924   alias yadu='yadm add -u && yadm commit -m "Updated `date -Iseconds`" && \
925     yadm push'
926 #+end_src
927 **** Networking
928 #+begin_src shell :tangle ~/.config/ash/ashrc
929   alias ping='ping -c 10'
930   alias gps='gpg --keyserver keyserver.ubuntu.com --search-keys'
931   alias gpp='gpg --keyserver keyserver.ubuntu.com --recv-key'
932   alias plan='T=$(mktemp) && \
933           rsync root@armaanb.net:/etc/finger/plan.txt "$T" && \
934           TT=$(mktemp) && \
935           head -n -2 $T > $TT && \
936           /bin/nvim $TT && \
937           echo >> "$TT" && \
938           echo "Last updated: $(date -R)" >> "$TT" && \
939           fold -sw 72 "$TT" > "$T"| \
940           rsync "$T" root@armaanb.net:/etc/finger/plan.txt && \
941           rm -f "$T"'
942 #+end_src
943 **** Virtual machines, chroots
944 #+begin_src shell :tangle ~/.config/ash/ashrc
945   alias ckiss="doas chrooter ~/Virtual/kiss"
946   alias cdebian="doas chrooter ~/Virtual/debian bash"
947   alias cwindows='devour qemu-system-x86_64 \
948     -smp 3 \
949     -cpu host \
950     -enable-kvm \
951     -m 3G \
952     -device VGA,vgamem_mb=64 \
953     -device intel-hda \
954     -device hda-duplex \
955     -net nic \
956     -net user,smb=/home/armaa/Public \
957     -drive format=qcow2,file=/home/armaa/Virtual/windows.qcow2'
958 #+end_src
959 **** Latin
960 #+begin_src shell :tangle ~/.config/ash/ashrc
961   alias words='gen-shell -c "words"'
962   alias words-e='gen-shell -c "words ~E"'
963 #+end_src
964 **** Other
965 #+begin_src shell :tangle ~/.config/ash/ashrc
966   alias bigrandomfile='dd if=/dev/urandom of=1GB-urandom bs=1M count=1024 \
967     iflag=fullblock'
968   alias bigboringfile='dd if=/dev/zero of=1GB-zero bs=1M count=1024 \
969     iflag=fullblock'
970   alias ytmusic="youtube-dl -x --add-metadata  --audio-format aac \
971     --restrict-filenames -o '%(title)s.%(ext)s'"
972   alias bc='bc -l'
973 #+end_src
974 ** MPV
975 Make MPV play a little bit smoother.
976 #+begin_src conf :tangle ~/.config/mpv/mpv.conf
977   ytdl-format="bestvideo[height<=?1080]+bestaudio/best"
978   hwdec=auto-copy
979 #+end_src
980 ** Inputrc
981 This file is used for any GNU Readline programs. I use Emacs editing mode mostly because of one annoyance which is that to clear the screen using ^L, you have to be in normal mode which is a pain. If there is a way to rebind this, I'd love to know!.
982 #+begin_src conf :tangle ~/.inputrc
983   set editing-mode emacs
984 #+end_src
985 ** Git
986 *** User
987 #+begin_src conf :tangle ~/.gitconfig
988   [user]
989   name = Armaan Bhojwani
990   email = me@armaanb.net
991   signingkey = 0FEB9471E19C49C60CFBEB133C9ED82FFE788E4A
992 #+end_src
993 *** Init
994 #+begin_src conf :tangle ~/.gitconfig
995   [init]
996   defaultBranch = main
997 #+end_src
998 *** GPG
999 #+begin_src conf :tangle ~/.gitconfig
1000   [gpg]
1001   program = gpg
1002 #+end_src
1003 *** Sendemail
1004 #+begin_src conf :tangle ~/.gitconfig
1005   [sendemail]
1006   smtpserver = smtp.mailbox.org
1007   smtpuser = me@armaanb.net
1008   smtpencryption = ssl
1009   smtpserverport = 465
1010   confirm = auto
1011 #+end_src
1012 *** Submodule
1013 #+begin_src conf :tangle ~/.gitconfig
1014   [submodule]
1015   recurse = true
1016 #+end_src
1017 *** Aliases
1018 #+begin_src conf :tangle ~/.gitconfig
1019   [alias]
1020   stat = diff --stat
1021   sclone = clone --depth 1
1022   sclean = clean -dfX
1023   a = add
1024   aa = add .
1025   c = commit
1026   quickfix = commit . --amend --no-edit
1027   p = push
1028   subup = submodule update --remote
1029   loc = diff --stat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 # Empty hash
1030   pushnc = push -o skip-ci
1031 #+end_src
1032 *** Commit
1033 #+begin_src conf :tangle ~/.gitconfig
1034   [commit]
1035   gpgsign = true
1036   verbose = true
1037 #+end_src
1038 ** Dunst
1039 Lightweight notification daemon. Eventually I'd like to replace this with something dbus-less.
1040 *** General
1041 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1042   [global]
1043   font = "JetBrains Mono Medium Nerd Font 11"
1044   allow_markup = yes
1045   format = "<b>%s</b>\n%b"
1046   sort = no
1047   indicate_hidden = yes
1048   alignment = center
1049   bounce_freq = 0
1050   show_age_threshold = 60
1051   word_wrap = yes
1052   ignore_newline = no
1053   geometry = "400x5-10+10"
1054   transparency = 0
1055   idle_threshold = 120
1056   monitor = 0
1057   sticky_history = yes
1058   line_height = 0
1059   separator_height = 1
1060   padding = 8
1061   horizontal_padding = 8
1062   max_icon_size = 32
1063   separator_color = "#ffffff"
1064   startup_notification = false
1065 #+end_src
1066 *** Modes
1067 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1068   [frame]
1069   width = 1
1070   color = "#ffffff"
1071
1072   [shortcuts]
1073   close = mod4+c
1074   close_all = mod4+shift+c
1075   history = mod4+ctrl+c
1076
1077   [urgency_low]
1078   background = "#222222"
1079   foreground = "#ffffff"
1080   highlight = "#ffffff"
1081   timeout = 5
1082
1083   [urgency_normal]
1084   background = "#222222"
1085   foreground = "#ffffff"
1086   highlight = "#ffffff"
1087   timeout = 15
1088
1089   [urgency_critical]
1090   background = "#222222"
1091   foreground = "#a60000"
1092   highlight = "#ffffff"
1093   timeout = 0
1094 #+end_src
1095 ** Zathura
1096 The best document reader!
1097 *** Options
1098 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1099   map <C-i> recolor
1100   map <A-b> toggle_statusbar
1101   set selection-clipboard clipboard
1102   set scroll-step 200
1103
1104   set window-title-basename "true"
1105   set selection-clipboard "clipboard"
1106 #+end_src
1107 *** Colors
1108 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1109   set default-bg         "#000000"
1110   set default-fg         "#ffffff"
1111   set render-loading     true
1112   set render-loading-bg  "#000000"
1113   set render-loading-fg  "#ffffff"
1114
1115   set recolor-lightcolor "#000000" # bg
1116   set recolor-darkcolor  "#ffffff" # fg
1117   set recolor            "true"
1118 #+end_src
1119 ** Firefox
1120 Just some basic Firefox CSS. Will probably have to rewrite for the Proton redesign.
1121 *** Swap tab and URL bars
1122 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1123   #nav-bar {
1124       -moz-box-ordinal-group: 1 !important;
1125   }
1126
1127   #PersonalToolbar {
1128       -moz-box-ordinal-group: 2 !important;
1129   }
1130
1131   #titlebar {
1132       -moz-box-ordinal-group: 3 !important;
1133   }
1134 #+end_src
1135 *** Hide URL bar when not focused.
1136 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1137   #navigator-toolbox:not(:focus-within):not(:hover) {
1138       margin-top: -30px;
1139   }
1140
1141   #navigator-toolbox {
1142       transition: 0.1s margin-top ease-out;
1143   }
1144 #+end_src
1145 *** Black screen by default
1146 userChrome.css:
1147 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1148   #main-window,
1149   #browser,
1150   #browser vbox#appcontent tabbrowser,
1151   #content,
1152   #tabbrowser-tabpanels,
1153   #tabbrowser-tabbox,
1154   browser[type="content-primary"],
1155   browser[type="content"] > html,
1156   .browserContainer {
1157       background: black !important;
1158       color: #fff !important;
1159   }
1160 #+end_src
1161
1162 userContent.css:
1163 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css
1164   @-moz-document url("about:home"), url("about:blank"), url("about:newtab") {
1165       body {
1166           background: black !important;
1167       }
1168   }
1169 #+end_src
1170 ** Xresources
1171 Modus operandi theme. No program I use checks for anything beyond foreground and background, but hey, it can't hurt to have all the colors in there.
1172 #+begin_src conf :tangle ~/.Xresources
1173   ! special
1174   ,*.foreground:   #ffffff
1175   ,*.background:   #000000
1176   ,*.cursorColor:  #ffffff
1177
1178   ! black
1179   ,*.color0:       #000000
1180   ,*.color8:       #555555
1181
1182   ! red
1183   ,*.color1:       #ff8059
1184   ,*.color9:       #ffa0a0
1185
1186   ! green
1187   ,*.color2:       #00fc50
1188   ,*.color10:      #88cf88
1189
1190   ! yellow
1191   ,*.color3:       #eecc00
1192   ,*.color11:      #d2b580
1193
1194   ! blue
1195   ,*.color4:       #29aeff
1196   ,*.color12:      #92baff
1197
1198   ! magenta
1199   ,*.color5:       #feacd0
1200   ,*.color13:      #e0b2d6
1201
1202   ! cyan
1203   ,*.color6:       #00d3d0
1204   ,*.color14:      #a0bfdf
1205
1206   ! white
1207   ,*.color7:       #eeeeee
1208   ,*.color15:      #dddddd
1209 #+end_src
1210 ** Tmux
1211 I use tmux in order to keep my st build light. Still learning how it works.
1212 #+begin_src conf :tangle ~/.tmux.conf
1213   set -g status off
1214   set -g mouse on
1215   set-option -g history-limit 50000
1216   set-window-option -g mode-keys vi
1217   bind-key -T copy-mode-vi 'v' send -X begin-selection
1218   bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
1219 #+end_src
1220 ** GPG
1221 *** Config
1222 #+begin_src conf :tangle ~/.gnupg/gpg.conf
1223   default-key 3C9ED82FFE788E4A
1224   use-agent
1225 #+end_src
1226 *** Agent
1227 #+begin_src conf :tangle ~/.gnupg/gpg-agent.conf
1228   pinentry-program /sbin/pinentry-gnome3
1229   max-cache-ttl 600
1230   default-cache-ttl 600
1231   allow-emacs-pinentry
1232 #+end_src