]> git.armaanb.net Git - config.org.git/blob - config.org
ash: continue to make aliases more portable
[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
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 lanex='java -jar ~/.local/share/lxc/lanxchange.jar'
916   alias vim=$EDITOR
917   alias emacs=$EDITOR
918 #+end_src
919 **** System management
920 #+begin_src shell :tangle ~/.config/ash/ashrc
921   alias pkill='pkill -i'
922   alias crontab='crontab-argh'
923   alias sudo='doas'
924   alias pasu='git -C ~/.password-store push'
925   alias yadu='yadm add -u && yadm commit -m "Updated `date -Iseconds`" && \
926     yadm push'
927 #+end_src
928 **** Networking
929 #+begin_src shell :tangle ~/.config/ash/ashrc
930   alias ping='ping -c 10'
931   alias gps='gpg --keyserver keyserver.ubuntu.com --search-keys'
932   alias gpp='gpg --keyserver keyserver.ubuntu.com --recv-key'
933   alias plan='T=$(mktemp) && \
934         rsync root@armaanb.net:/etc/finger/plan.txt "$T" && \
935         TT=$(mktemp) && \
936         head -n -2 $T > $TT && \
937         vim $TT && \
938         echo "\nLast updated: $(date -R)" >> "$TT" && \
939         fold -sw 72 "$TT" > "$T"| \
940         rsync "$T" root@armaanb.net:/etc/finger/plan.txt'
941 #+end_src
942 **** Virtual machines, chroots
943 #+begin_src shell :tangle ~/.config/ash/ashrc
944   alias ckiss="doas chrooter ~/Virtual/kiss"
945   alias cdebian="doas chrooter ~/Virtual/debian bash"
946   alias cwindows='devour qemu-system-x86_64 \
947     -smp 3 \
948     -cpu host \
949     -enable-kvm \
950     -m 3G \
951     -device VGA,vgamem_mb=64 \
952     -device intel-hda \
953     -device hda-duplex \
954     -net nic \
955     -net user,smb=/home/armaa/Public \
956     -drive format=qcow2,file=/home/armaa/Virtual/windows.qcow2'
957 #+end_src
958 **** Python
959 #+begin_src shell :tangle ~/.config/ash/ashrc
960   alias pip="python -m pip"
961   alias black="black -l 79"
962 #+end_src
963 **** Latin
964 #+begin_src shell :tangle ~/.config/ash/ashrc
965   alias words='gen-shell -c "words"'
966   alias words-e='gen-shell -c "words ~E"'
967 #+end_src
968 **** Devour
969 #+begin_src shell :tangle ~/.config/ash/ashrc
970   alias zathura='devour zathura'
971   alias cad='devour openscad'
972   alias feh='devour feh'
973 #+end_src
974 **** Pacman
975 #+begin_src shell :tangle ~/.config/ash/ashrc
976   alias aps='yay -Ss'
977   alias api='yay -Syu'
978   alias apii='doas pacman -S'
979   alias app='yay -Rns'
980   alias azf='pacman -Q | fzf'
981   alias favorites='pacman -Qe | cut -d " " -f 1 > ~/Documents/favorites'
982 #+end_src
983 **** Other
984 #+begin_src shell :tangle ~/.config/ash/ashrc
985   alias bigrandomfile='dd if=/dev/urandom of=1GB-urandom bs=1M count=1024 \
986     iflag=fullblock status=progress'
987   alias bigboringfile='dd if=/dev/zero of=1GB-zero bs=1M count=1024 \
988     iflag=fullblock status=progress'
989   alias ytmusic="youtube-dl -x --add-metadata  --audio-format aac \
990     --restrict-filenames -o '%(title)s.%(ext)s'"
991   alias cal="cal -3 --color=auto"
992   alias bc='bc -l'
993 #+end_src
994 ** IPython
995 *** General
996 Symlink profile_default/ipython_config.py to profile_math/ipython_config.py
997 #+begin_src python :tangle ~/.ipython/profile_default/ipython_config.py
998   c.TerminalInteractiveShell.editing_mode = 'vi'
999   c.InteractiveShell.colors = 'linux'
1000   c.TerminalInteractiveShell.confirm_exit = False
1001 #+end_src
1002 *** Math
1003 #+begin_src python :tangle ~/.ipython/profile_math/startup.py
1004   from math import *
1005
1006   def deg(x):
1007       return x * (180 /  pi)
1008
1009   def rad(x):
1010       return x * (pi / 180)
1011
1012   def rad(x, unit):
1013       return (x * (pi / 180)) / unit
1014
1015   def csc(x):
1016       return 1 / sin(x)
1017
1018   def sec(x):
1019       return 1 / cos(x)
1020
1021   def cot(x):
1022       return 1 / tan(x)
1023 #+end_src
1024 ** MPV
1025 Make MPV play a little bit smoother.
1026 #+begin_src conf :tangle ~/.config/mpv/mpv.conf
1027   ytdl-format="bestvideo[height<=?1080]+bestaudio/best"
1028   hwdec=auto-copy
1029 #+end_src
1030 ** Inputrc
1031 For any GNU Readline programs
1032 #+begin_src conf :tangle ~/.inputrc
1033   set editing-mode emacs
1034 #+end_src
1035 ** Git
1036 *** User
1037 #+begin_src conf :tangle ~/.gitconfig
1038   [user]
1039   name = Armaan Bhojwani
1040   email = me@armaanb.net
1041   signingkey = 0FEB9471E19C49C60CFBEB133C9ED82FFE788E4A
1042 #+end_src
1043 *** Init
1044 #+begin_src conf :tangle ~/.gitconfig
1045   [init]
1046   defaultBranch = main
1047 #+end_src
1048 *** GPG
1049 #+begin_src conf :tangle ~/.gitconfig
1050   [gpg]
1051   program = gpg
1052 #+end_src
1053 *** Sendemail
1054 #+begin_src conf :tangle ~/.gitconfig
1055   [sendemail]
1056   smtpserver = smtp.mailbox.org
1057   smtpuser = me@armaanb.net
1058   smtpencryption = ssl
1059   smtpserverport = 465
1060   confirm = auto
1061 #+end_src
1062 *** Submodules
1063 #+begin_src conf :tangle ~/.gitconfig
1064   [submodule]
1065   recurse = true
1066 #+end_src
1067 *** Aliases
1068 #+begin_src conf :tangle ~/.gitconfig
1069   [alias]
1070   stat = diff --stat
1071   sclone = clone --depth 1
1072   sclean = clean -dfX
1073   a = add
1074   aa = add .
1075   c = commit
1076   quickfix = commit . --amend --no-edit
1077   p = push
1078   subup = submodule update --remote
1079   loc = diff --stat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 # Empty hash
1080   pushnc = push -o skip-ci
1081 #+end_src
1082 *** Commits
1083 #+begin_src conf :tangle ~/.gitconfig
1084   [commit]
1085   gpgsign = true
1086   verbose = true
1087 #+end_src
1088 ** Dunst
1089 Lightweight notification daemon.
1090 *** General
1091 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1092   [global]
1093   font = "JetBrains Mono Medium Nerd Font 11"
1094   allow_markup = yes
1095   format = "<b>%s</b>\n%b"
1096   sort = no
1097   indicate_hidden = yes
1098   alignment = center
1099   bounce_freq = 0
1100   show_age_threshold = 60
1101   word_wrap = yes
1102   ignore_newline = no
1103   geometry = "400x5-10+10"
1104   transparency = 0
1105   idle_threshold = 120
1106   monitor = 0
1107   sticky_history = yes
1108   line_height = 0
1109   separator_height = 1
1110   padding = 8
1111   horizontal_padding = 8
1112   max_icon_size = 32
1113   separator_color = "#ffffff"
1114   startup_notification = false
1115 #+end_src
1116 *** Modes
1117 #+begin_src conf :tangle ~/.config/dunst/dunstrc
1118   [frame]
1119   width = 1
1120   color = "#ffffff"
1121
1122   [shortcuts]
1123   close = mod4+c
1124   close_all = mod4+shift+c
1125   history = mod4+ctrl+c
1126
1127   [urgency_low]
1128   background = "#222222"
1129   foreground = "#ffffff"
1130   highlight = "#ffffff"
1131   timeout = 5
1132
1133   [urgency_normal]
1134   background = "#222222"
1135   foreground = "#ffffff"
1136   highlight = "#ffffff"
1137   timeout = 15
1138
1139   [urgency_critical]
1140   background = "#222222"
1141   foreground = "#a60000"
1142   highlight = "#ffffff"
1143   timeout = 0
1144 #+end_src
1145 ** Zathura
1146 *** Options
1147 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1148   map <C-i> recolor
1149   map <A-b> toggle_statusbar
1150   set selection-clipboard clipboard
1151   set scroll-step 200
1152
1153   set window-title-basename "true"
1154   set selection-clipboard "clipboard"
1155 #+end_src
1156 *** Colors
1157 #+begin_src conf :tangle ~/.config/zathura/zathurarc
1158   set default-bg         "#000000"
1159   set default-fg         "#ffffff"
1160   set render-loading     true
1161   set render-loading-bg  "#000000"
1162   set render-loading-fg  "#ffffff"
1163
1164   set recolor-lightcolor "#000000" # bg
1165   set recolor-darkcolor  "#ffffff" # fg
1166   set recolor            "true"
1167 #+end_src
1168 ** Firefox
1169 *** Swap tab and URL bars
1170 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1171   #nav-bar {
1172       -moz-box-ordinal-group: 1 !important;
1173   }
1174
1175   #PersonalToolbar {
1176       -moz-box-ordinal-group: 2 !important;
1177   }
1178
1179   #titlebar {
1180       -moz-box-ordinal-group: 3 !important;
1181   }
1182 #+end_src
1183 *** Hide URL bar when not focused.
1184 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1185   #navigator-toolbox:not(:focus-within):not(:hover) {
1186       margin-top: -30px;
1187   }
1188
1189   #navigator-toolbox {
1190       transition: 0.1s margin-top ease-out;
1191   }
1192 #+end_src
1193 *** Black screen by default
1194 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css
1195   #main-window,
1196   #browser,
1197   #browser vbox#appcontent tabbrowser,
1198   #content,
1199   #tabbrowser-tabpanels,
1200   #tabbrowser-tabbox,
1201   browser[type="content-primary"],
1202   browser[type="content"] > html,
1203   .browserContainer {
1204       background: black !important;
1205       color: #fff !important;
1206   }
1207 #+end_src
1208 #+begin_src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css
1209   @-moz-document url("about:home"), url("about:blank"), url("about:newtab") {
1210       body {
1211           background: black !important;
1212       }
1213   }
1214 #+end_src
1215 ** Xresources
1216 *** Color scheme
1217 Modus operandi.
1218 #+begin_src conf :tangle ~/.Xresources
1219   ! special
1220   ,*.foreground:   #ffffff
1221   ,*.background:   #000000
1222   ,*.cursorColor:  #ffffff
1223
1224   ! black
1225   ,*.color0:       #000000
1226   ,*.color8:       #555555
1227
1228   ! red
1229   ,*.color1:       #ff8059
1230   ,*.color9:       #ffa0a0
1231
1232   ! green
1233   ,*.color2:       #00fc50
1234   ,*.color10:      #88cf88
1235
1236   ! yellow
1237   ,*.color3:       #eecc00
1238   ,*.color11:      #d2b580
1239
1240   ! blue
1241   ,*.color4:       #29aeff
1242   ,*.color12:      #92baff
1243
1244   ! magenta
1245   ,*.color5:       #feacd0
1246   ,*.color13:      #e0b2d6
1247
1248   ! cyan
1249   ,*.color6:       #00d3d0
1250   ,*.color14:      #a0bfdf
1251
1252   ! white
1253   ,*.color7:       #eeeeee
1254   ,*.color15:      #dddddd
1255 #+end_src
1256 *** Copy paste
1257 #+begin_src conf :tangle ~/.Xresources
1258   xterm*VT100.Translations: #override \
1259   Shift <KeyPress> Insert: insert-selection(CLIPBOARD) \n\
1260   Ctrl Shift <Key>V:    insert-selection(CLIPBOARD) \n\
1261   Ctrl Shift <Key>C:    copy-selection(CLIPBOARD) \n\
1262   Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)
1263 #+end_src
1264 *** Blink cursor
1265 #+begin_src conf :tangle ~/.Xresources
1266   xterm*cursorBlink: true
1267 #+end_src
1268 *** Alt keys
1269 #+begin_src conf :tangle ~/.Xresources
1270   XTerm*eightBitInput:   false
1271   XTerm*eightBitOutput:  true
1272 #+end_src
1273 ** Tmux
1274 #+begin_src conf :tangle ~/.tmux.conf
1275   set -g status off
1276   set-window-option -g mode-keys vi
1277 #+end_src