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