]> git.armaanb.net Git - config.org.git/blob - config.org
Switch to scratch buffer before launching things
[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     :bind (:map ivy-minibuffer-map
269            ("TAB" . ivy-alt-done))
270            (:map ivy-switch-buffer-map
271            ("M-d" . ivy-switch-buffer-kill))
272     :config (ivy-mode))
273 #+end_src
274 ** Ivy-rich
275 #+begin_src emacs-lisp
276   (use-package ivy-rich
277     :after (ivy counsel)
278     :config (ivy-rich-mode))
279 #+end_src
280 ** Counsel
281 Ivy everywhere.
282 #+begin_src emacs-lisp
283   (use-package counsel
284     :bind ("C-M-j" . 'counsel-switch-buffer)
285     :config (counsel-mode))
286 #+end_src
287 ** Remember frequent commands
288 #+begin_src emacs-lisp
289   (use-package ivy-prescient
290     :after counsel
291     :config
292     (prescient-persist-mode)
293     (ivy-prescient-mode))
294 #+end_src
295 * Emacs OS
296 ** RSS
297 Use elfeed for reading RSS. I have another file with all the feeds in it that I'd rather keep private.
298 #+begin_src emacs-lisp
299   (use-package elfeed
300     :bind (("C-c e" . elfeed))
301     :config (load "~/.emacs.d/feeds.el")
302     :bind (:map elfeed-search-mode-map ("C-c C-o" . 'elfeed-show-visit)))
303 #+end_src
304 ** Email
305 Use mu4e for reading emails.
306 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.
307 *** TODO Switch to mbsync
308 =offlineimap= really crappy (slow and requires python2), and I need to replace it with =mbsync=.
309 *** TODO Include mbsync/offlineimap config
310 *** TODO Split up and document this config a bit
311 *** Setup
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 (switch-to-buffer "*scratch*")
478              (circe "libera")
479              (circe "oftc")
480              (circe "tilde"))))
481
482   (global-set-key (kbd "C-c i") 'acheam-irc)
483 #+end_src
484 ** Calendar
485 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.
486 #+begin_src emacs-lisp
487   (defun sync-calendar ()
488     "Sync calendars with vdirsyncer"
489     (interactive)
490     (async-shell-command "vdirsyncer sync"))
491
492   (use-package calfw
493     :bind (:map cfw:calendar-mode-map ("C-S-u" . sync-calendar)))
494   (use-package calfw-ical)
495   (use-package calfw-org)
496
497   (defun acheam-calendar ()
498     "Open calendars"
499     (interactive)
500     (cfw:open-calendar-buffer
501      :contents-sources (list
502                         (cfw:org-create-source "Green")
503                         (cfw:ical-create-source
504                          "Personal"
505                          "~/.local/share/vdirsyncer/mailbox/Y2FsOi8vMC8zMQ.ics"
506                          "Gray")
507                         (cfw:ical-create-source
508                          "Personal"
509                          "~/.local/share/vdirsyncer/mailbox/Y2FsOi8vMC8zMQ.ics"
510                          "Red")
511                         (cfw:ical-create-source
512                          "School"
513                          "~/.local/share/vdirsyncer/school/abhojwani22@nobles.edu.ics"
514                          "Cyan"))
515      :view 'week))
516
517   (global-set-key (kbd "C-c c") 'acheam-calendar)
518 #+end_src
519 ** PDF reader
520 #+begin_src emacs-lisp
521   (use-package pdf-tools
522     :hook (pdf-view-mode . pdf-view-midnight-minor-mode))
523 #+end_src
524 * Emacs IDE
525 ** Python formatting
526 #+begin_src emacs-lisp
527   (use-package blacken
528     :hook (python-mode . blacken-mode)
529     :custom (blacken-line-length 79))
530
531 #+end_src
532 ** Strip trailing whitespace
533 #+begin_src emacs-lisp
534   (use-package ws-butler
535     :config (ws-butler-global-mode))
536 #+end_src
537 ** Flycheck
538 Automatic linting. I need to look into configuring this more.
539 #+begin_src emacs-lisp
540   (use-package flycheck
541     :config (global-flycheck-mode))
542 #+end_src
543 ** Project management
544 I never use this, but apparently its very powerful. Another item on my todo list.
545 #+begin_src emacs-lisp
546   (use-package projectile
547     :config (projectile-mode)
548     :custom ((projectile-completion-system 'ivy))
549     :bind-keymap
550     ("C-c p" . projectile-command-map)
551     :init
552     (when (file-directory-p "~/Code")
553       (setq projectile-project-search-path '("~/Code")))
554     (setq projectile-switch-project-action #'projectile-dired))
555
556   (use-package counsel-projectile
557     :after projectile
558     :config (counsel-projectile-mode))
559 #+end_src
560 ** Dired
561 The best file manager!
562 #+begin_src emacs-lisp
563   (use-package dired
564     :straight (:type built-in)
565     :commands (dired dired-jump)
566     :custom ((dired-listing-switches "-agho --group-directories-first"))
567     :config (evil-collection-define-key 'normal 'dired-mode-map
568               "h" 'dired-single-up-directory
569               "l" 'dired-single-buffer))
570
571   (use-package dired-single
572     :commands (dired dired-jump))
573
574   (use-package dired-open
575     :commands (dired dired-jump)
576     :custom (dired-open-extensions '(("png" . "feh")
577                                      ("mkv" . "mpv"))))
578
579   (use-package dired-hide-dotfiles
580     :hook (dired-mode . dired-hide-dotfiles-mode)
581     :config
582     (evil-collection-define-key 'normal 'dired-mode-map
583       "H" 'dired-hide-dotfiles-mode))
584 #+end_src
585 ** Git
586 *** Magit
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 *** TODO Replace this with uploading to my own server
731 Similar to the ufile alias in my ashrc
732 ** Automatically clean buffers
733 Automatically close unused buffers (except those of Circe) at midnight.
734 #+begin_src emacs-lisp
735   (midnight-mode)
736   (add-to-list 'clean-buffer-list-kill-never-regexps (lambda (buffer-name)
737                                                        (with-current-buffer buffer-name
738                                                          (derived-mode-p 'lui-mode))))
739 #+end_src
740 * Tangles
741 ** Spectrwm
742 Spectrwm is a really awesome window manager! Would highly recommend.
743 *** General settings
744 #+begin_src conf :tangle ~/.spectrwm.conf
745   workspace_limit = 5
746   warp_pointer = 1
747   modkey = Mod4
748   autorun = ws[1]:/home/armaa/Code/scripts/autostart
749 #+end_src
750 *** Bar
751 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.
752 #+begin_src conf :tangle ~/.spectrwm.conf
753   bar_enabled = 0
754   bar_font = xos4 JetBrains Mono:pixelsize=14:antialias=true # any installed font
755 #+end_src
756 *** Keybindings
757 I'm not a huge fan of how spectrwm handles keybindings, probably my biggest gripe with it.
758 **** WM actions
759 #+begin_src conf :tangle ~/.spectrwm.conf
760   program[term] = st -e tmux
761   program[screenshot_all] = flameshot gui
762   program[notif] = /home/armaa/Code/scripts/setter status
763   program[pass] = /home/armaa/Code/scripts/passmenu
764
765   bind[notif] = MOD+n
766   bind[pass] = MOD+Shift+p
767 #+end_src
768 **** Media keys
769 #+begin_src conf :tangle ~/.spectrwm.conf
770   program[paup] = /home/armaa/Code/scripts/setter audio +5
771   program[padown] = /home/armaa/Code/scripts/setter audio -5
772   program[pamute] = /home/armaa/Code/scripts/setter audio
773   program[brigup] = /home/armaa/Code/scripts/setter brightness +10%
774   program[brigdown] = /home/armaa/Code/scripts/setter brightness 10%-
775   program[next] = playerctl next
776   program[prev] = playerctl previous
777   program[pause] = playerctl play-pause
778
779   bind[padown] = XF86AudioLowerVolume
780   bind[paup] = XF86AudioRaiseVolume
781   bind[pamute] = XF86AudioMute
782   bind[brigdown] = XF86MonBrightnessDown
783   bind[brigup] = XF86MonBrightnessUp
784   bind[pause] = XF86AudioPlay
785   bind[next] = XF86AudioNext
786   bind[prev] = XF86AudioPrev
787 #+end_src
788 **** HJKL
789 #+begin_src conf :tangle ~/.spectrwm.conf
790   program[h] = xdotool keyup h key --clearmodifiers Left
791   program[j] = xdotool keyup j key --clearmodifiers Down
792   program[k] = xdotool keyup k key --clearmodifiers Up
793   program[l] = xdotool keyup l key --clearmodifiers Right
794
795   bind[h] = MOD + Control + h
796   bind[j] = MOD + Control + j
797   bind[k] = MOD + Control + k
798   bind[l] = MOD + Control + l
799 #+end_src
800 **** Programs
801 #+begin_src conf :tangle ~/.spectrwm.conf
802   program[email] = emacsclient -ce '(progn (switch-to-buffer "*scratch*") (mu4e))'
803   program[irc] = emacsclient -ce '(acheam-irc)'
804   program[rss] = emacsclient -ce '(elfeed)'
805   program[calendar] = emacsclient -ce '(acheam-calendar)'
806   program[calc] = emacsclient -ce '(progn (calc) (windmove-up) (delete-window))'
807   program[firefox] = firefox
808   program[emacs] = emacsclient -c
809
810   bind[email] = MOD+Control+1
811   bind[irc] = MOD+Control+2
812   bind[rss] = MOD+Control+3
813   bind[calendar] = MOD+Control+4
814   bind[calc] = MOD+Control+5
815   bind[firefox] = MOD+Control+0
816   bind[emacs] = MOD+Control+Return
817 #+end_src
818 *** Quirks
819 Float some specific programs by default.
820 #+begin_src conf :tangle ~/.spectrwm.conf
821   quirk[Castle Menu] = FLOAT
822   quirk[momen] = FLOAT
823 #+end_src
824 ** Ash
825 *** Options
826 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.
827 #+begin_src conf :tangle ~/.config/ash/ashrc
828   set -o vi
829 #+end_src
830 *** Functions
831 **** Finger
832 #+begin_src shell :tangle ~/.config/ash/ashrc
833   finger() {
834       user=$(echo "$1" | cut -f 1 -d '@')
835       host=$(echo "$1" | cut -f 2 -d '@')
836       echo $user | nc "$host" 79
837   }
838 #+end_src
839 **** Upload to ftp.armaanb.net
840 #+begin_src shell :tangle ~/.config/ash/ashrc
841   _uprint() {
842       echo "https://l.armaanb.net/$(basename "$1")" | tee /dev/tty | xclip -sel c
843   }
844
845   _uup() {
846       rsync "$1" "root@armaanb.net:/var/ftp/pub/$2" --chmod 644
847   }
848
849   ufile() {
850       _uup "$1" "$2"
851       _uprint "$1"
852   }
853
854   uclip() {
855       tmp=$(mktemp)
856       xclip -o -sel c >> "$tmp"
857       basetmp=$(echo "$tmp" | tail -c +5)
858       _uup "$tmp" "$basetmp"
859       _uprint "$basetmp"
860       rm -f "$tmp"
861   }
862 #+end_src
863 *** Exports
864 #+begin_src shell :tangle ~/.config/ash/ashrc
865   export EDITOR="emacsclient -c"
866   export VISUAL="$EDITOR"
867   export TERM=xterm-256color # for compatability
868
869   export GPG_TTY="$(tty)"
870   export MANPAGER='nvim +Man!'
871   export PAGER='less'
872
873   export GTK_USE_PORTAL=1
874
875   export PATH="/home/armaa/.local/bin:$PATH" # prioritize .local/bin
876   export PATH="/home/armaa/Code/scripts:$PATH" # prioritize my scripts
877   export PATH="/home/armaa/Code/scripts/bin:$PATH" # prioritize my bins
878   export PATH="$PATH:/home/armaa/.cargo/bin"
879   export PATH="$PATH:/home/armaa/.local/share/gem/ruby/2.7.0/bin"
880   export PATH="$PATH:/usr/sbin"
881   export PATH="$PATH:/opt/FreeTube/freetube"
882
883   export LC_ALL="en_US.UTF-8"
884   export LC_CTYPE="en_US.UTF-8"
885   export LANGUAGE="en_US.UTF-8"
886
887   export KISS_PATH="/home/armaa/Virtual/kiss/home/armaa/kiss-repo"
888   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/core"
889   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/extra"
890   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/xorg"
891   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/testing"
892   export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-community/community"
893   export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"
894 #+end_src
895 *** Aliases
896 **** SSH
897 #+begin_src shell :tangle ~/.config/ash/ashrc
898   alias bhoji-drop='ssh -p 23 root@armaanb.net'
899   alias irc='ssh root@armaanb.net -t abduco -A irc catgirl freenode'
900   alias union='ssh 192.168.1.18'
901   alias mine='ssh -p 23 root@pickupserver.cc'
902   alias tcf='ssh root@204.48.23.68'
903   alias ngmun='ssh root@157.245.89.25'
904   alias prox='ssh root@192.168.1.224'
905   alias ncq='ssh root@143.198.123.17'
906   alias envs='ssh acheam@envs.net'
907 #+end_src
908 **** File management
909 #+begin_src shell :tangle ~/.config/ash/ashrc
910   alias ls='ls -lh --group-directories-first'
911   alias la='ls -A'
912   alias df='df -h / /boot'
913   alias du='du -h'
914   alias free='free -m'
915   alias cp='cp -riv'
916   alias rm='rm -iv'
917   alias mv='mv -iv'
918   alias ln='ln -v'
919   alias grep='grep -in'
920   alias mkdir='mkdir -pv'
921   alias lanex='java -jar ~/.local/share/lxc/lanxchange.jar'
922   emacs() { $EDITOR "$@" & }
923   alias vim="emacs"
924 #+end_src
925 **** System management
926 #+begin_src shell :tangle ~/.config/ash/ashrc
927   alias crontab='crontab-argh'
928   alias sudo='doas'
929   alias pasu='git -C ~/.password-store push'
930   alias yadu='yadm add -u && yadm commit -m "Updated `date -Iseconds`" && \
931     yadm push'
932 #+end_src
933 **** Networking
934 #+begin_src shell :tangle ~/.config/ash/ashrc
935   alias ping='ping -c 10'
936   alias gps='gpg --keyserver keyserver.ubuntu.com --search-keys'
937   alias gpp='gpg --keyserver keyserver.ubuntu.com --recv-key'
938   alias plan='T=$(mktemp) && \
939           rsync root@armaanb.net:/etc/finger/plan.txt "$T" && \
940           TT=$(mktemp) && \
941           head -n -2 $T > $TT && \
942           /bin/nvim $TT && \
943           echo >> "$TT" && \
944           echo "Last updated: $(date -R)" >> "$TT" && \
945           fold -sw 72 "$TT" > "$T"| \
946           rsync "$T" root@armaanb.net:/etc/finger/plan.txt && \
947           rm -f "$T"'
948 #+end_src
949 **** Virtual machines, chroots
950 #+begin_src shell :tangle ~/.config/ash/ashrc
951   alias ckiss="doas chrooter ~/Virtual/kiss"
952   alias cdebian="doas chrooter ~/Virtual/debian bash"
953   alias cwindows='devour qemu-system-x86_64 \
954     -smp 3 \
955     -cpu host \
956     -enable-kvm \
957     -m 3G \
958     -device VGA,vgamem_mb=64 \
959     -device intel-hda \
960     -device hda-duplex \
961     -net nic \
962     -net user,smb=/home/armaa/Public \
963     -drive format=qcow2,file=/home/armaa/Virtual/windows.qcow2'
964 #+end_src
965 **** Latin
966 #+begin_src shell :tangle ~/.config/ash/ashrc
967   alias words='gen-shell -c "words"'
968   alias words-e='gen-shell -c "words ~E"'
969 #+end_src
970 **** Other
971 #+begin_src shell :tangle ~/.config/ash/ashrc
972   alias bigrandomfile='dd if=/dev/urandom of=1GB-urandom bs=1M count=1024 \
973     iflag=fullblock'
974   alias bigboringfile='dd if=/dev/zero of=1GB-zero bs=1M count=1024 \
975     iflag=fullblock'
976   alias ytmusic="youtube-dl -x --add-metadata  --audio-format aac \
977     --restrict-filenames -o '%(title)s.%(ext)s'"
978   alias bc='bc -l'
979 #+end_src
980 ** MPV
981 Make MPV play a little bit smoother.
982 #+begin_src conf :tangle ~/.config/mpv/mpv.conf
983   ytdl-format="bestvideo[height<=?1080]+bestaudio/best"
984   hwdec=auto-copy
985 #+end_src
986 ** Inputrc
987 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!.
988 #+begin_src conf :tangle ~/.inputrc
989   set editing-mode emacs
990 #+end_src
991 ** Git
992 *** User
993 #+begin_src conf :tangle ~/.gitconfig
994   [user]
995   name = Armaan Bhojwani
996   email = me@armaanb.net
997   signingkey = 0FEB9471E19C49C60CFBEB133C9ED82FFE788E4A
998 #+end_src
999 *** Init
1000 #+begin_src conf :tangle ~/.gitconfig
1001   [init]
1002   defaultBranch = main
1003 #+end_src
1004 *** GPG
1005 #+begin_src conf :tangle ~/.gitconfig
1006   [gpg]
1007   program = gpg
1008 #+end_src
1009 *** Sendemail
1010 #+begin_src conf :tangle ~/.gitconfig
1011   [sendemail]
1012   smtpserver = smtp.mailbox.org
1013   smtpuser = me@armaanb.net
1014   smtpencryption = ssl
1015   smtpserverport = 465
1016   confirm = auto
1017 #+end_src
1018 *** Submodule
1019 #+begin_src conf :tangle ~/.gitconfig
1020   [submodule]
1021   recurse = true
1022 #+end_src
1023 *** Aliases
1024 #+begin_src conf :tangle ~/.gitconfig
1025   [alias]
1026   stat = diff --stat
1027   sclone = clone --depth 1
1028   sclean = clean -dfX
1029   a = add
1030   aa = add .
1031   c = commit
1032   quickfix = commit . --amend --no-edit
1033   p = push
1034   subup = submodule update --remote
1035   loc = diff --stat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 # Empty hash
1036   pushnc = push -o skip-ci
1037 #+end_src
1038 *** Commit
1039 #+begin_src conf :tangle ~/.gitconfig
1040   [commit]
1041   gpgsign = true
1042   verbose = true
1043 #+end_src
1044 ** Dunst
1045 Lightweight notification daemon. Eventually I'd like to replace this with something dbus-less.
1046 *** General
1047 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1048   [global]
1049   font = "JetBrains Mono Medium Nerd Font 11"
1050   allow_markup = yes
1051   format = "<b>%s</b>\n%b"
1052   sort = no
1053   indicate_hidden = yes
1054   alignment = center
1055   bounce_freq = 0
1056   show_age_threshold = 60
1057   word_wrap = yes
1058   ignore_newline = no
1059   geometry = "400x5-10+10"
1060   transparency = 0
1061   idle_threshold = 120
1062   monitor = 0
1063   sticky_history = yes
1064   line_height = 0
1065   separator_height = 1
1066   padding = 8
1067   horizontal_padding = 8
1068   max_icon_size = 32
1069   separator_color = "#ffffff"
1070   startup_notification = false
1071 #+end_src
1072 *** Modes
1073 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1074   [frame]
1075   width = 1
1076   color = "#ffffff"
1077
1078   [shortcuts]
1079   close = mod4+c
1080   close_all = mod4+shift+c
1081   history = mod4+ctrl+c
1082
1083   [urgency_low]
1084   background = "#222222"
1085   foreground = "#ffffff"
1086   highlight = "#ffffff"
1087   timeout = 5
1088
1089   [urgency_normal]
1090   background = "#222222"
1091   foreground = "#ffffff"
1092   highlight = "#ffffff"
1093   timeout = 15
1094
1095   [urgency_critical]
1096   background = "#222222"
1097   foreground = "#a60000"
1098   highlight = "#ffffff"
1099   timeout = 0
1100 #+end_src
1101 ** Zathura
1102 The best document reader!
1103 *** Options
1104 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1105   map <C-i> recolor
1106   map <A-b> toggle_statusbar
1107   set selection-clipboard clipboard
1108   set scroll-step 200
1109
1110   set window-title-basename "true"
1111   set selection-clipboard "clipboard"
1112 #+end_src
1113 *** Colors
1114 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1115   set default-bg         "#000000"
1116   set default-fg         "#ffffff"
1117   set render-loading     true
1118   set render-loading-bg  "#000000"
1119   set render-loading-fg  "#ffffff"
1120
1121   set recolor-lightcolor "#000000" # bg
1122   set recolor-darkcolor  "#ffffff" # fg
1123   set recolor            "true"
1124 #+end_src
1125 ** Firefox
1126 Just some basic Firefox CSS. Will probably have to rewrite for the Proton redesign.
1127 *** Swap tab and URL bars
1128 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1129   #nav-bar {
1130       -moz-box-ordinal-group: 1 !important;
1131   }
1132
1133   #PersonalToolbar {
1134       -moz-box-ordinal-group: 2 !important;
1135   }
1136
1137   #titlebar {
1138       -moz-box-ordinal-group: 3 !important;
1139   }
1140 #+end_src
1141 *** Hide URL bar when not focused.
1142 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1143   #navigator-toolbox:not(:focus-within):not(:hover) {
1144       margin-top: -30px;
1145   }
1146
1147   #navigator-toolbox {
1148       transition: 0.1s margin-top ease-out;
1149   }
1150 #+end_src
1151 *** Black screen by default
1152 userChrome.css:
1153 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1154   #main-window,
1155   #browser,
1156   #browser vbox#appcontent tabbrowser,
1157   #content,
1158   #tabbrowser-tabpanels,
1159   #tabbrowser-tabbox,
1160   browser[type="content-primary"],
1161   browser[type="content"] > html,
1162   .browserContainer {
1163       background: black !important;
1164       color: #fff !important;
1165   }
1166 #+end_src
1167
1168 userContent.css:
1169 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css
1170   @-moz-document url("about:home"), url("about:blank"), url("about:newtab") {
1171       body {
1172           background: black !important;
1173       }
1174   }
1175 #+end_src
1176 ** Xresources
1177 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.
1178 #+begin_src conf :tangle ~/.Xresources
1179   ! special
1180   ,*.foreground:   #ffffff
1181   ,*.background:   #000000
1182   ,*.cursorColor:  #ffffff
1183
1184   ! black
1185   ,*.color0:       #000000
1186   ,*.color8:       #555555
1187
1188   ! red
1189   ,*.color1:       #ff8059
1190   ,*.color9:       #ffa0a0
1191
1192   ! green
1193   ,*.color2:       #00fc50
1194   ,*.color10:      #88cf88
1195
1196   ! yellow
1197   ,*.color3:       #eecc00
1198   ,*.color11:      #d2b580
1199
1200   ! blue
1201   ,*.color4:       #29aeff
1202   ,*.color12:      #92baff
1203
1204   ! magenta
1205   ,*.color5:       #feacd0
1206   ,*.color13:      #e0b2d6
1207
1208   ! cyan
1209   ,*.color6:       #00d3d0
1210   ,*.color14:      #a0bfdf
1211
1212   ! white
1213   ,*.color7:       #eeeeee
1214   ,*.color15:      #dddddd
1215 #+end_src
1216 ** Tmux
1217 I use tmux in order to keep my st build light. Still learning how it works.
1218 #+begin_src conf :tangle ~/.tmux.conf
1219   set -g status off
1220   set -g mouse on
1221   set-option -g history-limit 50000
1222   set-window-option -g mode-keys vi
1223   bind-key -T copy-mode-vi 'v' send -X begin-selection
1224   bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
1225 #+end_src
1226 ** GPG
1227 *** Config
1228 #+begin_src conf :tangle ~/.gnupg/gpg.conf
1229   default-key 3C9ED82FFE788E4A
1230   use-agent
1231 #+end_src
1232 *** Agent
1233 #+begin_src conf :tangle ~/.gnupg/gpg-agent.conf
1234   pinentry-program /sbin/pinentry-gnome3
1235   max-cache-ttl 600
1236   default-cache-ttl 600
1237   allow-emacs-pinentry
1238 #+end_src