Armaan Bhojwani


System Configuration

Welcome

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!

Compatability

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.

Choices

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.

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.

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.

TODOs

TODO Turn keybinding and hook declarations into use-package declarations where possible

TODO Put configs with passwords in here with some kind of authentication

  • Offlineimap

  • irc.el

License

Released under the 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.

Package management

Bootstrap straight.el

straight.el is really nice for managing package, and it integrates nicely with use-package. It uses the bootstrapping system defined here for installation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  (defvar bootstrap-version)
  (let ((bootstrap-file
         (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
        (bootstrap-version 5))
    (unless (file-exists-p bootstrap-file)
      (with-current-buffer
          (url-retrieve-synchronously
           "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
           'silent 'inhibit-cookies)
        (goto-char (point-max))
        (eval-print-last-sexp)))
    (load bootstrap-file nil 'nomessage))

Replace use-package with straight

1
2
  (straight-use-package 'use-package)
  (setq straight-use-package-by-default t)

Visual options

Theme

Very nice high contrast theme.

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.

1
2
3
4
5
6
7
8
  (setq modus-themes-slanted-constructs t
        modus-themes-bold-constructs t
        modus-themes-org-blocks 'grayscale
        modus-themes-mode-line '3d
        modus-themes-scale-headings t
        modus-themes-region 'no-extend
        modus-themes-diffs 'desaturated)
  (load-theme 'modus-vivendi t)

Tree-sitter

1
2
3
4
  (use-package tree-sitter-langs)
  (use-package tree-sitter
    :config (global-tree-sitter-mode)
    :hook (tree-sitter-after-on-hook . tree-sitter-hl-mode))

Typography

Font

Great programming font with ligatures.

1
  (add-to-list 'default-frame-alist '(font . "JetBrainsMonoNF-12"))

Ligatures

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  (use-package ligature
    :straight (ligature :type git :host github :repo "mickeynp/ligature.el")
    :config
    (ligature-set-ligatures
     '(prog-mode text-mode)
     '("-|" "-~" "---" "-<<" "-<" "--" "->" "->>" "-->" "/=" "/=="
       "/>" "//" "/*" "*>" "*/" "<-" "<<-" "<=>" "<=" "<|" "<||"
       "<|||" "<|>" "<:" "<>" "<-<" "<<<" "<==" "<<=" "<=<" "<==>"
       "<-|" "<<" "<~>" "<=|" "<~~" "<~" "<$>" "<$" "<+>" "<+" "</>"
       "</" "<*" "<*>" "<->" "<!--" ":>" ":<" ":::" "::" ":?" ":?>"
       ":=" "::=" "=>>" "==>" "=/=" "=!=" "=>" "===" "=:=" "==" "!=="
       "!!" "!=" ">]" ">:" ">>-" ">>=" ">=>" ">>>" ">-" ">=" "&&&"
       "&&" "|||>" "||>" "|>" "|]" "|}" "|=>" "|->" "|=" "||-" "|-"
       "||=" "||" ".." ".?" ".=" ".-" "..<" "..." "+++" "+>" "++"
       "[||]" "[<" "[|" "{|" "?." "?=" "?:" "##" "###" "####" "#["
       "#{" "#=" "#!" "#:" "#_(" "#_" "#?" "#(" ";;" "_|_" "__" "~~"
       "~~>" "~>" "~-" "~@" "$>" "^=" "]#"))
    (global-ligature-mode t))

Emoji

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  (use-package emojify
    :config (global-emojify-mode))

  ;; http://ergoemacs.org/emacs/emacs_list_and_set_font.html
  (set-fontset-font
   t
   '(#x1f300 . #x1fad0)
   (cond
    ((member "Twitter Color Emoji" (font-family-list)) "Twitter Color Emoji")
    ((member "Noto Color Emoji" (font-family-list)) "Noto Color Emoji")
    ((member "Noto Emoji" (font-family-list)) "Noto Emoji")))

Line numbers

Display relative line numbers except in some modes

1
2
3
4
5
6
7
8
  (global-display-line-numbers-mode)
  (setq display-line-numbers-type 'relative)
  (dolist (no-line-num '(term-mode-hook
                         pdf-view-mode-hook
                         shell-mode-hook
                         org-mode-hook
                         eshell-mode-hook))
    (add-hook no-line-num (lambda () (display-line-numbers-mode 0))))

Highlight matching parenthesis

1
2
3
  (use-package paren
    :config (show-paren-mode)
    :custom (show-paren-style 'parenthesis))

Modeline

Show current function

1
  (which-function-mode)

Make position in file more descriptive

Show current column and file size.

1
2
  (column-number-mode)
  (size-indication-mode)

Hide minor modes

1
2
  (use-package minions
    :config (minions-mode))

Word count

1
2
3
 (use-package wc-mode
   :straight (wc-mode :type git :host github :repo "bnbeckwith/wc-mode")
   :hook (text-mode-hook . wc-mode))

Ruler

Show a ruler at a certain number of chars depending on mode.

1
  (global-display-fill-column-indicator-mode)

Keybinding hints

Whenever starting a key chord, show possible future steps.

1
2
3
  (use-package which-key
    :config (which-key-mode)
    :custom (which-key-idle-delay 0.3))

Highlight TODOs in comments

1
2
3
  (use-package hl-todo
    :straight (hl-todo :type git :host github :repo "tarsius/hl-todo")
    :config (global-hl-todo-mode 1))

Don't lose cursor

1
  (blink-cursor-mode)

Visual line mode

Soft wrap words and do operations by visual lines.

1
  (add-hook 'text-mode-hook 'turn-on-visual-line-mode)

Display number of matches in search

1
2
  (use-package anzu
    :config (global-anzu-mode))

Visual bell

Inverts modeline instead of audible bell or the standard visual bell.

1
2
3
4
5
  (setq visible-bell nil
        ring-bell-function 'flash-mode-line)
  (defun flash-mode-line ()
    (invert-face 'mode-line)
    (run-with-timer 0.1 nil #'invert-face 'mode-line))

Evil mode

General

1
2
3
4
5
6
7
8
9
  (use-package evil
    :custom (select-enable-clipboard nil)
    :config
    (evil-mode)
    (fset 'evil-visual-update-x-selection 'ignore) ;; Keep clipboard and register seperate
    ;; Use visual line motions even outside of visual-line-mode buffers
    (evil-global-set-key 'motion "j" 'evil-next-visual-line)
    (evil-global-set-key 'motion "k" 'evil-previous-visual-line)
    (global-set-key (kbd "<escape>") 'keyboard-escape-quit))

Evil collection

1
2
3
4
  (use-package evil-collection
    :after evil
    :init (evil-collection-init)
    :custom (evil-collection-setup-minibuffer t))

Surround

tpope prevails!

1
2
  (use-package evil-surround
    :config (global-evil-surround-mode))

Leader key

1
2
3
4
5
  (use-package evil-leader
    :straight (evil-leader :type git :host github :repo "cofi/evil-leader")
    :config
    (evil-leader/set-leader "<SPC>")
    (global-evil-leader-mode))

Nerd commenter

1
2
3
4
5
  ;; Nerd commenter
  (use-package evil-nerd-commenter
    :bind (:map evil-normal-state-map
                ("gc" . evilnc-comment-or-uncomment-lines))
    :custom (evilnc-invert-comment-line-by-line nil))

Undo redo

Fix the oopsies!

1
  (evil-set-undo-system 'undo-redo)

Number incrementing

Add back C-a/C-x

1
2
3
4
5
  (use-package evil-numbers
    :straight (evil-numbers :type git :host github :repo "juliapath/evil-numbers")
    :bind (:map evil-normal-state-map
                ("C-M-a" . evil-numbers/inc-at-pt)
                ("C-M-x" . evil-numbers/dec-at-pt)))

Evil org

Init

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  (use-package evil-org
    :after org
    :hook (org-mode . evil-org-mode)
    :config
    (evil-org-set-key-theme '(textobjects insert navigation shift todo)))
  (use-package evil-org-agenda
    :straight (:type built-in)
    :after evil-org
    :config
    (evil-org-agenda-set-keys))

Leader maps

1
2
3
4
  (evil-leader/set-key-for-mode 'org-mode
    "T" 'org-show-todo-tree
    "a" 'org-agenda
    "c" 'org-archive-subtree)

Org mode

General

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  (use-package org
    :straight (:type built-in)
    :commands (org-capture org-agenda)
    :custom
    (org-ellipsis " ▾")
    (org-agenda-start-with-log-mode t)
    (org-agenda-files (quote ("~/Org/tasks.org" "~/Org/break.org")))
    (org-log-done 'time)
    (org-log-into-drawer t)
    (org-src-tab-acts-natively t)
    (org-src-fontify-natively t)
    (org-startup-indented t)
    (org-hide-emphasis-markers t)
    (org-fontify-whole-block-delimiter-line nil)
    :bind ("C-c a" . org-agenda))

Tempo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
  (use-package org-tempo
    :after org
    :straight (:type built-in)
    :config
    ;; TODO: There's gotta be a more efficient way to write this
    (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
    (add-to-list 'org-structure-template-alist '("sp" . "src conf :tangle ~/.spectrwm.conf"))
    (add-to-list 'org-structure-template-alist '("zsh" . "src shell :tangle ~/.config/zsh/zshrc"))
    (add-to-list 'org-structure-template-alist '("al" . "src yml :tangle ~/.config/alacritty/alacritty.yml"))
    (add-to-list 'org-structure-template-alist '("ipy" . "src python :tangle ~/.ipython/"))
    (add-to-list 'org-structure-template-alist '("pi" . "src conf :tangle ~/.config/picom/picom.conf"))
    (add-to-list 'org-structure-template-alist '("git" . "src conf :tangle ~/.gitconfig"))
    (add-to-list 'org-structure-template-alist '("du" . "src conf :tangle ~/.config/dunst/dunstrc"))
    (add-to-list 'org-structure-template-alist '("ro" . "src javascript :tangle ~/.config/rofi/config.rasi"))
    (add-to-list 'org-structure-template-alist '("za" . "src conf :tangle ~/.config/zathura/zathurarc"))
    (add-to-list 'org-structure-template-alist '("ff1" . "src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userChrome.css"))
    (add-to-list 'org-structure-template-alist '("ff2" . "src css :tangle ~/.mozilla/firefox/armaan-release/chrome/userContent.css"))
    (add-to-list 'org-structure-template-alist '("xr" . "src conf :tangle ~/.Xresources")))

Presentations

1
2
  (use-package org-present
    :straight (org-present :type git :host github :repo "rlister/org-present"))

Autocompletion

Ivy

Simple, but not too simple autocompletion.

1
2
3
4
5
6
7
  (use-package ivy
    :bind (("C-s" . swiper)
           :map ivy-minibuffer-map
           ("TAB" . ivy-alt-done)
           :map ivy-switch-buffer-map
           ("M-d" . ivy-switch-buffer-kill))
    :config (ivy-mode))

Ivy-rich

1
2
3
  (use-package ivy-rich
    :after (ivy counsel)
    :config (ivy-rich-mode))

Counsel

Ivy everywhere.

1
2
3
4
5
6
  (use-package counsel
    :bind (("C-M-j" . 'counsel-switch-buffer)
           :map minibuffer-local-map
           ("C-r" . 'counsel-minibuffer-history))
    :custom (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
    :config (counsel-mode))

Remember frequent commands

1
2
3
4
5
6
7
  (use-package ivy-prescient
    :after counsel
    :custom
    (ivy-prescient-enable-filtering nil)
    :config
    (prescient-persist-mode)
    (ivy-prescient-mode))

Swiper

Better search utility.

1
  (use-package swiper)

EmacsOS

RSS

Use elfeed for RSS. I have another file with all the feeds in it.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  (use-package elfeed
    :bind (("C-c e" . elfeed))
    :config
    (load "~/.emacs.d/feeds.el")
    (add-hook 'elfeed-new-entry-hook
              (elfeed-make-tagger :feed-url "youtube\\.com"
                                  :add '(youtube)))
    :bind (:map elfeed-search-mode-map ("C-c C-o" . 'elfeed-show-visit)))

  (use-package elfeed-goodies
    :after elfeed
    :config (elfeed-goodies/setup))

Email

Use mu4e for reading emails.

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.

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  (use-package smtpmail
    :straight (:type built-in))
  (use-package mu4e
    :load-path "/usr/share/emacs/site-lisp/mu4e"
    :straight (:build nil)
    :bind (("C-c m" . mu4e))
    :config
    (setq user-full-name "Armaan Bhojwani"
          smtpmail-local-domain "armaanb.net"
          smtpmail-stream-type 'ssl
          smtpmail-smtp-service '465
          mu4e-change-filenames-when-moving t
          mu4e-get-mail-command "offlineimap -q"
          message-citation-line-format "On %a %d %b %Y at %R, %f wrote:\n"
          message-citation-line-function 'message-insert-formatted-citation-line
          mu4e-completing-read-function 'ivy-completing-read
          mu4e-confirm-quit nil
          mail-user-agent 'mu4e-user-agent
          mu4e-contexts
          `( ,(make-mu4e-context
               :name "school"
               :enter-func (lambda () (mu4e-message "Entering school context"))
               :leave-func (lambda () (mu4e-message "Leaving school context"))
               :match-func (lambda (msg)
                             (when msg
                               (string-match-p "^/school" (mu4e-message-field msg :maildir))))
               :vars '((user-mail-address . "abhojwani22@nobles.edu")
                       (mu4e-sent-folder . "/school/Sent")
                       (mu4e-drafts-folder . "/school/Drafts")
                       (mu4e-trash-folder . "/school/Trash")
                       (mu4e-refile-folder . "/school/Archive")
                       (user-mail-address . "abhojwani22@nobles.edu")
                       (smtpmail-smtp-user . "abhojwani22@nobles.edu")
                       (smtpmail-smtp-server . "smtp.gmail.com")))
             ,(make-mu4e-context
               :name "personal"
               :enter-func (lambda () (mu4e-message "Entering personal context"))
               :leave-func (lambda () (mu4e-message "Leaving personal context"))
               :match-func (lambda (msg)
                             (when msg
                               (string-match-p "^/personal" (mu4e-message-field msg :maildir))))
               :vars '((mu4e-sent-folder . "/personal/Sent")
                       (mu4e-drafts-folder . "/personal/Drafts")
                       (mu4e-trash-folder . "/personal/Trash")
                       (mu4e-refile-folder . "/personal/Archive")
                       (user-mail-address . "me@armaanb.net")
                       (smtpmail-smtp-user . "me@armaanb.net")
                       (smtpmail-smtp-server "smtp.mailbox.org")
                       (mu4e-drafts-folder . "/school/Drafts")
                       (mu4e-trash-folder . "/school/Trash")))))
    (add-to-list 'mu4e-bookmarks
                 '(:name "Unified inbox"
                         :query "maildir:\"/personal/INBOX\" or maildir:\"/school/INBOX\""
                         :key ?b))
    :hook ((mu4e-compose-mode . flyspell-mode)
           (mu4e-view-mode-hook . turn-on-visual-line-mode)))

Default browser

Set EWW as default browser except for videos.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  (defun browse-url-mpv (url &optional new-window)
    "Open URL in MPV."
    (start-process "mpv" "*mpv*" "mpv" url))

  (setq browse-url-handlers
        (quote
         (("youtu\\.?be" . browse-url-mpv)
          ("peertube.*" . browse-url-mpv)
          ("vid.*" . browse-url-mpv)
          ("vid.*" . browse-url-mpv)
          ("." . eww-browse-url)
          )))

EWW

Some EWW enhancements.

Give buffer a useful name

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  ;; From https://protesilaos.com/dotemacs/
  (defun prot-eww--rename-buffer ()
    "Rename EWW buffer using page title or URL.
  To be used by `eww-after-render-hook'."
    (let ((name (if (eq "" (plist-get eww-data :title))
                    (plist-get eww-data :url)
                  (plist-get eww-data :title))))
      (rename-buffer (format "*%s # eww*" name) t)))

  (add-hook 'eww-after-render-hook #'prot-eww--rename-buffer)

Better entrypoint

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
  ;; From https://protesilaos.com/dotemacs/
  (defun prot-eww-browse-dwim (url &optional arg)
    "Visit a URL, maybe from `eww-prompt-history', with completion.

  With optional prefix ARG (\\[universal-argument]) open URL in a
  new eww buffer.

  If URL does not look like a valid link, run a web query using
  `eww-search-prefix'.

  When called from an eww buffer, provide the current link as
  initial input."
    (interactive
     (list
      (completing-read "Query:" eww-prompt-history
                       nil nil (plist-get eww-data :url) 'eww-prompt-history)
      current-prefix-arg))
    (eww url (if arg 4 nil)))

  (global-set-key (kbd "C-c w") 'prot-eww-browse-dwim)

IRC

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  (use-package erc
    :straight (:type built-in)
    :config
    (load "~/.emacs.d/irc.el")
    (acheam-irc)
    (erc-notifications-enable)
    (erc-smiley-disable))

  (use-package erc-hl-nicks
    :config (erc-hl-nicks-mode 1))

Emacs Anywhere

Use Emacs globally. Use the Emacs daemon and bind a key in your wm to emacsclient --eval "(emacs-everywhere)".

1
  (use-package emacs-everywhere)

Emacs IDE

Code cleanup

1
2
3
4
5
6
7
8
9
  (use-package blacken
    :hook (python-mode . blacken-mode)
    :config
    (setq blacken-line-length 79))

  ;; Purge whitespace
  (use-package ws-butler
    :config
    (ws-butler-global-mode))

Flycheck

1
2
3
  (use-package flycheck
    :config
    (global-flycheck-mode))

Project management

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  (use-package projectile
    :config (projectile-mode)
    :custom ((projectile-completion-system 'ivy))
    :bind-keymap
    ("C-c p" . projectile-command-map)
    :init
    (when (file-directory-p "~/Code")
      (setq projectile-project-search-path '("~/Code")))
    (setq projectile-switch-project-action #'projectile-dired))

  (use-package counsel-projectile
    :after projectile
    :config (counsel-projectile-mode))

Dired

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  (use-package dired
    :straight (:type built-in)
    :commands (dired dired-jump)
    :custom ((dired-listing-switches "-agho --group-directories-first"))
    :config
    (evil-collection-define-key 'normal 'dired-mode-map
      "h" 'dired-single-up-directory
      "l" 'dired-single-buffer))

  (use-package dired-single
    :commands (dired dired-jump))

  (use-package dired-open
    :commands (dired dired-jump)
    :custom
    (dired-open-extensions '(("png" . "feh")
                             ("mkv" . "mpv"))))

  (use-package dired-hide-dotfiles
    :hook (dired-mode . dired-hide-dotfiles-mode)
    :config
    (evil-collection-define-key 'normal 'dired-mode-map
      "H" 'dired-hide-dotfiles-mode))

Git

Magit

1
  (use-package magit)

Colored diff in line number area

1
2
3
4
5
  (use-package diff-hl
    :straight (diff-hl :type git :host github :repo "dgutov/diff-hl")
    :hook ((magit-pre-refresh-hook . diff-hl-magit-pre-refresh)
           (magit-post-refresh-hook . diff-hl-magit-post-refresh))
    :config (global-diff-hl-mode))

General text editing

Indentation

Indent after every change.

1
2
  (use-package aggressive-indent
    :config (global-aggressive-indent-mode))

Spell checking

Spell check in text mode, and in prog-mode comments.

1
2
3
4
5
  (dolist (hook '(text-mode-hook))
    (add-hook hook (lambda () (flyspell-mode))))
  (dolist (hook '(change-log-mode-hook log-edit-mode-hook))
    (add-hook hook (lambda () (flyspell-mode -1))))
  (add-hook 'prog-mode (lambda () (flyspell-prog mode)))

Expand tabs to spaces

1
  (setq-default tab-width 2)

Copy kill ring to clipboard

1
2
3
4
5
  (setq x-select-enable-clipboard t)
  (defun copy-kill-ring-to-xorg ()
    "Copy the current kill ring to the xorg clipboard."
    (interactive)
    (x-select-text (current-kill 0)))

Browse kill ring

1
  (use-package browse-kill-ring)

Save place

Opens file where you left it.

1
  (save-place-mode)

Writing mode

Distraction free writing a la junegunn/goyo.

1
2
3
  (use-package olivetti
    :config
    (evil-leader/set-key "o" 'olivetti-mode))

Abbreviations

Abbreviate things!

1
2
3
  (setq abbrev-file-name "~/.emacs.d/abbrevs")
  (setq save-abbrevs 'silent)
  (setq-default abbrev-mode t)

TRAMP

1
  (setq tramp-default-method "ssh")

Don't ask about following symlinks in vc

1
  (setq vc-follow-symlinks t)

Functions

Easily convert splits

Converts splits from horizontal to vertical and vice versa. Lifted from EmacsWiki.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  (defun toggle-window-split ()
    (interactive)
    (if (= (count-windows) 2)
        (let* ((this-win-buffer (window-buffer))
               (next-win-buffer (window-buffer (next-window)))
               (this-win-edges (window-edges (selected-window)))
               (next-win-edges (window-edges (next-window)))
               (this-win-2nd (not (and (<= (car this-win-edges)
                                           (car next-win-edges))
                                       (<= (cadr this-win-edges)
                                           (cadr next-win-edges)))))
               (splitter
                (if (= (car this-win-edges)
                       (car (window-edges (next-window))))
                    'split-window-horizontally
                  'split-window-vertically)))
          (delete-other-windows)
          (let ((first-win (selected-window)))
            (funcall splitter)
            (if this-win-2nd (other-window 1))
            (set-window-buffer (selected-window) this-win-buffer)
            (set-window-buffer (next-window) next-win-buffer)
            (select-window first-win)
            (if this-win-2nd (other-window 1))))))

  (define-key ctl-x-4-map "t" 'toggle-window-split)

Insert date

1
2
3
  (defun insert-date ()
    (interactive)
    (insert (format-time-string "%Y-%m-%d")))

Keybindings

Switch windows

1
2
  (use-package ace-window
    :bind ("M-o" . ace-window))

Kill current buffer

Makes "C-x k" binding faster.

1
  (substitute-key-definition 'kill-buffer 'kill-buffer-and-window global-map)

Other settings

OpenSCAD

Render OpenSCAD files, and add a preview window.

Personal fork just merges a PR.

1
2
3
  (use-package scad-mode)
  (use-package scad-preview
    :straight (scad-preview :type git :host github :repo "Armaanb/scad-preview"))

Control backup files

Stop backup files from spewing everywhere.

1
  (setq backup-directory-alist `(("." . "~/.emacs.d/backups")))

Make yes/no easier

1
  (defalias 'yes-or-no-p 'y-or-n-p)

Move customize file

No more clogging up init.el.

1
2
  (setq custom-file "~/.emacs.d/custom.el")
  (load custom-file)

Better help

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  (use-package helpful
    :commands (helpful-callable helpful-variable helpful-command helpful-key)
    :custom
    (counsel-describe-function-function #'helpful-callable)
    (counsel-describe-variable-function #'helpful-variable)
    :bind
    ([remap describe-function] . counsel-describe-function)
    ([remap describe-command] . helpful-command)
    ([remap describe-variable] . counsel-describe-variable)
    ([remap describe-key] . helpful-key))

GPG

1
2
3
4
5
6
7
8
9
  (use-package epa-file
    :straight (:type built-in)
    :custom
    (epa-file-select-keys nil)
    (epa-file-encrypt-to '("me@armaanb.net"))
    (password-cache-expiry (* 60 15)))

  (use-package pinentry
    :config (pinentry-start))

Pastebin

1
2
3
4
5
6
7
8
9
  (use-package 0x0
    :straight (0x0 :type git :repo "https://git.sr.ht/~zge/nullpointer-emacs")
    :custom (0x0-default-service 'envs)
    :config (evil-leader/set-key
              "00" '0x0-upload
              "0f" '0x0-upload-file
              "0s" '0x0-upload-string
              "0c" '0x0-upload-kill-ring
              "0p" '0x0-upload-popup))

Tangles

Spectrwm

General settings

  workspace_limit = 5
  warp_pointer = 1
  modkey = Mod4
  autorun = ws[1]:/home/armaa/Code/scripts/autostart

Bar

  bar_enabled = 0
  bar_font = xos4 Fira Code:pixelsize=14:antialias=true # any installed font

Keybindings

WM actions
  program[term] = alacritty
  program[screenshot_all] = flameshot gui
  program[menu] = rofi -show run # `rofi-dmenu` handles the rest
  program[switcher] = rofi -show window
  program[notif] = /home/armaa/Code/scripts/setter status

  bind[notif] = MOD+n
  bind[switcher] = MOD+Tab
Media keys
  program[paup] = /home/armaa/Code/scripts/setter audio +5
  program[padown] = /home/armaa/Code/scripts/setter audio -5
  program[pamute] = /home/armaa/Code/scripts/setter audio
  program[brigup] = /home/armaa/Code/scripts/setter brightness +10%
  program[brigdown] = /home/armaa/Code/scripts/setter brightness 10%-
  program[next] = playerctl next
  program[prev] = playerctl previous
  program[pause] = playerctl play-pause

  bind[padown] = XF86AudioLowerVolume
  bind[paup] = XF86AudioRaiseVolume
  bind[pamute] = XF86AudioMute
  bind[brigdown] = XF86MonBrightnessDown
  bind[brigup] = XF86MonBrightnessUp
  bind[pause] = XF86AudioPlay
  bind[next] = XF86AudioNext
  bind[prev] = XF86AudioPrev
HJKL
  program[h] = xdotool keyup h key --clearmodifiers Left
  program[j] = xdotool keyup j key --clearmodifiers Down
  program[k] = xdotool keyup k key --clearmodifiers Up
  program[l] = xdotool keyup l key --clearmodifiers Right

  bind[h] = MOD + Control + h
  bind[j] = MOD + Control + j
  bind[k] = MOD + Control + k
  bind[l] = MOD + Control + l
Programs
  program[aerc] = alacritty -e aerc
  program[catgirl] = alacritty --hold -e sh -c "while : ; do ssh root@armaanb.net -t abduco -A irc catgirl freenode; sleep 2; done"
  program[emacs] = emacsclient -c
  program[firefox] = firefox
  program[calc] = alacritty -e bc
  program[emacs-anywhere] = emacsclient --eval "(emacs-everywhere)"
  program[pass] = rofi-pass

  bind[aerc] = MOD+Control+1
  bind[catgirl] = MOD+Control+2
  bind[firefox] = MOD+Control+3
  bind[emacs-anywhere] = MOD+Control+4
  bind[calc] = MOD+Control+5
  bind[emacs] = MOD+Control+Return
  bind[pass] = MOD+Shift+P

Zsh

Settings

Completions
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  autoload -Uz compinit
  compinit

  setopt no_case_glob
  unsetopt glob_complete

  # Fragment completions
  zstyle ':completion:*' list-suffixes
zstyle ':completion:*' expand prefix suffix

  # Menu completions
  zstyle ':completion:*' menu select
  zmodload zsh/complist
  bindkey -M menuselect '^n' expand-or-complete
  bindkey -M menuselect '^p' reverse-menu-complete
Vim bindings
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  bindkey -v
  KEYTIMEOUT=1

  bindkey -M vicmd "^[[3~" delete-char
  bindkey "^[[3~" delete-char

  autoload edit-command-line
  zle -N edit-command-line
  bindkey -M vicmd ^e edit-command-line
  bindkey ^e edit-command-line
History
1
2
3
4
5
6
7
8
9
  setopt extended_history
  setopt share_history
  setopt inc_append_history
  setopt hist_ignore_dups
  setopt hist_reduce_blanks

  HISTSIZE=100000
  SAVEHIST=100000
  HISTFILE=~/.local/share/zsh/history

Plugins

I manage plugins using my own plugin manager, ZPE. https://git.sr.ht/~armaan/zpe

Right now, I'm only using fast-syntax-highlighting. It's a really nice visual addition.

ZPE
  https://github.com/zdharma/fast-syntax-highlighting
Zshrc
1
2
3
4
5
  source ~/Code/zpe/zpe.sh
  source ~/Code/admone/admone.zsh
  source ~/.config/zsh/fzf-bindings.zsh

  zpe-source fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

Functions

Time Zsh startup
1
2
3
  timer() {
      for i in $(seq 1 10); do time "$1" -i -c exit; done
  }
Update all packages
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
  color=$(tput setaf 5)
  reset=$(tput sgr0)

  apu() {
      sudo echo "${color}== upgrading with yay ==${reset}"
      yay
      echo ""
      echo "${color}== checking for pacnew files ==${reset}"
      sudo pacdiff
      echo
      echo "${color}== upgrading flatpaks ==${reset}"
      flatpak update
      echo ""
      echo "${color}== upgrading zsh plugins ==${reset}"
      zpe-pull
      echo ""
      echo "${color}== updating nvim plugins ==${reset}"
      nvim +PlugUpdate +PlugUpgrade +qall
      echo "Updated nvim plugins"
      echo ""
      echo "${color}You are entirely up to date!${reset}"
  }
Clean all packages
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
  apap() {
      sudo echo "${color}== cleaning pacman orphans ==${reset}"
      (pacman -Qtdq | sudo pacman -Rns - 2> /dev/null) || echo "No orphans"
      echo ""
      echo "${color}== cleaning flatpaks ==${reset}"
      flatpak remove --unused
      echo ""
      echo "${color}== cleaning zsh plugins ==${reset}"
      zpe-clean
      echo ""
      echo "${color}== cleaning nvim plugins ==${reset}"
      nvim +PlugClean +qall
      echo "Cleaned nvim plugins"
      echo ""
      echo "${color}All orphans cleaned!${reset}"
  }
Setup anaconda
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  zconda() {
      __conda_setup="$('/opt/anaconda/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
      if [ $? -eq 0 ]; then
          eval "$__conda_setup"
      else
          if [ -f "/opt/anaconda/etc/profile.d/conda.sh" ]; then
              . "/opt/anaconda/etc/profile.d/conda.sh"
          else
              export PATH="/opt/anaconda/bin:$PATH"
          fi
      fi
      unset __conda_setup
  }
Interact with 0x0
1
2
3
4
5
6
  zxz="https://envs.sh"
  0file() { curl -F"file=@$1" "$zxz" ; }
  0pb() { curl -F"file=@-;" "$zxz" ; }
  0url() { curl -F"url=$1" "$zxz" ; }
  0short() { curl -F"shorten=$1" "$zxz" ; }
  0clip() { xclip -out | curl -F"file=@-;" "$zxz" ; }
Finger
1
2
3
4
5
  finger() {
      user=$(echo "$1" | cut -f 1 -d '@')
      host=$(echo "$1" | cut -f 2 -d '@')
      echo $user | nc "$host" 79 -N
  }
Upload to ftp.armaanb.net
1
2
3
4
  pubup() {
      rsync "$1" "root@armaanb.net:/var/ftp/pub/${2}"
      echo "https://ftp.armaanb.net/pub/"$(basename "$1") | tee /dev/tty | xclip -sel c
  }

Aliases

SSH
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  alias bhoji-drop='ssh -p 23 root@armaanb.net'
  alias catgirl='ssh root@armaanb.net -t abduco -A irc catgirl freenode'
  alias union='ssh 192.168.1.18'
  alias mine='ssh -p 23 root@pickupserver.cc'
  alias tcf='ssh root@204.48.23.68'
  alias ngmun='ssh root@157.245.89.25'
  alias prox='ssh root@192.168.1.224'
  alias ncq='ssh root@143.198.123.17'
  alias dock='ssh root@192.168.1.225'
  alias jenkins='ssh root@192.168.1.226'
  alias envs='ssh acheam@envs.net'
File management
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  alias ls='exa -lh --icons --git --group-directories-first'
  alias la='exa -lha --icons --git --group-directories-first'
  alias df='df -h / /boot'
  alias du='du -h'
  alias free='free -h'
  alias cp='cp -riv'
  alias rm='rm -Iv'
  alias mv='mv -iv'
  alias ln='ln -iv'
  alias grep='grep -in --exclude-dir=.git --color=auto'
  alias fname='find -name'
  alias mkdir='mkdir -pv'
  alias unar='atool -x'
  alias wget='wget -e robots=off'
  alias lanex='~/.local/share/lxc/lxc'
Editing
1
2
3
  alias v='nvim'
  alias vim='nvim'
  alias vw="nvim ~/Documents/vimwiki/index.md"
System management
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  alias jctl='journalctl -p 3 -xb'
  alias pkill='pkill -i'
  alias cx='chmod +x'
  alias redoas='doas $(fc -ln -1)'
  alias crontab='crontab-argh'
  alias sudo='doas ' # allows aliases to be run with doas
  alias pasc='pass -c'
  alias pasu='\pass git push'
  alias yadu='yadm add -u && yadm commit -m "Updated `date -Iseconds`" && \
    yadm push'
Networking
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  alias ping='ping -c 10'
  alias speed='speedtest-cli'
  alias ip='ip --color=auto'
  alias cip='curl https://armaanb.net/ip'
  alias gps='gpg --keyserver keyserver.ubuntu.com --search-keys'
  alias gpp='gpg --keyserver keyserver.ubuntu.com --recv-key'
  alias plan='T=$(mktemp) && \
        rsync root@armaanb.net:/etc/finger/plan.txt "$T" && \
        TT=$(mktemp) && \
        head -n -2 $T > $TT && \
        vim $TT && \
        echo "\nLast updated: $(date -R)" >> "$TT" && \
        rsync "$TT" root@armaanb.net:/etc/finger/plan.txt'
  alias wttr='curl -s "wttr.in/02445?n" | head -n -3'
Other
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  alias bigrandomfile='dd if=/dev/urandom of=1GB-urandom bs=1M count=1024 \
    iflag=fullblock status=progress'
  alias bigboringfile='dd if=/dev/zero of=1GB-zero bs=1M count=1024 \
    iflag=fullblock status=progress'
  alias ts='gen-shell -c task'
  alias ts='gen-shell -c task'
  alias tetris='autoload -Uz tetriscurses && tetriscurses'
  alias news='newsboat'
  alias tilderadio="\mpv https://radio.tildeverse.org/radio/8000/radio.ogg"
  alias ytmusic="youtube-dl -x --add-metadata  --audio-format aac \
    --restrict-filenames -o '%(title)s.%(ext)s'"
  alias cal="cal -3 --color=auto"
  alias bc='bc -l'
Virtual machines, chroots
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  alias ckiss="sudo chrooter ~/Virtual/kiss"
  alias cdebian="sudo chrooter ~/Virtual/debian bash"
  alias cwindows='devour qemu-system-x86_64 \
    -smp 3 \
    -cpu host \
    -enable-kvm \
    -m 3G \
    -device VGA,vgamem_mb=64 \
    -device intel-hda \
    -device hda-duplex \
    -net nic \
    -net user,smb=/home/armaa/Public \
    -drive format=qcow2,file=/home/armaa/Virtual/windows.qcow2'
Python
1
2
3
4
5
6
  alias ipy="ipython"
  alias zpy="zconda && ipython"
  alias math="ipython --profile=math"
  alias pypi="python setup.py sdist && twine upload dist/*"
  alias pip="python -m pip"
  alias black="black -l 79"
Latin
1
2
  alias words='gen-shell -c "words"'
  alias words-e='gen-shell -c "words ~E"'
Devour
1
2
3
4
5
  alias zathura='devour zathura'
  alias mpv='devour mpv'
  alias sql='devour sqlitebrowser'
  alias cad='devour openscad'
  alias feh='devour feh'
Package management (Pacman)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  alias aps='yay -Ss'
  alias api='yay -Syu'
  alias apii='sudo pacman -S'
  alias app='yay -Rns'
  alias apc='yay -Sc'
  alias apo='yay -Qttd'
  alias azf='pacman -Q | fzf'
  alias favorites='pacman -Qe | cut -d " " -f 1 > ~/Documents/favorites'
  alias ufetch='ufetch-arch'
  alias reflect='reflector --verbose --sort rate --save \
     ~/.local/etc/pacman.d/mirrorlist --download-timeout 60' # Takes ~45m to run
Package management (KISS)
1
2
  alias kzf="kiss s \* | xargs -l basename | \
    fzf --preview 'kiss search {} | xargs -l dirname'"

Exports

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  export EDITOR="emacsclient -c"
  export VISUAL="$EDITOR"
  export TERM=xterm-256color # for compatability

  export GPG_TTY="$(tty)"
  export MANPAGER='nvim +Man!'
  export PAGER='less'

  export GTK_USE_PORTAL=1

  export PATH="/home/armaa/.local/bin:$PATH" # prioritize .local/bin
  export PATH="/home/armaa/Code/scripts:$PATH" # prioritize my scripts
  export PATH="/home/armaa/Code/scripts/bin:$PATH" # prioritize my bins
  export PATH="$PATH:/home/armaa/.cargo/bin"
  export PATH="$PATH:/home/armaa/.local/share/gem/ruby/2.7.0/bin"
  export PATH="$PATH:/usr/sbin"
  export PATH="$PATH:/opt/FreeTube/freetube"

  export LC_ALL="en_US.UTF-8"
  export LC_CTYPE="en_US.UTF-8"
  export LANGUAGE="en_US.UTF-8"

  export KISS_PATH="/home/armaa/Virtual/kiss/home/armaa/kiss-repo"
  export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/core"
  export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/extra"
  export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/xorg"
  export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-main/testing"
  export KISS_PATH="$KISS_PATH:/home/armaa/Clone/repo-community/community"

Alacritty

Appearance

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
font:
  normal:
    family: JetBrains Mono Nerd Font
    style: Medium
  italic:
    style: Italic
  Bold:
    style: Bold
  size: 7
  ligatures: true # Requires ligature patch

window:
  padding:
    x: 5
    y: 5

background_opacity: 1

Color scheme

Modus vivendi. Source: https://github.com/ishan9299/Nixos/blob/d4bbb7536be95b59466bb9cca4d671be46e04e81/user/alacritty/alacritty.yml#L30-L118

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
colors:
  # Default colors
  primary:
    background: '#000000'
    foreground: '#ffffff'

  cursor:
    text: '#000000'
    background: '#ffffff'

  # Normal colors (except green it is from intense colors)
  normal:
    black:   '#000000'
    red:     '#ff8059'
    green:   '#00fc50'
    yellow:  '#eecc00'
    blue:    '#29aeff'
    magenta: '#feacd0'
    cyan:    '#00d3d0'
    white:   '#eeeeee'

  # Bright colors [all the faint colors in the modus theme]
  bright:
    black:   '#555555'
    red:     '#ffa0a0'
    green:   '#88cf88'
    yellow:  '#d2b580'
    blue:    '#92baff'
    magenta: '#e0b2d6'
    cyan:    '#a0bfdf'
    white:   '#ffffff'

  # dim [all the intense colors in modus theme]
  dim:
    black:   '#222222'
    red:     '#fb6859'
    green:   '#00fc50'
    yellow:  '#ffdd00'
    blue:    '#00a2ff'
    magenta: '#ff8bd4'
    cyan:    '#30ffc0'
    white:   '#dddddd'

IPython

General

Symlink profile_default/ipython_config.py to profile_math/ipython_config.py

1
2
3
  c.TerminalInteractiveShell.editing_mode = 'vi'
  c.InteractiveShell.colors = 'linux'
  c.TerminalInteractiveShell.confirm_exit = False

Math

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  from math import *

  def deg(x):
      return x * (180 /  pi)

  def rad(x):
      return x * (pi / 180)

  def rad(x, unit):
      return (x * (pi / 180)) / unit

  def csc(x):
      return 1 / sin(x)

  def sec(x):
      return 1 / cos(x)

  def cot(x):
      return 1 / tan(x)

MPV

Make MPV play a little bit smoother.

  ytdl-format="bestvideo[height<=?1080]+bestaudio/best"
  hwdec=auto-copy

Inputrc

For any GNU Readline programs

  set editing-mode vi

Git

User

[user]
  name = Armaan Bhojwani
  email = me@armaanb.net
  signingkey = 0FEB9471E19C49C60CFBEB133C9ED82FFE788E4A

Init

[init]
  defaultBranch = main

GPG

[gpg]
  program = gpg

Sendemail

[sendemail]
  smtpserver = smtp.mailbox.org
  smtpuser = me@armaanb.net
  smtpencryption = ssl
  smtpserverport = 465
  confirm = auto

Submodules

[submodule]
  recurse = true

Aliases

[alias]
  stat = diff --stat
  sclone = clone --depth 1
  sclean = clean -dfX
  a = add
  aa = add .
  c = commit
  p = push
  subup = submodule update --remote
  loc = diff --stat 4b825dc642cb6eb9a060e54bf8d69288fbee4904 # Empty hash
  mirror = git config --global alias.mirrormirror

Commits

[commit]
  gpgsign = true
  verbose = true

Dunst

Lightweight notification daemon.

General

  [global]
  font = "JetBrains Mono Medium Nerd Font 11"
  allow_markup = yes
  format = "<b>%s</b>\n%b"
  sort = no
  indicate_hidden = yes
  alignment = center
  bounce_freq = 0
  show_age_threshold = 60
  word_wrap = yes
  ignore_newline = no
  geometry = "400x5-10+10"
  transparency = 0
  idle_threshold = 120
  monitor = 0
  sticky_history = yes
  line_height = 0
  separator_height = 1
  padding = 8
  horizontal_padding = 8
  max_icon_size = 32
  separator_color = "#ffffff"
  startup_notification = false

Modes

  [frame]
  width = 1
  color = "#ffffff"

  [shortcuts]
  close = mod4+c
  close_all = mod4+shift+c
  history = mod4+ctrl+c

  [urgency_low]
  background = "#222222"
  foreground = "#ffffff"
  highlight = "#ffffff"
  timeout = 5

  [urgency_normal]
  background = "#222222"
  foreground = "#ffffff"
  highlight = "#ffffff"
  timeout = 15

  [urgency_critical]
  background = "#222222"
  foreground = "#a60000"
  highlight = "#ffffff"
  timeout = 0

Rofi

Modus vivendi theme that extends DarkBlue.

1
2
3
4
5
6
7
8
  @import "/usr/share/rofi/themes/DarkBlue.rasi"
      ,* {
          white:                        rgba ( 255, 255, 255, 100 % );
          foreground:                   @white;
          selected-normal-background:   @white;
          separatorcolor:               @white;
          background:                   rgba ( 34, 34, 34, 100 % );
      }

Zathura

Options

  map <C-i> recolor
  map <A-b> toggle_statusbar
  set selection-clipboard clipboard
  set scroll-step 200

  set window-title-basename "true"
  set selection-clipboard "clipboard"

Colors

  set default-bg         "#000000"
  set default-fg         "#ffffff"
  set render-loading     true
  set render-loading-bg  "#000000"
  set render-loading-fg  "#ffffff"

  set recolor-lightcolor "#000000" # bg
  set recolor-darkcolor  "#ffffff" # fg
  set recolor            "true"

Firefox

Swap tab and URL bars

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  #nav-bar {
      -moz-box-ordinal-group: 1 !important;
  }

  #PersonalToolbar {
      -moz-box-ordinal-group: 2 !important;
  }

  #titlebar {
      -moz-box-ordinal-group: 3 !important;
  }

Hide URL bar when not focused.

1
2
3
4
5
6
7
  #navigator-toolbox:not(:focus-within):not(:hover) {
      margin-top: -30px;
  }

  #navigator-toolbox {
      transition: 0.1s margin-top ease-out;
  }

Black screen by default

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  #main-window,
  #browser,
  #browser vbox#appcontent tabbrowser,
  #content,
  #tabbrowser-tabpanels,
  #tabbrowser-tabbox,
  browser[type="content-primary"],
  browser[type="content"] > html,
  .browserContainer {
      background: black !important;
      color: #fff !important;
  }
1
2
3
4
5
  @-moz-document url("about:home"), url("about:blank"), url("about:newtab") {
      body {
          background: black !important;
      }
  }

Xresources

Font

  xterm*font: JetBrains Mono NF:pixelsize=15

  XTerm.vt100.translations: #override \n\
    Ctrl <Key> minus: smaller-vt-font() \n\
    Ctrl <Key> plus: larger-vt-font()

Color scheme

Modus operandi.

  ! special
  ,*.foreground:   #ffffff
  ,*.background:   #000000
  ,*.cursorColor:  #ffffff

  ! black
  ,*.color0:       #000000
  ,*.color8:       #555555

  ! red
  ,*.color1:       #ff8059
  ,*.color9:       #ffa0a0

  ! green
  ,*.color2:       #00fc50
  ,*.color10:      #88cf88

  ! yellow
  ,*.color3:       #eecc00
  ,*.color11:      #d2b580

  ! blue
  ,*.color4:       #29aeff
  ,*.color12:      #92baff

  ! magenta
  ,*.color5:       #feacd0
  ,*.color13:      #e0b2d6

  ! cyan
  ,*.color6:       #00d3d0
  ,*.color14:      #a0bfdf

  ! white
  ,*.color7:       #eeeeee
  ,*.color15:      #dddddd

Copy paste

  xterm*VT100.Translations: #override \
    Shift <KeyPress> Insert: insert-selection(CLIPBOARD) \n\
    Ctrl Shift <Key>V:    insert-selection(CLIPBOARD) \n\
    Ctrl Shift <Key>C:    copy-selection(CLIPBOARD) \n\
    Ctrl <Btn1Up>: exec-formatted("xdg-open '%t'", PRIMARY)

Blink cursor

  xterm*cursorBlink: true

Alt keys

  XTerm*eightBitInput:   false
  XTerm*eightBitOutput:  true