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