feat: update configs

This commit is contained in:
Pavel Korytov 2021-09-22 11:56:27 +03:00
parent 02d18de864
commit e7fb0b8cd9
13 changed files with 677 additions and 138 deletions

View file

@ -17,7 +17,6 @@ draft = false
# export BROWSER=/usr/bin/firefox
export QT_QPA_PLATFORMTHEME="qt5ct"
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export TZ="Asia/Yekaterinburg"
# export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
```

View file

@ -937,7 +937,7 @@ fi
```
### `autocommmit` {#autocommmit}
### `autocommit` {#autocommit}
A script to autocommit files in a repository. I use it to sync my org directory and password store. I guess it's not how git is intended to be used, but it works for me.

View file

@ -68,6 +68,7 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
- [Scripts](#scripts)
- [Buku bookmarks](#buku-bookmarks)
- [Man pages](#man-pages)
- [pass](#pass)
- [Flameshot](#flameshot)
- [dunst](#dunst)
- [keynav](#keynav)
@ -576,7 +577,7 @@ bindsym $mod+Shift+g mode "outer gaps"
A more or less standard set of keybindings to move & resize floating windows.
Just be careful to always make a way to return from these new modes, otherwise, you'd end up in a rather precarious position.
Just be careful to always make a way to return from these new modes, otherwise you'd end up in a rather precarious situation.
```vim
# resize window (you can also use the mouse for that)
@ -665,6 +666,7 @@ Keybindings to launch [rofi](https://github.com/davatorium/rofi). For more detai
```vim
bindsym $mod+d exec "rofi -modi 'drun,run' -show drun"
bindsym $mod+b exec --no-startup-id rofi-buku-mine
bindsym $mod+minus exec rofi-pass; mode default
bindsym $mod+apostrophe mode "rofi"
@ -672,7 +674,7 @@ mode "rofi" {
bindsym d exec "rofi -modi 'drun,run' -show drun"
bindsym m exec rofi-man; mode default
bindsym b exec rofi-buku-mine; mode default
bindsym k exec rofi-keepassxc -d ~/MEGAsync/Passwords.kdbx; mode default
bindsym k exec rofi-pass; mode default
bindsym Escape mode "default"
}
```
@ -936,7 +938,7 @@ declare -A BLOCKS=(
)
# Geolocation for some modules
export LOC="TMN"
export LOC="SPB"
export IPSTACK_API_KEY=$(pass show My_Online/APIs/ipstack | head -n 1)
@ -1713,6 +1715,23 @@ fi
```
#### pass {#pass}
| Guix dependency |
|-----------------|
| rofi-pass |
| xset |
A nice [pass frontend for Rofi](https://github.com/carnager/rofi-pass), which is even packaged for Guix.
```bash
USERNAME_field='username'
EDITOR=vim
default_autotype='username :tab pass'
clip=both
```
## Flameshot {#flameshot}
| Guix dependency |
@ -1813,7 +1832,7 @@ References:
# Show how many messages are currently hidden (because of geometry).
indicate_hidden = yes
# Shrink window if it's smaller than the width. Will be ignored if
# Shrink window if its smaller than the width. Will be ignored if
# width is 0.
shrink = no
@ -2347,6 +2366,10 @@ This section generates manifests for various desktop software that I'm using.
| dev | openjdk |
| dev | go |
| dev | gcc-toolchain |
| dev | lua |
| dev | libfaketime |
| dev | hugo-extended |
| dev | make |
### Manifests {#manifests}
@ -2731,6 +2754,8 @@ Other desktop programs I use are listed below.
| fontconfig | |
| polkit-gnome | Polkit authentication agent |
| anydesk | Remote desktop software |
| gnome-disk-utility | Manage disks |
| gparted | Manage partitions |
<a id="code-snippet--packages"></a>
```emacs-lisp

View file

@ -19,15 +19,16 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Measure startup speed](#measure-startup-speed)
- [straight.el](#straight-dot-el)
- [use-package](#use-package)
- [config variants & environment](#config-variants-and-environment)
- [Performance](#performance)
- [Garbage collection](#garbage-collection)
- [Run garbage collection when Emacs is unfocused](#run-garbage-collection-when-emacs-is-unfocused)
- [Misc](#misc)
- [Native compilation](#native-compilation)
- [Anaconda & environment](#anaconda-and-environment)
- [Anaconda](#anaconda)
- [Custom file location](#custom-file-location)
- [Private config](#private-config)
- [No littering](#no-littering)
- [Prevent Emacs from closing](#prevent-emacs-from-closing)
- [Global editing configuration](#global-editing-configuration)
- [General keybindings stuff](#general-keybindings-stuff)
- [general.el](#general-dot-el)
@ -150,7 +151,9 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Keybindings & stuff](#keybindings-and-stuff)
- [Copy a link](#copy-a-link)
- [Presentations](#presentations)
- [TOC](#toc)
- [Tools](#tools)
- [TOC](#toc)
- [Screenshots](#screenshots)
- [System configuration](#system-configuration)
- [Tables for Guix Dependencies](#tables-for-guix-dependencies)
- [Noweb evaluations](#noweb-evaluations)
@ -171,7 +174,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [<span class="org-todo done OFF">OFF</span> (OFF) Code Compass](#off--code-compass)
- [Dependencies](#dependencies)
- [Plugin](#plugin)
- [<span class="org-todo todo CHECK">CHECK</span> (OFF) Format-all](#off--format-all)
- [Reformatter](#reformatter)
- [General additional config](#general-additional-config)
- [Web development](#web-development)
- [Emmet](#emmet)
@ -225,7 +228,9 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [fish](#fish)
- [sh](#sh)
- [Haskell](#haskell)
- [Lua](#lua)
- [JSON](#json)
- [SQL](#sql)
- [YAML](#yaml)
- [.env](#dot-env)
- [CSV](#csv)
@ -342,6 +347,56 @@ References:
```
### config variants & environment {#config-variants-and-environment}
The following variable is true when my machine is not powerful enough for some resource-heavy packages.
```emacs-lisp
(setq my/lowpower (string= (system-name) "azure"))
```
The following is true if Emacs is meant to be used with TRAMP over slow ssh.
```emacs-lisp
(setq my/slow-ssh
(or
(string= (getenv "IS_TRAMP") "true")
(string= (system-name) "dev-digital")))
```
The following is true is Emacs is ran on a remote server where I don't need stuff like my org workflow
```emacs-lisp
(setq my/remote-server
(or (string= (getenv "IS_REMOTE") "true")
(string= (system-name) "dev-digital")))
```
And the following is true if Emacs is run from termux on Android.
```emacs-lisp
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
```
Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:
```emacs-lisp
(setenv "IS_EMACS" "true")
```
Finally, I want to have a minimal Emacs config for debugging purposes. This has just straight.el, use-packages and evil.
```emacs-lisp
<<minimal>>
```
To launch Emacs with this config, run
```bash
emacs -q -l ~/.emacs.d/init-minimal.el
```
### Performance {#performance}
@ -373,27 +428,6 @@ Some time has passed, and I still don't know if there is any quantifiable advant
```
#### Misc {#misc}
The following variable is true when my machine is not powerful enough for some resource-heavy packages.
```emacs-lisp
(setq my/lowpower (string= (system-name) "azure"))
```
The following is true if Emacs is meant to be used with TRAMP over slow ssh.
```emacs-lisp
(setq my/slow-ssh (string= (getenv "IS_TRAMP") "true"))
```
And the following is true if Emacs is run from termux on Android.
```emacs-lisp
(setq my/is-termux (string-match-p (rx (* nonl) "com.termux" (* nonl)) (getenv "HOME")))
```
#### Native compilation {#native-compilation}
Set number of jobs to 1 on low-power machines
@ -404,7 +438,7 @@ Set number of jobs to 1 on low-power machines
```
### Anaconda & environment {#anaconda-and-environment}
### Anaconda {#anaconda}
[Anaconda](https://www.anaconda.com/) is a free package and environment manager. I currently use it to manage multiple versions of Python and Node.js
@ -434,12 +468,6 @@ References:
(conda-env-activate "general")))
```
Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:
```emacs-lisp
(setenv "IS_EMACS" "true")
```
### Custom file location {#custom-file-location}
@ -472,6 +500,15 @@ By default emacs and its packages create a lot files in `.emacs.d` and in other
```
### Prevent Emacs from closing {#prevent-emacs-from-closing}
This adds a confirmation to avoid accidental Emacs closing.
```emacs-lisp
(setq confirm-kill-emacs 'y-or-n-p)
```
## Global editing configuration {#global-editing-configuration}
@ -1437,7 +1474,7 @@ A company frontend with nice icons.
```emacs-lisp
(use-package company-box
:straight t
:if (not my/lowpower)
:if (and (display-graphic-p) (not my/lowpower))
:after (company)
:hook (company-mode . company-box-mode))
```
@ -1556,7 +1593,7 @@ Before I figure out how to package this for Guix:
```emacs-lisp
(use-package wakatime-mode
:straight (:host github :repo "SqrtMinusOne/wakatime-mode")
:if (not my/is-termux)
:if (not (or my/is-termux my/remote-server))
:config
(setq wakatime-ignore-exit-codes '(0 1 102))
(advice-add 'wakatime-init :after (lambda () (setq wakatime-cli-path "/home/pavel/bin/wakatime-cli")))
@ -1573,7 +1610,7 @@ Before I figure out how to package this for Guix:
(use-package activity-watch-mode
:straight t
:if (not my/is-termux)
:if (not (or my/is-termux my/remote-server))
:config
(global-activity-watch-mode))
```
@ -1692,7 +1729,9 @@ My colorscheme of choice.
:config
(setq doom-themes-enable-bold t
doom-themes-enable-italic t)
(load-theme 'doom-palenight t)
(if my/remote-server
(load-theme 'doom-gruvbox t)
(load-theme 'doom-palenight t))
(doom-themes-visual-bell-config)
(setq doom-themes-treemacs-theme "doom-colors")
(doom-themes-treemacs-config))
@ -1952,7 +1991,7 @@ References:
```emacs-lisp
(use-package emojify
:straight t
:if (not (or my/lowpower my/is-termux))
:if (and (display-graphic-p) (not (or my/lowpower my/is-termux)))
:hook (after-init . global-emojify-mode))
```
@ -1964,7 +2003,7 @@ Ligature setup for the JetBrainsMono font.
```emacs-lisp
(use-package ligature
:straight (:host github :repo "mickeynp/ligature.el")
:if (not my/is-termux)
:if (display-graphic-p)
:config
(ligature-set-ligatures
'(
@ -1980,7 +2019,8 @@ Ligature setup for the JetBrainsMono font.
clojure-mode
go-mode
sh-mode
haskell-mode)
haskell-mode
web-mode)
'("--" "---" "==" "===" "!=" "!==" "=!=" "=:=" "=/=" "<="
">=" "&&" "&&&" "&=" "++" "+++" "***" ";;" "!!" "??"
"?:" "?." "?=" "<:" ":<" ":>" ">:" "<>" "<<<" ">>>"
@ -2003,6 +2043,7 @@ Ligature setup for the JetBrainsMono font.
```emacs-lisp
(use-package all-the-icons
:if (display-graphic-p)
:straight t)
```
@ -2023,7 +2064,7 @@ Highlight indent guides.
```emacs-lisp
(use-package highlight-indent-guides
:straight t
:if (not my/lowpower)
:if (not (or my/lowpower my/remote-server))
:hook (
(prog-mode . highlight-indent-guides-mode)
(vue-mode . highlight-indent-guides-mode)
@ -2136,7 +2177,7 @@ Display icons for files.
```emacs-lisp
(use-package all-the-icons-dired
:straight t
:if (not (or my/lowpower my/slow-ssh))
:if (not (or my/lowpower my/slow-ssh (not (display-graphic-p))))
:hook (dired-mode . (lambda ()
(unless (string-match-p "/gnu/store" default-directory)
(all-the-icons-dired-mode))))
@ -2249,6 +2290,13 @@ Some other optimization settings:
tramp-file-name-regexp))
```
Set the default shell to `bin/bash` for TRAMP or on a remote server.
```emacs-lisp
(when (or my/remote-server my/slow-ssh)
(setq explicit-shell-file-name "/bin/bash"))
```
Also, here is a hack to make TRAMP find `ls` on Guix:
```emacs-lisp
@ -2390,6 +2438,7 @@ Open a terminal in the lower third of the frame with the `` ` `` key.
(kill-buffer (current-buffer))
(select-window vterm-window))
(vterm-other-window "vterm-subterminal"))))
(unless my/slow-ssh
(general-nmap "`" 'my/toggle-vterm-subteminal)
(general-nmap "~" 'vterm))
@ -2509,6 +2558,7 @@ Use the built-in org mode.
```emacs-lisp
(use-package org
:straight t
:if (not my/remote-server)
:defer t
:config
(setq org-startup-indented t)
@ -2884,7 +2934,7 @@ Used files
```emacs-lisp
(setq org-directory (expand-file-name "~/Documents/org-mode"))
(setq org-agenda-files '("inbox.org" "projects.org" "work.org"))
(setq org-agenda-files '("inbox.org" "projects.org" "work.org" "sem-11.org" "life.org"))
;; (setq org-default-notes-file (concat org-directory "/notes.org"))
```
@ -2903,7 +2953,9 @@ Refile targets
```emacs-lisp
(setq org-refile-targets
'(("projects.org" :maxlevel . 2)
("work.org" :maxlevel . 2)))
("work.org" :maxlevel . 2)
("sem-11.org" :maxlevel . 3)
("life.org" :maxlevel . 2)))
(setq org-refile-use-outline-path 'file)
(setq org-outline-path-complete-in-steps nil)
```
@ -3235,6 +3287,7 @@ A template looks like this:
```emacs-lisp
(use-package org-journal
:straight t
:if (not my/remote-server)
:after org
:config
(setq org-journal-dir (concat org-directory "/journal"))
@ -3305,7 +3358,8 @@ References:
(use-package org-roam
:straight (:host github :repo "org-roam/org-roam"
:files (:defaults "extensions/*.el"))
:files (:defaults "extensions/*.el"))
:if (not my/remote-server)
:after org
:init
(setq org-roam-directory (concat org-directory "/roam"))
@ -3392,6 +3446,7 @@ As of now, this package loads Helm on start. To avoid this, I have to exclude He
```emacs-lisp
(use-package org-ref
:straight (:files (:defaults (:exclude "*helm*")))
:if (not my/remote-server)
:init
(setq org-ref-completion-library 'org-ref-ivy-cite)
(setq bibtex-dialect 'biblatex)
@ -3698,6 +3753,7 @@ Doing presentations with [org-present](https://github.com/rlister/org-present).
(use-package org-present
:straight (:host github :repo "rlister/org-present")
:if (not my/remote-server)
:commands (org-present)
:config
(general-define-key
@ -3716,8 +3772,7 @@ Doing presentations with [org-present](https://github.com/rlister/org-present).
(setq-local org-format-latex-options
(plist-put org-format-latex-options
:scale (* org-present-text-scale my/org-latex-scale 0.5)))
(org-latex-preview '(16))
(tab-bar-mode 0)))
(org-latex-preview '(16))))
(add-hook 'org-present-mode-quit-hook
(lambda ()
(blink-cursor-mode 1)
@ -3728,12 +3783,16 @@ Doing presentations with [org-present](https://github.com/rlister/org-present).
(display-line-numbers-mode 1)
(hide-mode-line-mode 0)
(setq-local org-format-latex-options (plist-put org-format-latex-options :scale my/org-latex-scale))
(org-latex-preview '(64))
(tab-bar-mode 1))))
(org-latex-preview '(64)))))
```
### TOC {#toc}
### Tools {#tools}
Various small packages.
#### TOC {#toc}
Make a TOC inside the org file.
@ -3746,6 +3805,7 @@ References:
```emacs-lisp
(use-package org-make-toc
:after (org)
:if (not my/remote-server)
:commands
(org-make-toc
org-make-toc-insert
@ -3755,6 +3815,17 @@ References:
```
#### Screenshots {#screenshots}
A nice package to make screenshots and insert them to the Org document.
```emacs-lisp
(use-package org-attach-screenshot
:commands (org-attach-screenshot)
:straight t)
```
### System configuration {#system-configuration}
Functions used across my literate config files.
@ -3947,7 +4018,7 @@ References:
```emacs-lisp
(use-package lsp-mode
:straight t
:if (not (or my/slow-ssh my/is-termux))
:if (not (or my/slow-ssh my/is-termux my/remote-server))
:hook (
(typescript-mode . lsp)
(vue-mode . lsp)
@ -4000,6 +4071,7 @@ Origami should've leveraged LSP folding, but it was too unstable at the moment I
;; (add-hook 'lsp-after-open-hook #'lsp-origami-try-enable))
(use-package lsp-treemacs
:after (lsp)
:straight t
:commands lsp-treemacs-errors-list)
```
@ -4076,6 +4148,7 @@ References:
(use-package tree-sitter
:straight t
:if (not my/remote-server)
:hook ((typescript-mode . my/tree-sitter-if-not-mmm)
(js-mode . my/tree-sitter-if-not-mmm)
(python-mode . tree-sitter-mode)
@ -4204,10 +4277,12 @@ References:
```
#### <span class="org-todo todo CHECK">CHECK</span> (OFF) Format-all {#off--format-all}
#### Reformatter {#reformatter}
A general-purpose package to run formattters on files. While the most popular formatters are already packaged for Emacs, those that aren't can be invoked with this package.
```emacs-lisp
(use-package format-all
(use-package reformatter
:straight t)
```
@ -4870,7 +4945,6 @@ References:
- [LanguageTool homepage](https://languagetool.org/)
- [LanguageTool http server](https://dev.languagetool.org/http-server)
- [LanguageTool for Emacs repo](https://github.com/mhayashi1120/Emacs-langtool)
<!--listend-->
@ -4879,7 +4953,7 @@ References:
:straight t
:commands (langtool-check)
:config
(setq langtool-language-tool-server-jar "/home/pavel/Programs/LanguageTool-5.1/languagetool-server.jar")
(setq langtool-language-tool-server-jar "/home/pavel/bin/LanguageTool-5.4/languagetool-server.jar")
(setq langtool-mother-tongue "ru")
(setq langtool-default-language "en-US"))
@ -5358,6 +5432,18 @@ A function to start up [TensorBoard](https://www.tensorflow.org/tensorboard).
```
### Lua {#lua}
```emacs-lisp
(use-package lua-mode
:straight t
:mode "\\.lua\\'"
:hook (lua-mode . smartparens-mode))
(my/set-smartparens-indent 'lua-mode)
```
### JSON {#json}
```emacs-lisp
@ -5371,6 +5457,36 @@ A function to start up [TensorBoard](https://www.tensorflow.org/tensorboard).
```
### SQL {#sql}
[sql-formatter](https://github.com/zeroturnaround/sql-formatter) is a nice JavaScript package for pretty-printing SQL queries. It is not packaged for Emacs, so the easiest way to use it seems to be to define a custom formatter via [reformatter](https://github.com/purcell/emacs-reformatter).
Also, I've a simple function to switch dialects because I often alternate between them.
So far I didn't find a nice SQL client for Emacs, but I occasionally run SQL queries in Org Mode, so this qute package is handy.
```emacs-lisp
(setq my/sqlformatter-dialect-choice
'("db2" "mariadb" "mysql" "n1ql" "plsql" "postgresql" "redshift" "spark" "sql" "tsql"))
(setq my/sqlformatter-dialect "postgresql")
(defun my/sqlformatter-set-dialect ()
"Set dialect for sql-formatter"
(interactive)
(setq my/sqlformatter-dialect
(completing-read "Dialect: " my/sqlformatter-dialect-choice)))
(reformatter-define sqlformat
:program (executable-find "sql-formatter")
:args `("-l" ,my/sqlformatter-dialect))
(my-leader-def
:keymaps '(sql-mode-map)
"rr" #'sqlformat-buffer)
```
### YAML {#yaml}
```emacs-lisp
@ -5516,7 +5632,7 @@ Open a file managed by yadm.
My notmuch config now resides in [Mail.org]({{< relref "Mail" >}}).
```emacs-lisp
(unless my/is-termux
(unless (or my/is-termux my/remote-server)
(load-file (expand-file-name "mail.el" user-emacs-directory)))
```
@ -5532,12 +5648,13 @@ Using my own fork until the modifications are merged into master.
```emacs-lisp
(use-package elfeed
:straight (:repo "SqrtMinusOne/elfeed" :host github)
:if (not my/remote-server)
:commands (elfeed)
:init
(my-leader-def "ae" 'elfeed)
:config
(setq elfeed-db-directory "~/.elfeed")
(setq elfeed-enclosure-default-dir (expand-file-name "~"))
(setq elfeed-enclosure-default-dir (expand-file-name "~/Downloads"))
(advice-add #'elfeed-insert-html
:around
(lambda (fun &rest r)
@ -5655,6 +5772,7 @@ References:
```emacs-lisp
(use-package emms
:straight t
:if (not my/remote-server)
:commands (emms-smart-browse
emms-browser
emms-add-url
@ -5683,11 +5801,11 @@ References:
;; MPV setup
<<emms-mpv-setup>>
;; evil-lion and evil-commentary shadow some gX bindings
(add-hook 'emms-browser-mode-hook
(lambda ()
(evil-lion-mode -1)
;; (evil-commentary-mode -1)
))
;; (add-hook 'emms-browser-mode-hook
;; (lambda ()
;; (evil-lion-mode -1)
;; (evil-commentary-mode -1)
;; ))
;; I have everything I need in polybar
(emms-mode-line-mode -1)
(emms-playing-time-display-mode -1)
@ -5742,7 +5860,7 @@ After all this is done, run `M-x emms-cache-set-from-mpd-all` to set cache from
[mpv](https://mpv.io/) is a decent media player, which has found a place in this configuration because it integrates with youtube-dl.
```emacs-lisp
(add-to-list 'emms-player-list 'emms-player-mpv)
(add-to-list 'emms-player-list 'emms-player-mpv t)
```
Also a custom regex. My demands for MPV include running `youtube-dl`, so there is a regex that matches youtube.com or some of the video formats.
@ -5783,7 +5901,7 @@ Now `emms-add-url` should work on YouTube URLs just fine. Just keep in mind that
##### Cache cleanup {#cache-cleanup}
All added URLs reside in the EMMS cache after being played. I don't want them to stay there for a long time, so here is a handy function to clean it.
All the added URLs reside in the EMMS cache after being played. I don't want them to stay there for a long time, so here is a handy function to clean it.
```emacs-lisp
(defun my/emms-cleanup-urls ()
@ -6059,7 +6177,7 @@ References:
(shell-command-to-string (format "curl -L %s --output %s" tldr-source-zip-url tldr-saved-zip-path))
(when (file-exists-p "/tmp/tldr")
(delete-directory "/tmp/tldr" t))
(shell-command-to-string (format "unzip -d /tmp/tldr/ %s" tldr-saved-zip-path) nil nil)
(shell-command-to-string (format "unzip -d /tmp/tldr/ %s" tldr-saved-zip-path))
(when (file-exists-p tldr-directory-path)
(delete-directory tldr-directory-path 'recursive 'no-trash))
(shell-command-to-string (format "mv %s %s" "/tmp/tldr/tldr-main" tldr-directory-path))))
@ -6110,6 +6228,8 @@ Finally, there is also an Emacs plugin for [devdocs.io](https://devdocs.io).
I use [pass](https://www.passwordstore.org/) as my password manager. Expectedly, there is Emacs frontend for it.
Although I use [this rofi frontend](https://github.com/carnager/rofi-pass) for actually inserting passwords.
```emacs-lisp
(use-package pass
:straight t
@ -6249,6 +6369,7 @@ Tecosaur's plugin to make beautiful code screenshots.
```emacs-lisp
(use-package screenshot
:straight (:repo "tecosaur/screenshot" :host github :files ("screenshot.el"))
:if (display-graphic-p)
:commands (screenshot)
:init
(my-leader-def "S" 'screenshot))
@ -6340,14 +6461,14 @@ In order for this to work in Guix, a service is necessary - [Discord rich presen
:if (and (or
(string= (system-name) "indigo")
(string= (system-name) "eminence"))
(not my/slow-ssh))
(not my/slow-ssh)
(not my/remote-server))
:config
(elcord-mode)
(add-to-list 'elcord-boring-buffers-regexp-list
(rx bos (+ num) "-" (+ num) "-" (+ num) ".org" eos))
(add-to-list 'elcord-boring-buffers-regexp-list
(rx bos (= 14 num) "-" (* not-newline) ".org" eos))
)
(rx bos (= 14 num) "-" (* not-newline) ".org" eos)))
```

View file

@ -124,6 +124,12 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Productivity & Knowledge management](#productivity-and-knowledge-management)
- [Capture templates & various settings](#capture-templates-and-various-settings)
- [Custom agendas](#custom-agendas)
- [org-ql](#org-ql)
- [Review workflow](#review-workflow)
- [Data from git & org-roam](#data-from-git-and-org-roam)
- [Data from org-journal](#data-from-org-journal)
- [Data from org-agenda via org-ql](#data-from-org-agenda-via-org-ql)
- [Capture template](#capture-template)
- [Org Journal](#org-journal)
- [Org Roam](#org-roam)
- [org-roam-ui](#org-roam-ui)
@ -234,7 +240,7 @@ As with other files in the repo, parts prefixed with (OFF) are not used but kept
- [Notmuch](#notmuch)
- [Elfeed](#elfeed)
- [Some additions](#some-additions)
- [YouTube](#youtube)
- [YouTube & EMMS](#youtube-and-emms)
- [EMMS](#emms)
- [MPD](#mpd)
- [MPV](#mpv)
@ -2966,6 +2972,262 @@ Log DONE time
```
#### org-ql {#org-ql}
[org-ql](https://github.com/alphapapa/org-ql) is a package to query the org files. I'm using it in my review workflow, perhaps later I'll find another usecases.
```emacs-lisp
(use-package org-ql
:straight (:fetcher github
:repo "alphapapa/org-ql"
:files (:defaults (:exclude "helm-org-ql.el"))))
```
#### Review workflow {#review-workflow}
My take on a review workflow. As a baseline, I want to have a template that lists the important changes since the last review and other basic information. I'm doing reviews regularly, but the time intervals still may vary, hence this flexibility.
##### Data from git & org-roam {#data-from-git-and-org-roam}
First, as I have [autocommit]({{< relref "Console" >}}) set up in my org directory, here is a handy function to get an alist of changed files of a form `(status . path)`. In principle, the `rev` parameter can be a commit, tag, etc but here I'm interested in a form like `@{2021-08-30}`.
```emacs-lisp
(setq my/git-diff-status
'(("A" . added)
("C" . copied)
("D" . deleted)
("M" . modified)
("R" . renamed)
("T" . type-changed)
("U" . unmerged)))
(defun my/get-files-status (rev)
(let ((files (shell-command-to-string (concat "git diff --name-status " rev))))
(mapcar
(lambda (file)
(let ((elems (split-string file "\t")))
(cons
(cdr (assoc (car elems) my/git-diff-status))
(nth 1 elems))))
(split-string files "\n" t))))
```
I'll use it to get a list of added and changed Roam files since the last review. Date should have be in a format `YYYY-MM-DD`.
```emacs-lisp
(defun my/org-changed-files-since-date (date)
(let ((default-directory org-directory))
(my/get-files-status (format "@{%s}" date))))
```
Now we are ready to format this list to insert it into the capture template.
```emacs-lisp
(defun my/org-review-format-roam (rev)
(let* ((changes (my/org-changed-files-since-date rev))
(new-roam
(seq-filter
(lambda (elem)
(and (eq (car elem) 'added)
(string-match-p (rx bos "roam") (cdr elem))))
changes))
(changed-roam
(seq-filter
(lambda (elem)
(and (eq (car elem) 'modified)
(string-match-p (rx bos "roam") (cdr elem))))
changes)))
(concat
(unless (seq-empty-p new-roam)
(concat "** New Roam entries \n"
(mapconcat
(lambda (entry)
(format "- [[file:%s][%s]]" (cdr entry) (cdr entry)))
new-roam
"\n")
"\n"))
(unless (seq-empty-p changed-roam)
(concat "** Changed Roam entries \n"
(mapconcat
(lambda (entry)
(format "- [[file:%s][%s]]" (cdr entry) (cdr entry)))
changed-roam
"\n"))))))
```
##### Data from org-journal {#data-from-org-journal}
Second, I want to have a list of new jounal entries since the last review.
```emacs-lisp
(defun my/org-journal-entries-since-date (rev-date)
(mapcar
(lambda (date)
(let ((time (encode-time (parse-time-string date))))
`((file . ,(org-journal--get-entry-path time))
(header . ,(format-time-string org-journal-date-format time)))))
(seq-filter
(lambda (date) (string-lessp rev-date date))
(mapcar
(lambda (date)
(format "%04d-%02d-%02dT00:00:00+0300" (nth 2 date) (nth 0 date) (nth 1 date)))
(org-journal--list-dates)))))
```
Format the results:
```emacs-lisp
(defun my/org-review-format-journal (rev-date)
(mapconcat
(lambda (item)
(format "- [[file:%s::*%s][%s]]"
(cdr (assoc 'file item))
(cdr (assoc 'header item))
(cdr (assoc 'header item))))
(my/org-journal-entries-since-date rev-date)
"\n"))
```
##### Data from org-agenda via org-ql {#data-from-org-agenda-via-org-ql}
Third, I want to list some changes in my agenda. This section will change depending on what I'm currently working on.
So, here is a list of queries results of which I want to see in the review template. The format is `(name date-field order-by-field query)`.
```emacs-lisp
(setq my/org-ql-review-queries
`(("Waitlist" scheduled scheduled
(and
(done)
(tags-inherited "waitlist")))
("Personal tasks done" closed ,nil
(and
(tags-inherited "personal")
(todo "DONE")))
("Attended meetings" closed scheduled
(and
(tags "meeting")
(todo "PASSED")))
("Done project tasks" closed deadline
(and
(todo "DONE")
(ancestors
(heading "Tasks"))))))
```
The query will be executed like this: `(and (date-field :from rev-date) query)`
```emacs-lisp
(defun my/org-review-exec-ql (saved rev-date)
(let ((query `(and
(,(nth 1 saved) :from ,rev-date)
,(nth 3 saved))))
(org-ql-query
:select #'element
:from (org-agenda-files)
:where query
:order-by (nth 2 saved))))
```
Format one element of query result.
```emacs-lisp
(defun my/org-review-format-element (elem)
(concat
(string-pad
(plist-get (cadr elem) :raw-value)
40)
(when-let (scheduled (plist-get (cadr elem) :scheduled))
(concat " [SCHEDULED: " (plist-get (cadr scheduled) :raw-value) "]"))
(when-let (deadline (plist-get (cadr elem) :deadline))
(concat " [DEADLINE: " (plist-get (cadr deadline) :raw-value) "]"))))
```
Execute all the saved queries and format an Org list for the capture template.
```emacs-lisp
(defun my/org-review-format-queries (rev-date)
(mapconcat
(lambda (results)
(concat "** " (car results) "\n"
(string-join
(mapcar (lambda (r) (concat "- " r)) (cdr results))
"\n")
"\n"))
(seq-filter
(lambda (result)
(not (seq-empty-p (cdr result))))
(mapcar
(lambda (saved)
(cons
(car saved)
(mapcar
#'my/org-review-format-element
(my/org-review-exec-ql saved rev-date))))
my/org-ql-review-queries))
"\n"))
```
##### Capture template {#capture-template}
Now, we have to put all this together and define a capture template for the review.
I'll use a separate directory for the review files, just like for org-journal and org-roam. The filename will have a format `YYYY-MM-DD.org`, which will also free me from the effort of storing the last review date somewhere.
If somehow there are no files in the folder, fallback to the current date minus one week.
```emacs-lisp
(setq my/org-review-directory "review")
(defun my/org-review-get-filename ()
(concat my/org-review-directory "/" (format-time-string "%Y-%m-%d.org" (current-time))))
(defun my/get-last-review-date ()
(substring
(or
(-max-by
'string-greaterp
(-filter
(lambda (f) (not (or (string-equal f ".") (string-equal f ".."))))
(directory-files (f-join org-directory my/org-review-directory))))
(format-time-string
"%Y-%m-%d"
(time-subtract
(current-time)
(seconds-to-time (* 60 60 24 7)))))
0 10))
```
A template looks like this:
```emacs-lisp
(setq my/org-review-capture-template
`("r" "Review" plain (file ,(my/org-review-get-filename))
,(string-join
'("#+TITLE: Review %t"
""
"Last review date: %(org-timestamp-translate (org-timestamp-from-string (format \"<%s>\" (my/get-last-review-date))))"
""
"* Roam"
"%(my/org-review-format-roam (my/get-last-review-date))"
"* Journal"
"New journal entries:"
"%(my/org-review-format-journal (my/get-last-review-date))"
"* Agenda"
"%(my/org-review-format-queries (my/get-last-review-date))"
"* Thoughts :crypt:"
"%?")
"\n")))
(add-to-list 'org-capture-templates my/org-review-capture-template t)
```
#### Org Journal {#org-journal}
[org-journal](https://github.com/bastibe/org-journal) is a plugin for maintaining a journal in org mode. I want to have its entries separate from my knowledge base.
@ -4101,8 +4363,7 @@ Trying this one out instead of vue-mode and svelte-mode, because this one seems
:config
(add-hook 'web-mode-hook 'smartparens-mode)
(add-hook 'web-mode-hook 'hs-minor-mode)
(my/set-smartparens-indent 'web-mode)
(add-hook 'web-mode-hook ))
(my/set-smartparens-indent 'web-mode))
```
Hooking this up with lsp.
@ -5338,7 +5599,7 @@ Open a URL with eww.
```
##### YouTube {#youtube}
##### YouTube & EMMS {#youtube-and-emms}
Previously this block was opening MPV with `start-process`, but now I've managed to hook up MPV with EMMS. So there is the EMMS+elfeed "integration".
@ -5364,12 +5625,13 @@ Now, a function to add YouTube link with metadata from elfeed to EMMS.
(let ((track (emms-track
'url (my/get-youtube-url (elfeed-entry-link entry)))))
(emms-track-set track 'info-title (elfeed-entry-title entry))
(setq my/test track)
(emms-playlist-insert-track track))))
(defun my/elfeed-add-emms-youtube ()
(interactive)
(emms-add-elfeed elfeed-show-entry))
(emms-add-elfeed elfeed-show-entry)
(elfeed-tag elfeed-show-entry 'watched)
(elfeed-show-refresh))
(with-eval-after-load 'elfeed
(general-define-key

View file

@ -598,6 +598,7 @@ Don't forget to install `JetBrainsMono Nerd Font`.
|----------|-----------------------------|
| system | openvpn |
| system | openvpn-update-resolve-conf |
| system | vpnc |
I'm not sure how to properly spin up VPN on Guix, so here is what I'm doing now, after some trial and error.
@ -715,6 +716,8 @@ mkdir -p ~/.conda/envs
conda create -p ~/.conda/envs/test
```
Fourth, you may need to unset `$PYTHONPATH` if you have any global packages installed, otherwise Python from anaconda will try to import them instead of the conda versions.
Finally, I also want to have an ability to use global npm. Some settings for that are located in [Console.org](Console). Here we want to unset `NPM_CONFIG_USERCONFIG` if there is npm available in the environment.
So here is a script to set up conda hooks:

View file

@ -13,7 +13,7 @@ The majority of the software is configured with [literate configuration](https:/
The files themselves are managed and deployed via [yadm](https://yadm.io/), but I mostly use Org Mode rich noweb whenever I can instead of what yadm offers.
My current GNU/Linux distribution is [GNU Guix](https://guix.gnu.org/). In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for the tables with "Guix dependency" in the header.
My current GNU/Linux distribution is [GNU Guix](https://guix.gnu.org/). In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for tables with "Guix dependency" in the header.
Literate configuration files:

View file

@ -66,7 +66,6 @@
<span style="color:#75715e"># export BROWSER=/usr/bin/firefox</span>
export QT_QPA_PLATFORMTHEME<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;qt5ct&#34;</span>
export QT_AUTO_SCREEN_SCALE_FACTOR<span style="color:#f92672">=</span><span style="color:#ae81ff">0</span>
export TZ<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;Asia/Yekaterinburg&#34;</span>
<span style="color:#75715e"># export GTK2_RC_FILES=&#34;$HOME/.gtkrc-2.0&#34;</span>
</code></pre></div><h3 id="my-paths">My paths</h3>
<p>My script folders</p>

View file

@ -149,6 +149,7 @@
<ul>
<li><a href="#buku-bookmarks">Buku bookmarks</a></li>
<li><a href="#man-pages">Man pages</a></li>
<li><a href="#pass">pass</a></li>
</ul>
</li>
</ul>
@ -638,7 +639,7 @@ pid<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>xdot
</span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#a6e22e">bindsym</span> $<span style="color:#a6e22e">mod</span>+<span style="color:#a6e22e">Shift</span>+<span style="color:#a6e22e">g</span> <span style="color:#a6e22e">mode</span> <span style="color:#e6db74">&#34;outer gaps&#34;</span><span style="color:#960050;background-color:#1e0010">
</span></code></pre></div><h3 id="move-and-resize-windows">Move &amp; resize windows</h3>
<p>A more or less standard set of keybindings to move &amp; resize floating windows.</p>
<p>Just be careful to always make a way to return from these new modes, otherwise, you&rsquo;d end up in a rather precarious position.</p>
<p>Just be careful to always make a way to return from these new modes, otherwise you&rsquo;d end up in a rather precarious situation.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-vim" data-lang="vim"># <span style="color:#a6e22e">resize</span> <span style="color:#a6e22e">window</span> (<span style="color:#a6e22e">you</span> <span style="color:#a6e22e">can</span> <span style="color:#a6e22e">also</span> <span style="color:#a6e22e">use</span> <span style="color:#a6e22e">the</span> <span style="color:#a6e22e">mouse</span> <span style="color:#a6e22e">for</span> <span style="color:#a6e22e">that</span>)<span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#a6e22e">mode</span> <span style="color:#e6db74">&#34;resize&#34;</span> {<span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> # <span style="color:#a6e22e">These</span> <span style="color:#a6e22e">bindings</span> <span style="color:#a6e22e">trigger</span> <span style="color:#a6e22e">as</span> <span style="color:#a6e22e">soon</span> <span style="color:#a6e22e">as</span> <span style="color:#a6e22e">you</span> <span style="color:#a6e22e">enter</span> <span style="color:#a6e22e">the</span> <span style="color:#a6e22e">resize</span> <span style="color:#a6e22e">mode</span><span style="color:#960050;background-color:#1e0010">
@ -712,6 +713,7 @@ pid<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>xdot
<p>Keybindings to launch <a href="https://github.com/davatorium/rofi">rofi</a>. For more detail, look the <a href="#rofi">Rofi</a> section.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-vim" data-lang="vim"><span style="color:#a6e22e">bindsym</span> $<span style="color:#a6e22e">mod</span>+<span style="color:#a6e22e">d</span> <span style="color:#a6e22e">exec</span> <span style="color:#e6db74">&#34;rofi -modi &#39;drun,run&#39; -show drun&#34;</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#a6e22e">bindsym</span> $<span style="color:#a6e22e">mod</span>+<span style="color:#a6e22e">b</span> <span style="color:#a6e22e">exec</span> --<span style="color:#a6e22e">no</span>-<span style="color:#a6e22e">startup</span>-<span style="color:#a6e22e">id</span> <span style="color:#a6e22e">rofi</span>-<span style="color:#a6e22e">buku</span>-<span style="color:#a6e22e">mine</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#a6e22e">bindsym</span> $<span style="color:#a6e22e">mod</span>+<span style="color:#a6e22e">minus</span> <span style="color:#a6e22e">exec</span> <span style="color:#a6e22e">rofi</span>-<span style="color:#a6e22e">pass</span>; <span style="color:#a6e22e">mode</span> <span style="color:#a6e22e">default</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span><span style="color:#a6e22e">bindsym</span> $<span style="color:#a6e22e">mod</span>+<span style="color:#a6e22e">apostrophe</span> <span style="color:#a6e22e">mode</span> <span style="color:#e6db74">&#34;rofi&#34;</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010">
@ -719,7 +721,7 @@ pid<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>xdot
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">bindsym</span> <span style="color:#a6e22e">d</span> <span style="color:#a6e22e">exec</span> <span style="color:#e6db74">&#34;rofi -modi &#39;drun,run&#39; -show drun&#34;</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">bindsym</span> <span style="color:#a6e22e">m</span> <span style="color:#a6e22e">exec</span> <span style="color:#a6e22e">rofi</span>-<span style="color:#a6e22e">man</span>; <span style="color:#a6e22e">mode</span> <span style="color:#a6e22e">default</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">bindsym</span> <span style="color:#a6e22e">b</span> <span style="color:#a6e22e">exec</span> <span style="color:#a6e22e">rofi</span>-<span style="color:#a6e22e">buku</span>-<span style="color:#a6e22e">mine</span>; <span style="color:#a6e22e">mode</span> <span style="color:#a6e22e">default</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">bindsym</span> <span style="color:#a6e22e">k</span> <span style="color:#a6e22e">exec</span> <span style="color:#a6e22e">rofi</span>-<span style="color:#a6e22e">keepassxc</span> -<span style="color:#a6e22e">d</span> ~<span style="color:#e6db74">/MEGAsync/</span><span style="color:#a6e22e">Passwords</span>.<span style="color:#a6e22e">kdbx</span>; <span style="color:#a6e22e">mode</span> <span style="color:#a6e22e">default</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">bindsym</span> <span style="color:#a6e22e">k</span> <span style="color:#a6e22e">exec</span> <span style="color:#a6e22e">rofi</span>-<span style="color:#a6e22e">pass</span>; <span style="color:#a6e22e">mode</span> <span style="color:#a6e22e">default</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">bindsym</span> <span style="color:#a6e22e">Escape</span> <span style="color:#a6e22e">mode</span> <span style="color:#e6db74">&#34;default&#34;</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span>}<span style="color:#960050;background-color:#1e0010">
</span></code></pre></div><h3 id="launching-apps-and-misc-keybindings">Launching apps &amp; misc keybindings</h3>
@ -933,7 +935,7 @@ declare -A BLOCKS<span style="color:#f92672">=(</span>
<span style="color:#f92672">)</span>
<span style="color:#75715e"># Geolocation for some modules</span>
export LOC<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;TMN&#34;</span>
export LOC<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;SPB&#34;</span>
export IPSTACK_API_KEY<span style="color:#f92672">=</span><span style="color:#66d9ef">$(</span>pass show My_Online/APIs/ipstack | head -n 1<span style="color:#66d9ef">)</span>
@ -1594,6 +1596,27 @@ $BUKU -f <span style="color:#ae81ff">4</span> -p | awk -F<span style="color:#e6d
<span style="color:#66d9ef">if</span> <span style="color:#f92672">[[</span> ! -z $SELECTED <span style="color:#f92672">]]</span>; <span style="color:#66d9ef">then</span>
man -Tpdf $SELECTED | zathura -
<span style="color:#66d9ef">fi</span>
</code></pre></div><h4 id="pass">pass</h4>
<table>
<thead>
<tr>
<th>Guix dependency</th>
</tr>
</thead>
<tbody>
<tr>
<td>rofi-pass</td>
</tr>
<tr>
<td>xset</td>
</tr>
</tbody>
</table>
<p>A nice <a href="https://github.com/carnager/rofi-pass">pass frontend for Rofi</a>, which is even packaged for Guix.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">USERNAME_field<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;username&#39;</span>
EDITOR<span style="color:#f92672">=</span>vim
default_autotype<span style="color:#f92672">=</span><span style="color:#e6db74">&#39;username :tab pass&#39;</span>
clip<span style="color:#f92672">=</span>both
</code></pre></div><h2 id="flameshot">Flameshot</h2>
<table>
<thead>
@ -1710,7 +1733,7 @@ $BUKU -f <span style="color:#ae81ff">4</span> -p | awk -F<span style="color:#e6d
</span><span style="color:#960050;background-color:#1e0010"></span> # <span style="color:#a6e22e">Show</span> <span style="color:#a6e22e">how</span> <span style="color:#a6e22e">many</span> <span style="color:#a6e22e">messages</span> <span style="color:#a6e22e">are</span> <span style="color:#a6e22e">currently</span> <span style="color:#a6e22e">hidden</span> (<span style="color:#a6e22e">because</span> <span style="color:#a6e22e">of</span> <span style="color:#a6e22e">geometry</span>).<span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">indicate_hidden</span> = <span style="color:#a6e22e">yes</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> # <span style="color:#a6e22e">Shrink</span> <span style="color:#a6e22e">window</span> <span style="color:#66d9ef">if</span> <span style="color:#a6e22e">it</span>&#39;<span style="color:#a6e22e">s</span> <span style="color:#a6e22e">smaller</span> <span style="color:#a6e22e">than</span> <span style="color:#a6e22e">the</span> <span style="color:#a6e22e">width</span>. <span style="color:#a6e22e">Will</span> <span style="color:#a6e22e">be</span> <span style="color:#a6e22e">ignored</span> <span style="color:#66d9ef">if</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> # <span style="color:#a6e22e">Shrink</span> <span style="color:#a6e22e">window</span> <span style="color:#66d9ef">if</span> <span style="color:#a6e22e">its</span> <span style="color:#a6e22e">smaller</span> <span style="color:#a6e22e">than</span> <span style="color:#a6e22e">the</span> <span style="color:#a6e22e">width</span>. <span style="color:#a6e22e">Will</span> <span style="color:#a6e22e">be</span> <span style="color:#a6e22e">ignored</span> <span style="color:#66d9ef">if</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> # <span style="color:#a6e22e">width</span> <span style="color:#a6e22e">is</span> <span style="color:#ae81ff">0</span>.<span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010"></span> <span style="color:#a6e22e">shrink</span> = <span style="color:#a6e22e">no</span><span style="color:#960050;background-color:#1e0010">
</span><span style="color:#960050;background-color:#1e0010">
@ -2304,6 +2327,22 @@ $BUKU -f <span style="color:#ae81ff">4</span> -p | awk -F<span style="color:#e6d
<td>dev</td>
<td>gcc-toolchain</td>
</tr>
<tr>
<td>dev</td>
<td>lua</td>
</tr>
<tr>
<td>dev</td>
<td>libfaketime</td>
</tr>
<tr>
<td>dev</td>
<td>hugo-extended</td>
</tr>
<tr>
<td>dev</td>
<td>make</td>
</tr>
</tbody>
</table>
<h3 id="manifests">Manifests</h3>
@ -2683,6 +2722,14 @@ aw-watcher-afk
<td>anydesk</td>
<td>Remote desktop software</td>
</tr>
<tr>
<td>gnome-disk-utility</td>
<td>Manage disks</td>
</tr>
<tr>
<td>gparted</td>
<td>Manage partitions</td>
</tr>
</tbody>
</table>
<p><a id="code-snippet--packages"></a></p>

View file

@ -73,18 +73,19 @@
<li><a href="#measure-startup-speed">Measure startup speed</a></li>
<li><a href="#straight-dot-el">straight.el</a></li>
<li><a href="#use-package">use-package</a></li>
<li><a href="#config-variants-and-environment">config variants &amp; environment</a></li>
<li><a href="#performance">Performance</a>
<ul>
<li><a href="#garbage-collection">Garbage collection</a></li>
<li><a href="#run-garbage-collection-when-emacs-is-unfocused">Run garbage collection when Emacs is unfocused</a></li>
<li><a href="#misc">Misc</a></li>
<li><a href="#native-compilation">Native compilation</a></li>
</ul>
</li>
<li><a href="#anaconda-and-environment">Anaconda &amp; environment</a></li>
<li><a href="#anaconda">Anaconda</a></li>
<li><a href="#custom-file-location">Custom file location</a></li>
<li><a href="#private-config">Private config</a></li>
<li><a href="#no-littering">No littering</a></li>
<li><a href="#prevent-emacs-from-closing">Prevent Emacs from closing</a></li>
</ul>
</li>
<li><a href="#global-editing-configuration">Global editing configuration</a>
@ -288,7 +289,12 @@
</ul>
</li>
<li><a href="#presentations">Presentations</a></li>
<li><a href="#tools">Tools</a>
<ul>
<li><a href="#toc">TOC</a></li>
<li><a href="#screenshots">Screenshots</a></li>
</ul>
</li>
<li><a href="#system-configuration">System configuration</a>
<ul>
<li><a href="#tables-for-guix-dependencies">Tables for Guix Dependencies</a></li>
@ -325,7 +331,7 @@
<li><a href="#plugin">Plugin</a></li>
</ul>
</li>
<li><a href="#off--format-all"><span class="org-todo todo CHECK">CHECK</span> (OFF) Format-all</a></li>
<li><a href="#reformatter">Reformatter</a></li>
<li><a href="#general-additional-config">General additional config</a></li>
</ul>
</li>
@ -411,7 +417,9 @@
<li><a href="#fish">fish</a></li>
<li><a href="#sh">sh</a></li>
<li><a href="#haskell">Haskell</a></li>
<li><a href="#lua">Lua</a></li>
<li><a href="#json">JSON</a></li>
<li><a href="#sql">SQL</a></li>
<li><a href="#yaml">YAML</a></li>
<li><a href="#dot-env">.env</a></li>
<li><a href="#csv">CSV</a></li>
@ -531,6 +539,26 @@
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(straight-use-package <span style="color:#e6db74">&#39;use-package</span>)
(eval-when-compile (require <span style="color:#e6db74">&#39;use-package</span>))
<span style="color:#75715e">;; (setq use-package-verbose t)</span>
</code></pre></div><h3 id="config-variants-and-environment">config variants &amp; environment</h3>
<p>The following variable is true when my machine is not powerful enough for some resource-heavy packages.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/lowpower (string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;azure&#34;</span>))
</code></pre></div><p>The following is true if Emacs is meant to be used with TRAMP over slow ssh.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/slow-ssh
(or
(string= (getenv <span style="color:#e6db74">&#34;IS_TRAMP&#34;</span>) <span style="color:#e6db74">&#34;true&#34;</span>)
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;dev-digital&#34;</span>)))
</code></pre></div><p>The following is true is Emacs is ran on a remote server where I don&rsquo;t need stuff like my org workflow</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/remote-server
(or (string= (getenv <span style="color:#e6db74">&#34;IS_REMOTE&#34;</span>) <span style="color:#e6db74">&#34;true&#34;</span>)
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;dev-digital&#34;</span>)))
</code></pre></div><p>And the following is true if Emacs is run from termux on Android.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/is-termux (string-match-p (rx (<span style="color:#a6e22e">*</span> nonl) <span style="color:#e6db74">&#34;com.termux&#34;</span> (<span style="color:#a6e22e">*</span> nonl)) (getenv <span style="color:#e6db74">&#34;HOME&#34;</span>)))
</code></pre></div><p>Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setenv <span style="color:#e6db74">&#34;IS_EMACS&#34;</span> <span style="color:#e6db74">&#34;true&#34;</span>)
</code></pre></div><p>Finally, I want to have a minimal Emacs config for debugging purposes. This has just straight.el, use-packages and evil.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">&lt;&lt;minimal&gt;&gt;
</code></pre></div><p>To launch Emacs with this config, run</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">emacs -q -l ~/.emacs.d/init-minimal.el
</code></pre></div><h3 id="performance">Performance</h3>
<h4 id="garbage-collection">Garbage collection</h4>
<p>Just setting <code>gc-cons-treshold</code> to a larger value.</p>
@ -547,18 +575,11 @@
(unless (frame-focus-state)
(<span style="color:#a6e22e">garbage-collect</span>))))
(add-hook <span style="color:#e6db74">&#39;after-focus-change-function</span> <span style="color:#e6db74">&#39;garbage-collect</span>))))
</code></pre></div><h4 id="misc">Misc</h4>
<p>The following variable is true when my machine is not powerful enough for some resource-heavy packages.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/lowpower (string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;azure&#34;</span>))
</code></pre></div><p>The following is true if Emacs is meant to be used with TRAMP over slow ssh.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/slow-ssh (string= (getenv <span style="color:#e6db74">&#34;IS_TRAMP&#34;</span>) <span style="color:#e6db74">&#34;true&#34;</span>))
</code></pre></div><p>And the following is true if Emacs is run from termux on Android.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/is-termux (string-match-p (rx (<span style="color:#a6e22e">*</span> nonl) <span style="color:#e6db74">&#34;com.termux&#34;</span> (<span style="color:#a6e22e">*</span> nonl)) (getenv <span style="color:#e6db74">&#34;HOME&#34;</span>)))
</code></pre></div><h4 id="native-compilation">Native compilation</h4>
<p>Set number of jobs to 1 on low-power machines</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(when my/lowpower
(setq comp-async-jobs-number <span style="color:#ae81ff">1</span>))
</code></pre></div><h3 id="anaconda-and-environment">Anaconda &amp; environment</h3>
</code></pre></div><h3 id="anaconda">Anaconda</h3>
<p><a href="https://www.anaconda.com/">Anaconda</a> is a free package and environment manager. I currently use it to manage multiple versions of Python and Node.js</p>
<p>The following code uses the conda package to activate the base environment on startup if Emacs is launched outside the environment.</p>
<p>Also, some strange things are happening if vterm is launched with conda activated from Emacs, so I advise <code>conda-env-activate</code> to set an auxililary environment variable.</p>
@ -580,8 +601,6 @@
(lambda (<span style="color:#66d9ef">&amp;rest</span> _) (setenv <span style="color:#e6db74">&#34;EMACS_CONDA_ENV&#34;</span> conda-env-current-name)))
(unless (getenv <span style="color:#e6db74">&#34;CONDA_DEFAULT_ENV&#34;</span>)
(conda-env-activate <span style="color:#e6db74">&#34;general&#34;</span>)))
</code></pre></div><p>Also, I sometimes need to know if a program is running inside Emacs (say, inside a terminal emulator). To do that, I set the following environment variable:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setenv <span style="color:#e6db74">&#34;IS_EMACS&#34;</span> <span style="color:#e6db74">&#34;true&#34;</span>)
</code></pre></div><h3 id="custom-file-location">Custom file location</h3>
<p>By default, custom writes stuff to <code>init.el</code>, which is somewhat annoying. The following makes a separate file <code>custom.el</code></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq custom-file (<span style="color:#a6e22e">concat</span> user-emacs-directory <span style="color:#e6db74">&#34;custom.el&#34;</span>))
@ -595,6 +614,9 @@
<p>By default emacs and its packages create a lot files in <code>.emacs.d</code> and in other places. <a href="https://github.com/emacscollective/no-littering">no-littering</a> is a collective effort to redirect all of this to two folders in <code>user-emacs-directory</code>.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package no-littering
:straight <span style="color:#66d9ef">t</span>)
</code></pre></div><h3 id="prevent-emacs-from-closing">Prevent Emacs from closing</h3>
<p>This adds a confirmation to avoid accidental Emacs closing.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq confirm-kill-emacs <span style="color:#e6db74">&#39;y-or-n-p</span>)
</code></pre></div><h2 id="global-editing-configuration">Global editing configuration</h2>
<h3 id="general-keybindings-stuff">General keybindings stuff</h3>
<h4 id="general-dot-el">general.el</h4>
@ -1284,7 +1306,7 @@
</code></pre></div><p>A company frontend with nice icons.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package company-box
:straight <span style="color:#66d9ef">t</span>
:if (not my/lowpower)
:if (and (display-graphic-p) (not my/lowpower))
:after (company)
:hook (company-mode <span style="color:#f92672">.</span> company-box-mode))
</code></pre></div><h3 id="git-and-magit">Git &amp; Magit</h3>
@ -1371,7 +1393,7 @@
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package wakatime-mode
:straight (:host github :repo <span style="color:#e6db74">&#34;SqrtMinusOne/wakatime-mode&#34;</span>)
:if (not my/is-termux)
:if (not (or my/is-termux my/remote-server))
:config
(setq wakatime-ignore-exit-codes <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">0</span> <span style="color:#ae81ff">1</span> <span style="color:#ae81ff">102</span>))
(advice-add <span style="color:#e6db74">&#39;wakatime-init</span> :after (lambda () (setq wakatime-cli-path <span style="color:#e6db74">&#34;/home/pavel/bin/wakatime-cli&#34;</span>)))
@ -1383,7 +1405,7 @@
(use-package activity-watch-mode
:straight <span style="color:#66d9ef">t</span>
:if (not my/is-termux)
:if (not (or my/is-termux my/remote-server))
:config
(global-activity-watch-mode))
</code></pre></div><h2 id="ui">UI</h2>
@ -1444,7 +1466,9 @@
:config
(setq doom-themes-enable-bold <span style="color:#66d9ef">t</span>
doom-themes-enable-italic <span style="color:#66d9ef">t</span>)
(load-theme <span style="color:#e6db74">&#39;doom-palenight</span> <span style="color:#66d9ef">t</span>)
(if my/remote-server
(load-theme <span style="color:#e6db74">&#39;doom-gruvbox</span> <span style="color:#66d9ef">t</span>)
(load-theme <span style="color:#e6db74">&#39;doom-palenight</span> <span style="color:#66d9ef">t</span>))
(doom-themes-visual-bell-config)
(setq doom-themes-treemacs-theme <span style="color:#e6db74">&#34;doom-colors&#34;</span>)
(doom-themes-treemacs-config))
@ -1640,13 +1664,13 @@
</table>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package emojify
:straight <span style="color:#66d9ef">t</span>
:if (not (or my/lowpower my/is-termux))
:if (and (display-graphic-p) (not (or my/lowpower my/is-termux)))
:hook (after-init <span style="color:#f92672">.</span> global-emojify-mode))
</code></pre></div><h4 id="ligatures">Ligatures</h4>
<p>Ligature setup for the JetBrainsMono font.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package ligature
:straight (:host github :repo <span style="color:#e6db74">&#34;mickeynp/ligature.el&#34;</span>)
:if (not my/is-termux)
:if (display-graphic-p)
:config
(ligature-set-ligatures
<span style="color:#f92672">&#39;</span>(
@ -1662,7 +1686,8 @@
clojure-mode
go-mode
sh-mode
haskell-mode)
haskell-mode
web-mode)
<span style="color:#f92672">&#39;</span>(<span style="color:#e6db74">&#34;--&#34;</span> <span style="color:#e6db74">&#34;---&#34;</span> <span style="color:#e6db74">&#34;==&#34;</span> <span style="color:#e6db74">&#34;===&#34;</span> <span style="color:#e6db74">&#34;!=&#34;</span> <span style="color:#e6db74">&#34;!==&#34;</span> <span style="color:#e6db74">&#34;=!=&#34;</span> <span style="color:#e6db74">&#34;=:=&#34;</span> <span style="color:#e6db74">&#34;=/=&#34;</span> <span style="color:#e6db74">&#34;&lt;=&#34;</span>
<span style="color:#e6db74">&#34;&gt;=&#34;</span> <span style="color:#e6db74">&#34;&amp;&amp;&#34;</span> <span style="color:#e6db74">&#34;&amp;&amp;&amp;&#34;</span> <span style="color:#e6db74">&#34;&amp;=&#34;</span> <span style="color:#e6db74">&#34;++&#34;</span> <span style="color:#e6db74">&#34;+++&#34;</span> <span style="color:#e6db74">&#34;***&#34;</span> <span style="color:#e6db74">&#34;;;&#34;</span> <span style="color:#e6db74">&#34;!!&#34;</span> <span style="color:#e6db74">&#34;??&#34;</span>
<span style="color:#e6db74">&#34;?:&#34;</span> <span style="color:#e6db74">&#34;?.&#34;</span> <span style="color:#e6db74">&#34;?=&#34;</span> <span style="color:#e6db74">&#34;&lt;:&#34;</span> <span style="color:#e6db74">&#34;:&lt;&#34;</span> <span style="color:#e6db74">&#34;:&gt;&#34;</span> <span style="color:#e6db74">&#34;&gt;:&#34;</span> <span style="color:#e6db74">&#34;&lt;&gt;&#34;</span> <span style="color:#e6db74">&#34;&lt;&lt;&lt;&#34;</span> <span style="color:#e6db74">&#34;&gt;&gt;&gt;&#34;</span>
@ -1680,6 +1705,7 @@
(global-ligature-mode <span style="color:#66d9ef">t</span>))
</code></pre></div><h4 id="icons">Icons</h4>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package all-the-icons
:if (display-graphic-p)
:straight <span style="color:#66d9ef">t</span>)
</code></pre></div><h4 id="highlight-todo">Highlight todo</h4>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package hl-todo
@ -1689,7 +1715,7 @@
<p>Highlight indent guides.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package highlight-indent-guides
:straight <span style="color:#66d9ef">t</span>
:if (not my/lowpower)
:if (not (or my/lowpower my/remote-server))
:hook (
(prog-mode <span style="color:#f92672">.</span> highlight-indent-guides-mode)
(vue-mode <span style="color:#f92672">.</span> highlight-indent-guides-mode)
@ -1781,7 +1807,7 @@
</table>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package all-the-icons-dired
:straight <span style="color:#66d9ef">t</span>
:if (not (or my/lowpower my/slow-ssh))
:if (not (or my/lowpower my/slow-ssh (not (display-graphic-p))))
:hook (dired-mode <span style="color:#f92672">.</span> (lambda ()
(unless (string-match-p <span style="color:#e6db74">&#34;/gnu/store&#34;</span> default-directory)
(all-the-icons-dired-mode))))
@ -1891,6 +1917,9 @@
(<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;\\(%s\\)\\|\\(%s\\)&#34;</span>
vc-ignore-dir-regexp
tramp-file-name-regexp))
</code></pre></div><p>Set the default shell to <code>bin/bash</code> for TRAMP or on a remote server.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(when (or my/remote-server my/slow-ssh)
(setq explicit-shell-file-name <span style="color:#e6db74">&#34;/bin/bash&#34;</span>))
</code></pre></div><p>Also, here is a hack to make TRAMP find <code>ls</code> on Guix:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(with-eval-after-load <span style="color:#e6db74">&#39;tramp</span>
(setq tramp-remote-path
@ -2002,6 +2031,7 @@
(<span style="color:#a6e22e">kill-buffer</span> (<span style="color:#a6e22e">current-buffer</span>))
(<span style="color:#a6e22e">select-window</span> vterm-window))
(vterm-other-window <span style="color:#e6db74">&#34;vterm-subterminal&#34;</span>))))
(unless my/slow-ssh
(general-nmap <span style="color:#e6db74">&#34;`&#34;</span> <span style="color:#e6db74">&#39;my/toggle-vterm-subteminal</span>)
(general-nmap <span style="color:#e6db74">&#34;~&#34;</span> <span style="color:#e6db74">&#39;vterm</span>))
@ -2091,6 +2121,7 @@
<p>Use the built-in org mode.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package org
:straight <span style="color:#66d9ef">t</span>
:if (not my/remote-server)
:defer <span style="color:#66d9ef">t</span>
:config
(setq org-startup-indented <span style="color:#66d9ef">t</span>)
@ -2349,7 +2380,7 @@
</ul>
<p>Used files</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq org-directory (<span style="color:#a6e22e">expand-file-name</span> <span style="color:#e6db74">&#34;~/Documents/org-mode&#34;</span>))
(setq org-agenda-files <span style="color:#f92672">&#39;</span>(<span style="color:#e6db74">&#34;inbox.org&#34;</span> <span style="color:#e6db74">&#34;projects.org&#34;</span> <span style="color:#e6db74">&#34;work.org&#34;</span>))
(setq org-agenda-files <span style="color:#f92672">&#39;</span>(<span style="color:#e6db74">&#34;inbox.org&#34;</span> <span style="color:#e6db74">&#34;projects.org&#34;</span> <span style="color:#e6db74">&#34;work.org&#34;</span> <span style="color:#e6db74">&#34;sem-11.org&#34;</span> <span style="color:#e6db74">&#34;life.org&#34;</span>))
<span style="color:#75715e">;; (setq org-default-notes-file (concat org-directory &#34;/notes.org&#34;))</span>
</code></pre></div><p>Hotkeys</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(my-leader-def
@ -2360,7 +2391,9 @@
</code></pre></div><p>Refile targets</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq org-refile-targets
<span style="color:#f92672">&#39;</span>((<span style="color:#e6db74">&#34;projects.org&#34;</span> :maxlevel <span style="color:#f92672">.</span> <span style="color:#ae81ff">2</span>)
(<span style="color:#e6db74">&#34;work.org&#34;</span> :maxlevel <span style="color:#f92672">.</span> <span style="color:#ae81ff">2</span>)))
(<span style="color:#e6db74">&#34;work.org&#34;</span> :maxlevel <span style="color:#f92672">.</span> <span style="color:#ae81ff">2</span>)
(<span style="color:#e6db74">&#34;sem-11.org&#34;</span> :maxlevel <span style="color:#f92672">.</span> <span style="color:#ae81ff">3</span>)
(<span style="color:#e6db74">&#34;life.org&#34;</span> :maxlevel <span style="color:#f92672">.</span> <span style="color:#ae81ff">2</span>)))
(setq org-refile-use-outline-path <span style="color:#e6db74">&#39;file</span>)
(setq org-outline-path-complete-in-steps <span style="color:#66d9ef">nil</span>)
</code></pre></div><h4 id="capture-templates-and-various-settings">Capture templates &amp; various settings</h4>
@ -2603,6 +2636,7 @@
<p><a href="https://github.com/bastibe/org-journal">org-journal</a> is a plugin for maintaining a journal in org mode. I want to have its entries separate from my knowledge base.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package org-journal
:straight <span style="color:#66d9ef">t</span>
:if (not my/remote-server)
:after org
:config
(setq org-journal-dir (<span style="color:#a6e22e">concat</span> org-directory <span style="color:#e6db74">&#34;/journal&#34;</span>))
@ -2671,7 +2705,8 @@
(use-package org-roam
:straight (:host github :repo <span style="color:#e6db74">&#34;org-roam/org-roam&#34;</span>
:files (:defaults <span style="color:#e6db74">&#34;extensions/*.el&#34;</span>))
:files (:defaults <span style="color:#e6db74">&#34;extensions/*.el&#34;</span>))
:if (not my/remote-server)
:after org
:init
(setq org-roam-directory (<span style="color:#a6e22e">concat</span> org-directory <span style="color:#e6db74">&#34;/roam&#34;</span>))
@ -2744,6 +2779,7 @@ MimeType=x-scheme-handler/org-protocol
<p>As of now, this package loads Helm on start. To avoid this, I have to exclude Helm from the <code>Package-requires</code> in the <a href=".emacs.d/straight/repos/org-ref/org-ref.el">org-ref.el</a> file. I haven&rsquo;t found a way to do this without modifying the package source yet.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package org-ref
:straight (:files (:defaults (:exclude <span style="color:#e6db74">&#34;*helm*&#34;</span>)))
:if (not my/remote-server)
:init
(setq org-ref-completion-library <span style="color:#e6db74">&#39;org-ref-ivy-cite</span>)
(setq bibtex-dialect <span style="color:#e6db74">&#39;biblatex</span>)
@ -2964,6 +3000,7 @@ MimeType=x-scheme-handler/org-protocol
(use-package org-present
:straight (:host github :repo <span style="color:#e6db74">&#34;rlister/org-present&#34;</span>)
:if (not my/remote-server)
:commands (org-present)
:config
(general-define-key
@ -2982,8 +3019,7 @@ MimeType=x-scheme-handler/org-protocol
(setq-local org-format-latex-options
(<span style="color:#a6e22e">plist-put</span> org-format-latex-options
:scale (<span style="color:#a6e22e">*</span> org-present-text-scale my/org-latex-scale <span style="color:#ae81ff">0.5</span>)))
(org-latex-preview <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">16</span>))
(tab-bar-mode <span style="color:#ae81ff">0</span>)))
(org-latex-preview <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">16</span>))))
(add-hook <span style="color:#e6db74">&#39;org-present-mode-quit-hook</span>
(lambda ()
(blink-cursor-mode <span style="color:#ae81ff">1</span>)
@ -2994,9 +3030,10 @@ MimeType=x-scheme-handler/org-protocol
(display-line-numbers-mode <span style="color:#ae81ff">1</span>)
(hide-mode-line-mode <span style="color:#ae81ff">0</span>)
(setq-local org-format-latex-options (<span style="color:#a6e22e">plist-put</span> org-format-latex-options :scale my/org-latex-scale))
(org-latex-preview <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">64</span>))
(tab-bar-mode <span style="color:#ae81ff">1</span>))))
</code></pre></div><h3 id="toc">TOC</h3>
(org-latex-preview <span style="color:#f92672">&#39;</span>(<span style="color:#ae81ff">64</span>)))))
</code></pre></div><h3 id="tools">Tools</h3>
<p>Various small packages.</p>
<h4 id="toc">TOC</h4>
<p>Make a TOC inside the org file.</p>
<p>References:</p>
<ul>
@ -3005,12 +3042,18 @@ MimeType=x-scheme-handler/org-protocol
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package org-make-toc
:after (org)
:if (not my/remote-server)
:commands
(org-make-toc
org-make-toc-insert
org-make-toc-set
org-make-toc-at-point)
:straight <span style="color:#66d9ef">t</span>)
</code></pre></div><h4 id="screenshots">Screenshots</h4>
<p>A nice package to make screenshots and insert them to the Org document.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package org-attach-screenshot
:commands (org-attach-screenshot)
:straight <span style="color:#66d9ef">t</span>)
</code></pre></div><h3 id="system-configuration">System configuration</h3>
<p>Functions used across my literate config files.</p>
<h4 id="tables-for-guix-dependencies">Tables for Guix Dependencies</h4>
@ -3149,7 +3192,7 @@ MimeType=x-scheme-handler/org-protocol
<h5 id="setup">Setup</h5>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package lsp-mode
:straight <span style="color:#66d9ef">t</span>
:if (not (or my/slow-ssh my/is-termux))
:if (not (or my/slow-ssh my/is-termux my/remote-server))
:hook (
(typescript-mode <span style="color:#f92672">.</span> lsp)
(vue-mode <span style="color:#f92672">.</span> lsp)
@ -3195,6 +3238,7 @@ MimeType=x-scheme-handler/org-protocol
<span style="color:#75715e">;; (add-hook &#39;lsp-after-open-hook #&#39;lsp-origami-try-enable))</span>
(use-package lsp-treemacs
:after (lsp)
:straight <span style="color:#66d9ef">t</span>
:commands lsp-treemacs-errors-list)
</code></pre></div><h5 id="keybindings">Keybindings</h5>
@ -3250,6 +3294,7 @@ MimeType=x-scheme-handler/org-protocol
(use-package tree-sitter
:straight <span style="color:#66d9ef">t</span>
:if (not my/remote-server)
:hook ((typescript-mode <span style="color:#f92672">.</span> my/tree-sitter-if-not-mmm)
(js-mode <span style="color:#f92672">.</span> my/tree-sitter-if-not-mmm)
(python-mode <span style="color:#f92672">.</span> tree-sitter-mode)
@ -3346,8 +3391,9 @@ MimeType=x-scheme-handler/org-protocol
:files (<span style="color:#e6db74">&#34;code-compass.el&#34;</span>)
:branch <span style="color:#e6db74">&#34;main&#34;</span>
))
</code></pre></div><h4 id="off--format-all"><span class="org-todo todo CHECK">CHECK</span> (OFF) Format-all</h4>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package format-all
</code></pre></div><h4 id="reformatter">Reformatter</h4>
<p>A general-purpose package to run formattters on files. While the most popular formatters are already packaged for Emacs, those that aren&rsquo;t can be invoked with this package.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package reformatter
:straight <span style="color:#66d9ef">t</span>)
</code></pre></div><h4 id="general-additional-config">General additional config</h4>
<p>Make smartparens behave the way I like for C-like languages.</p>
@ -3894,14 +3940,13 @@ MimeType=x-scheme-handler/org-protocol
<ul>
<li><a href="https://languagetool.org/">LanguageTool homepage</a></li>
<li><a href="https://dev.languagetool.org/http-server">LanguageTool http server</a></li>
<li><a href="https://github.com/mhayashi1120/Emacs-langtool">LanguageTool for Emacs repo</a></li>
</ul>
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package langtool
:straight <span style="color:#66d9ef">t</span>
:commands (langtool-check)
:config
(setq langtool-language-tool-server-jar <span style="color:#e6db74">&#34;/home/pavel/Programs/LanguageTool-5.1/languagetool-server.jar&#34;</span>)
(setq langtool-language-tool-server-jar <span style="color:#e6db74">&#34;/home/pavel/bin/LanguageTool-5.4/languagetool-server.jar&#34;</span>)
(setq langtool-mother-tongue <span style="color:#e6db74">&#34;ru&#34;</span>)
(setq langtool-default-language <span style="color:#e6db74">&#34;en-US&#34;</span>))
@ -4251,6 +4296,13 @@ MimeType=x-scheme-handler/org-protocol
(use-package lsp-haskell
:straight <span style="color:#66d9ef">t</span>
:after (lsp haskell-mode))
</code></pre></div><h3 id="lua">Lua</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package lua-mode
:straight <span style="color:#66d9ef">t</span>
:mode <span style="color:#e6db74">&#34;\\.lua\\&#39;&#34;</span>
:hook (lua-mode <span style="color:#f92672">.</span> smartparens-mode))
(my/set-smartparens-indent <span style="color:#e6db74">&#39;lua-mode</span>)
</code></pre></div><h3 id="json">JSON</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package json-mode
:straight <span style="color:#66d9ef">t</span>
@ -4259,6 +4311,28 @@ MimeType=x-scheme-handler/org-protocol
(add-hook <span style="color:#e6db74">&#39;json-mode</span> <span style="color:#a6e22e">#&#39;</span>smartparens-mode)
(add-hook <span style="color:#e6db74">&#39;json-mode</span> <span style="color:#a6e22e">#&#39;</span>hs-minor-mode)
(my/set-smartparens-indent <span style="color:#e6db74">&#39;json-mode</span>))
</code></pre></div><h3 id="sql">SQL</h3>
<p><a href="https://github.com/zeroturnaround/sql-formatter">sql-formatter</a> is a nice JavaScript package for pretty-printing SQL queries. It is not packaged for Emacs, so the easiest way to use it seems to be to define a custom formatter via <a href="https://github.com/purcell/emacs-reformatter">reformatter</a>.</p>
<p>Also, I&rsquo;ve a simple function to switch dialects because I often alternate between them.</p>
<p>So far I didn&rsquo;t find a nice SQL client for Emacs, but I occasionally run SQL queries in Org Mode, so this qute package is handy.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(setq my/sqlformatter-dialect-choice
<span style="color:#f92672">&#39;</span>(<span style="color:#e6db74">&#34;db2&#34;</span> <span style="color:#e6db74">&#34;mariadb&#34;</span> <span style="color:#e6db74">&#34;mysql&#34;</span> <span style="color:#e6db74">&#34;n1ql&#34;</span> <span style="color:#e6db74">&#34;plsql&#34;</span> <span style="color:#e6db74">&#34;postgresql&#34;</span> <span style="color:#e6db74">&#34;redshift&#34;</span> <span style="color:#e6db74">&#34;spark&#34;</span> <span style="color:#e6db74">&#34;sql&#34;</span> <span style="color:#e6db74">&#34;tsql&#34;</span>))
(setq my/sqlformatter-dialect <span style="color:#e6db74">&#34;postgresql&#34;</span>)
(defun my/sqlformatter-set-dialect ()
<span style="color:#e6db74">&#34;Set dialect for sql-formatter&#34;</span>
(interactive)
(setq my/sqlformatter-dialect
(<span style="color:#a6e22e">completing-read</span> <span style="color:#e6db74">&#34;Dialect: &#34;</span> my/sqlformatter-dialect-choice)))
(reformatter-define sqlformat
:program (executable-find <span style="color:#e6db74">&#34;sql-formatter&#34;</span>)
:args <span style="color:#f92672">`</span>(<span style="color:#e6db74">&#34;-l&#34;</span> <span style="color:#f92672">,</span>my/sqlformatter-dialect))
(my-leader-def
:keymaps <span style="color:#f92672">&#39;</span>(sql-mode-map)
<span style="color:#e6db74">&#34;rr&#34;</span> <span style="color:#a6e22e">#&#39;</span>sqlformat-buffer)
</code></pre></div><h3 id="yaml">YAML</h3>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package yaml-mode
:straight <span style="color:#66d9ef">t</span>
@ -4350,7 +4424,7 @@ MimeType=x-scheme-handler/org-protocol
</code></pre></div><h3 id="internet-and-multimedia">Internet &amp; Multimedia</h3>
<h4 id="notmuch">Notmuch</h4>
<p>My notmuch config now resides in <a href="/configs/mail/">Mail.org</a>.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(unless my/is-termux
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(unless (or my/is-termux my/remote-server)
(load-file (<span style="color:#a6e22e">expand-file-name</span> <span style="color:#e6db74">&#34;mail.el&#34;</span> user-emacs-directory)))
</code></pre></div><h4 id="elfeed">Elfeed</h4>
<p><a href="https://github.com/skeeto/elfeed">elfeed</a> is an Emacs RSS client.</p>
@ -4358,12 +4432,13 @@ MimeType=x-scheme-handler/org-protocol
<p>Using my own fork until the modifications are merged into master.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package elfeed
:straight (:repo <span style="color:#e6db74">&#34;SqrtMinusOne/elfeed&#34;</span> :host github)
:if (not my/remote-server)
:commands (elfeed)
:init
(my-leader-def <span style="color:#e6db74">&#34;ae&#34;</span> <span style="color:#e6db74">&#39;elfeed</span>)
:config
(setq elfeed-db-directory <span style="color:#e6db74">&#34;~/.elfeed&#34;</span>)
(setq elfeed-enclosure-default-dir (<span style="color:#a6e22e">expand-file-name</span> <span style="color:#e6db74">&#34;~&#34;</span>))
(setq elfeed-enclosure-default-dir (<span style="color:#a6e22e">expand-file-name</span> <span style="color:#e6db74">&#34;~/Downloads&#34;</span>))
(advice-add <span style="color:#a6e22e">#&#39;</span>elfeed-insert-html
:around
(lambda (fun <span style="color:#66d9ef">&amp;rest</span> r)
@ -4449,6 +4524,7 @@ MimeType=x-scheme-handler/org-protocol
<!--listend-->
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package emms
:straight <span style="color:#66d9ef">t</span>
:if (not my/remote-server)
:commands (emms-smart-browse
emms-browser
emms-add-url
@ -4477,11 +4553,11 @@ MimeType=x-scheme-handler/org-protocol
<span style="color:#75715e">;; MPV setup</span>
&lt;&lt;emms-mpv-setup&gt;&gt;
<span style="color:#75715e">;; evil-lion and evil-commentary shadow some gX bindings</span>
(add-hook <span style="color:#e6db74">&#39;emms-browser-mode-hook</span>
(lambda ()
(evil-lion-mode <span style="color:#ae81ff">-1</span>)
<span style="color:#75715e">;; (evil-commentary-mode -1)</span>
))
<span style="color:#75715e">;; (add-hook &#39;emms-browser-mode-hook</span>
<span style="color:#75715e">;; (lambda ()</span>
<span style="color:#75715e">;; (evil-lion-mode -1)</span>
<span style="color:#75715e">;; (evil-commentary-mode -1)</span>
<span style="color:#75715e">;; ))</span>
<span style="color:#75715e">;; I have everything I need in polybar</span>
(emms-mode-line-mode <span style="color:#ae81ff">-1</span>)
(emms-playing-time-display-mode <span style="color:#ae81ff">-1</span>)
@ -4521,7 +4597,7 @@ MimeType=x-scheme-handler/org-protocol
</tbody>
</table>
<p><a href="https://mpv.io/">mpv</a> is a decent media player, which has found a place in this configuration because it integrates with youtube-dl.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(add-to-list <span style="color:#e6db74">&#39;emms-player-list</span> <span style="color:#e6db74">&#39;emms-player-mpv</span>)
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(add-to-list <span style="color:#e6db74">&#39;emms-player-list</span> <span style="color:#e6db74">&#39;emms-player-mpv</span> <span style="color:#66d9ef">t</span>)
</code></pre></div><p>Also a custom regex. My demands for MPV include running <code>youtube-dl</code>, so there is a regex that matches youtube.com or some of the video formats.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(emms-player-set emms-player-mpv
<span style="color:#e6db74">&#39;regex</span>
@ -4549,7 +4625,7 @@ MimeType=x-scheme-handler/org-protocol
(my/set-emms-mpd-youtube-quality (<span style="color:#a6e22e">car</span> my/youtube-dl-quality-list))
</code></pre></div><p>Now <code>emms-add-url</code> should work on YouTube URLs just fine. Just keep in mind that it will only add the URL to the playlist, not play it right away.</p>
<h5 id="cache-cleanup">Cache cleanup</h5>
<p>All added URLs reside in the EMMS cache after being played. I don&rsquo;t want them to stay there for a long time, so here is a handy function to clean it.</p>
<p>All the added URLs reside in the EMMS cache after being played. I don&rsquo;t want them to stay there for a long time, so here is a handy function to clean it.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(defun my/emms-cleanup-urls ()
(interactive)
(let ((keys-to-delete <span style="color:#f92672">&#39;</span>()))
@ -4751,7 +4827,7 @@ tag2: value2&#39;
(shell-command-to-string (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;curl -L %s --output %s&#34;</span> tldr-source-zip-url tldr-saved-zip-path))
(when (<span style="color:#a6e22e">file-exists-p</span> <span style="color:#e6db74">&#34;/tmp/tldr&#34;</span>)
(delete-directory <span style="color:#e6db74">&#34;/tmp/tldr&#34;</span> <span style="color:#66d9ef">t</span>))
(shell-command-to-string (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;unzip -d /tmp/tldr/ %s&#34;</span> tldr-saved-zip-path) <span style="color:#66d9ef">nil</span> <span style="color:#66d9ef">nil</span>)
(shell-command-to-string (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;unzip -d /tmp/tldr/ %s&#34;</span> tldr-saved-zip-path))
(when (<span style="color:#a6e22e">file-exists-p</span> tldr-directory-path)
(delete-directory tldr-directory-path <span style="color:#e6db74">&#39;recursive</span> <span style="color:#e6db74">&#39;no-trash</span>))
(shell-command-to-string (<span style="color:#a6e22e">format</span> <span style="color:#e6db74">&#34;mv %s %s&#34;</span> <span style="color:#e6db74">&#34;/tmp/tldr/tldr-main&#34;</span> tldr-directory-path))))
@ -4783,6 +4859,7 @@ tag2: value2&#39;
</code></pre></div><h3 id="utilities">Utilities</h3>
<h4 id="pass">pass</h4>
<p>I use <a href="https://www.passwordstore.org/">pass</a> as my password manager. Expectedly, there is Emacs frontend for it.</p>
<p>Although I use <a href="https://github.com/carnager/rofi-pass">this rofi frontend</a> for actually inserting passwords.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package pass
:straight <span style="color:#66d9ef">t</span>
:commands (pass)
@ -4892,6 +4969,7 @@ tag2: value2&#39;
</table>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package screenshot
:straight (:repo <span style="color:#e6db74">&#34;tecosaur/screenshot&#34;</span> :host github :files (<span style="color:#e6db74">&#34;screenshot.el&#34;</span>))
:if (display-graphic-p)
:commands (screenshot)
:init
(my-leader-def <span style="color:#e6db74">&#34;S&#34;</span> <span style="color:#e6db74">&#39;screenshot</span>))
@ -4948,14 +5026,14 @@ tag2: value2&#39;
:if (and (or
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;indigo&#34;</span>)
(string= (<span style="color:#a6e22e">system-name</span>) <span style="color:#e6db74">&#34;eminence&#34;</span>))
(not my/slow-ssh))
(not my/slow-ssh)
(not my/remote-server))
:config
(elcord-mode)
(add-to-list <span style="color:#e6db74">&#39;elcord-boring-buffers-regexp-list</span>
(rx bos (<span style="color:#a6e22e">+</span> num) <span style="color:#e6db74">&#34;-&#34;</span> (<span style="color:#a6e22e">+</span> num) <span style="color:#e6db74">&#34;-&#34;</span> (<span style="color:#a6e22e">+</span> num) <span style="color:#e6db74">&#34;.org&#34;</span> eos))
(add-to-list <span style="color:#e6db74">&#39;elcord-boring-buffers-regexp-list</span>
(rx bos (<span style="color:#a6e22e">=</span> <span style="color:#ae81ff">14</span> num) <span style="color:#e6db74">&#34;-&#34;</span> (<span style="color:#a6e22e">*</span> not-newline) <span style="color:#e6db74">&#34;.org&#34;</span> eos))
)
(rx bos (<span style="color:#a6e22e">=</span> <span style="color:#ae81ff">14</span> num) <span style="color:#e6db74">&#34;-&#34;</span> (<span style="color:#a6e22e">*</span> not-newline) <span style="color:#e6db74">&#34;.org&#34;</span> eos)))
</code></pre></div><h4 id="snow">Snow</h4>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-emacs-lisp" data-lang="emacs-lisp">(use-package snow
:straight (:repo <span style="color:#e6db74">&#34;alphapapa/snow.el&#34;</span> :host github)

View file

@ -578,6 +578,10 @@ guix clone https://github.com/SqrtMinusOne/dotfiles.git
<td>system</td>
<td>openvpn-update-resolve-conf</td>
</tr>
<tr>
<td>system</td>
<td>vpnc</td>
</tr>
</tbody>
</table>
<p>I&rsquo;m not sure how to properly spin up VPN on Guix, so here is what I&rsquo;m doing now, after some trial and error.</p>
@ -657,7 +661,8 @@ nmcli connection up <span style="color:#e6db74">&#34;</span>$CONN<span style="co
<p>Third, by default it tries to create envronments in <code>/gnu/store</code>. I think it&rsquo;s enough to create one environment like this to fix it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-sh" data-lang="sh">mkdir -p ~/.conda/envs
conda create -p ~/.conda/envs/test
</code></pre></div><p>Finally, I also want to have an ability to use global npm. Some settings for that are located in <a href="Console">Console.org</a>. Here we want to unset <code>NPM_CONFIG_USERCONFIG</code> if there is npm available in the environment.</p>
</code></pre></div><p>Fourth, you may need to unset <code>$PYTHONPATH</code> if you have any global packages installed, otherwise Python from anaconda will try to import them instead of the conda versions.</p>
<p>Finally, I also want to have an ability to use global npm. Some settings for that are located in <a href="Console">Console.org</a>. Here we want to unset <code>NPM_CONFIG_USERCONFIG</code> if there is npm available in the environment.</p>
<p>So here is a script to set up conda hooks:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash"><span style="color:#75715e"># Get writable conda envs with npm &amp; without</span>
readarray -t CONDA_ENVS_ALL <span style="color:#f92672">&lt;&lt;&lt;</span> <span style="color:#66d9ef">$(</span>conda env list --json | jq <span style="color:#e6db74">&#39;.envs[]&#39;</span><span style="color:#66d9ef">)</span>

View file

@ -13,7 +13,7 @@
<guid>https://sqrtminusone.xyz/configs/console/</guid>
<description>#+TOC headlines 6
.profile Environment # export EDITOR=/usr/bin/vim # export BROWSER=/usr/bin/firefox export QT_QPA_PLATFORMTHEME=&amp;#34;qt5ct&amp;#34; export QT_AUTO_SCREEN_SCALE_FACTOR=0 export TZ=&amp;#34;Asia/Yekaterinburg&amp;#34; # export GTK2_RC_FILES=&amp;#34;$HOME/.gtkrc-2.0&amp;#34; My paths My script folders
.profile Environment # export EDITOR=/usr/bin/vim # export BROWSER=/usr/bin/firefox export QT_QPA_PLATFORMTHEME=&amp;#34;qt5ct&amp;#34; export QT_AUTO_SCREEN_SCALE_FACTOR=0 # export GTK2_RC_FILES=&amp;#34;$HOME/.gtkrc-2.0&amp;#34; My paths My script folders
if [ -d &amp;#34;$HOME/bin&amp;#34; ] ; then export PATH=&amp;#34;$HOME/bin:$PATH&amp;#34; export PATH=&amp;#34;$HOME/bin/scripts:$PATH&amp;#34; fi Guix settings Enable extra profiles
if [ -z &amp;#34;$IS_ANDROID&amp;#34; ]; then GUIX_EXTRA_PROFILES=$HOME/.guix-extra-profiles for i in $GUIX_EXTRA_PROFILES/*; do profile=$i/$(basename &amp;#34;$i&amp;#34;) if [ -f &amp;#34;$profile&amp;#34;/etc/profile ]; then GUIX_PROFILE=&amp;#34;$profile&amp;#34; . &amp;#34;$GUIX_PROFILE&amp;#34;/etc/profile fi export XDG_DATA_DIRS=&amp;#34;$XDG_DATA_DIRS:$profile/share&amp;#34; unset profile done fi Set Jupyter config PATH.</description>
</item>
@ -26,7 +26,7 @@ if [ -z &amp;#34;$IS_ANDROID&amp;#34; ]; then GUIX_EXTRA_PROFILES=$HOME/.guix-ex
<guid>https://sqrtminusone.xyz/configs/desktop/</guid>
<description>My general desktop environment configuration.
Parts prefixed with (OFF) are not used, but kept for historic purposes. For some reason GitHub&amp;rsquo;s org renderer ignores TODO status, hence such a prefix. Round brackets instead of square ones to prevent GitHub&amp;rsquo;s org renderer from screwing up.
Table of Contents Global customization Colors Xresources Colors in Xresources Fonts Themes Device-specific settings i3wm General settings Managing windows Workspaces Rules Scratchpad Launch script i3 config Gaps &amp;amp; borders Keybindings Move &amp;amp; resize windows OFF (OFF) Intergration with dmenu Integration with rofi Launching apps &amp;amp; misc keybindings Apps Media controls &amp;amp; brightness Screenshots Colors OFF (OFF) i3blocks Keyboard Layout Autostart Polybar Launching General settings Colors Bar config Modules ipstack-vpn weather aw-afk sun SEP TSEP i3 xkeyboard mpd pulseaudio cpu ram-memory swap-memory network date battery Rofi Theme Scripts Buku bookmarks Man pages Flameshot dunst keynav Config Using with picom Picom Shadows Fading Opacity General settings Zathura Various software Browsers Office LaTeX Dev Manifests Flatpak Nix Services Music GNU Mcron ActivityWatch PulseEffects xsettingsd Discord rich presence Polkit Authentication agent Xmodmap VPN Davmail Shepherd config Sync Guix settings Global customization Colors Most of the colors are from the Palenight theme.</description>
Table of Contents Global customization Colors Xresources Colors in Xresources Fonts Themes Device-specific settings i3wm General settings Managing windows Workspaces Rules Scratchpad Launch script i3 config Gaps &amp;amp; borders Keybindings Move &amp;amp; resize windows OFF (OFF) Intergration with dmenu Integration with rofi Launching apps &amp;amp; misc keybindings Apps Media controls &amp;amp; brightness Screenshots Colors OFF (OFF) i3blocks Keyboard Layout Autostart Polybar Launching General settings Colors Bar config Modules ipstack-vpn weather aw-afk sun SEP TSEP i3 xkeyboard mpd pulseaudio cpu ram-memory swap-memory network date battery Rofi Theme Scripts Buku bookmarks Man pages pass Flameshot dunst keynav Config Using with picom Picom Shadows Fading Opacity General settings Zathura Various software Browsers Office LaTeX Dev Manifests Flatpak Nix Services Music GNU Mcron ActivityWatch PulseEffects xsettingsd Discord rich presence Polkit Authentication agent Xmodmap VPN Davmail Shepherd config Sync Guix settings Global customization Colors Most of the colors are from the Palenight theme.</description>
</item>
<item>
@ -38,7 +38,7 @@ Parts prefixed with (OFF) are not used, but kept for historic purposes. For some
<description>One day we won&amp;rsquo;t hate one another, no young boy will march to war and I will clean up my Emacs config. But that day isn&amp;rsquo;t today.
My Emacs configuration.
As with other files in the repo, parts prefixed with (OFF) are not used but kept for historic purposes.
Table of Contents Primary setup Measure startup speed straight.el use-package Performance Garbage collection Run garbage collection when Emacs is unfocused Misc Native compilation Anaconda &amp;amp; environment Custom file location Private config No littering Global editing configuration General keybindings stuff general.</description>
Table of Contents Primary setup Measure startup speed straight.el use-package config variants &amp;amp; environment Performance Garbage collection Run garbage collection when Emacs is unfocused Native compilation Anaconda Custom file location Private config No littering Prevent Emacs from closing Global editing configuration General keybindings stuff general.</description>
</item>
<item>

View file

@ -65,7 +65,7 @@
<p>A set of my GNU/Linux configuration files. <a href="https://github.com/SqrtMinusOne/dotfiles">View at GitHub</a>.</p>
<p>The majority of the software is configured with <a href="https://leanpub.com/lit-config/read">literate configuration</a> strategy via Emacs' Org Mode. This way has its advantages and disadvantages, but overall it&rsquo;s pretty nice to keep the configs interweaved with comments in a handful of files.</p>
<p>The files themselves are managed and deployed via <a href="https://yadm.io/">yadm</a>, but I mostly use Org Mode rich noweb whenever I can instead of what yadm offers.</p>
<p>My current GNU/Linux distribution is <a href="https://guix.gnu.org/">GNU Guix</a>. In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for the tables with &ldquo;Guix dependency&rdquo; in the header.</p>
<p>My current GNU/Linux distribution is <a href="https://guix.gnu.org/">GNU Guix</a>. In the context of this repo, Guix allows me to list all the used programs in manifests, which means I have the same set of programs across multiple machines. Look for tables with &ldquo;Guix dependency&rdquo; in the header.</p>
<p>Literate configuration files:</p>
<ul>
<li><a href="/configs/emacs/">Emacs.org</a></li>