This commit is contained in:
SqrtMinusOne 2023-03-14 09:33:29 +00:00
parent ed1e95edd3
commit fdd151325c
8 changed files with 30 additions and 30 deletions

View file

@ -215,11 +215,11 @@
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#666">[[</span> -f ~/.bashrc <span style="color:#666">]]</span> <span style="color:#666">&amp;&amp;</span> . ~/.bashrc
</span></span></code></pre></div><h3 id="dot-bashrc"><code>.bashrc</code></h3>
<p>My <code>.bashrc</code>, which has pieces from the default ones in Guix &amp; Manjaro, as well some mine settings.</p>
<p>My <code>.bashrc</code>, which has pieces from the default one in Guix &amp; Manjaro, as well some mine settings.</p>
<h4 id="startup-and-environment">Startup &amp; environment</h4>
<p>Export &lsquo;SHELL&rsquo; to child processes. Programs such as &lsquo;screen&rsquo; honor it and otherwise use /bin/sh.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#008000">export</span> SHELL
</span></span></code></pre></div><p>We are being invoked from a non-interactive shell. If this is an SSH session (as in &ldquo;ssh host command&rdquo;), source /etc/profile so we get PATH and other essential variables.</p>
</span></span></code></pre></div><p>We are being invoked from a non-interactive shell. If this is an SSH session (as in &ldquo;ssh host command&rdquo;), source /etc/profile, so we get PATH and other essential variables.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold">if</span> <span style="color:#666">[[</span> <span style="color:#19177c">$-</span> !<span style="color:#666">=</span> *i* <span style="color:#666">]]</span>
</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span> <span style="color:#666">[[</span> -n <span style="color:#ba2121">&#34;</span><span style="color:#19177c">$SSH_CLIENT</span><span style="color:#ba2121">&#34;</span> <span style="color:#666">&amp;&amp;</span> -f <span style="color:#ba2121">&#34;/etc/bashrc&#34;</span> <span style="color:#666">]]</span> <span style="color:#666">&amp;&amp;</span> <span style="color:#008000">source</span> /etc/profile
@ -437,7 +437,7 @@
</span></span><span style="display:flex;"><span> <span style="color:#00f">conda</span> activate <span style="color:#19177c">$EMACS_CONDA_ENV</span>
</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold">end</span>
</span></span></code></pre></div><h3 id="colors-1">Colors</h3>
<p>Fish seems to have hardcoded colorcodes in some color settings. I set these to base16 colors so they would match Xresources.</p>
<p>Fish seems to have hardcoded colorcodes in some color settings. I set these to base16 colors, so they would match Xresources.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-fish" data-lang="fish"><span style="display:flex;"><span><span style="color:#008000;font-weight:bold">set</span> <span style="color:#19177c">fish_color_command</span> cyan
</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold">set</span> <span style="color:#19177c">fish_color_comment</span> green
</span></span><span style="display:flex;"><span><span style="color:#008000;font-weight:bold">set</span> <span style="color:#19177c">fish_color_end</span> white
@ -588,7 +588,7 @@
<p><a href="https://github.com/tmux/tmux">tmux</a> is my terminal multiplexer of choice.</p>
<p>It provides pretty sane defaults, so the config is not too large. I rebind the prefix to <code>C-a</code> though.</p>
<h3 id="term-settings">Term settings</h3>
<p>I have no idea how and why these two work.</p>
<p>I have no idea how and why these statements work.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-vim" data-lang="vim"><span style="display:flex;"><span>set -g default-terminal <span style="color:#ba2121">&#34;screen-256color&#34;</span><span style="">
</span></span></span><span style="display:flex;"><span><span style=""></span>set -ga terminal-overrides <span style="color:#ba2121">&#34;,*256col*:Tc&#34;</span><span style="">
</span></span></span></code></pre></div><p>History limit.</p>
@ -630,7 +630,7 @@
</tr>
</tbody>
</table>
<p>Make tmux copying copy to clipboard as well</p>
<p>Make tmux copy to clipboard as well</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-vim" data-lang="vim"><span style="display:flex;"><span>bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel <span style="color:#ba2121">&#34;xclip -selection clipboard -i&#34;</span><span style="">
</span></span></span><span style="display:flex;"><span><span style=""></span>bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel <span style="color:#ba2121">&#34;xclip -selection clipboard -i&#34;</span><span style="">
</span></span></span></code></pre></div><h3 id="ui">UI</h3>
@ -671,7 +671,7 @@
</tr>
</tbody>
</table>
<p><a href="https://github.com/alacritty/alacritty">Alacritty</a> is a GPU-accelerated terminal emulator. I haven&rsquo;t found it to be an inch faster than st, but configuration the in yml format is way more convinient than patches.</p>
<p><a href="https://github.com/alacritty/alacritty">Alacritty</a> is a GPU-accelerated terminal emulator. I haven&rsquo;t found it to be an inch faster than st, but configuration the in yml format is way more convenient than patches.</p>
<p>Once again, we have an application which doesn&rsquo;t support reading Xresources, so here goes noweb.</p>
<p><a id="code-snippet--get-xrdb"></a></p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>xrdb -query all | grep <span style="color:#ba2121">&#34;</span><span style="color:#19177c">$color</span><span style="color:#ba2121">:&#34;</span> | cut -f <span style="color:#666">2</span>
@ -843,9 +843,9 @@
<h3 id="ripgrep-config">ripgrep config</h3>
<p>Occasionally I can&rsquo;t exclude certain files from ripgrep via the VCS settings, so here is a simple config to ignore certain files globally.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>--ignore-file=/home/pavel/.config/ripgrep/ripgrepignore
</span></span></code></pre></div><p>The corresponding ignore file:</p>
</span></span></code></pre></div><p>The ignore file:</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>*.ts.snap
</span></span></code></pre></div><p>By default ripgrep doesn&rsquo;t read any configs, so it is necessary to set the <code>RIPGREP_CONFIG_PATH</code> variable in the <a href="#environment-1">.profile.</a></p>
</span></span></code></pre></div><p>By default, ripgrep doesn&rsquo;t read any configs, so it is necessary to set the <code>RIPGREP_CONFIG_PATH</code> variable in the <a href="#environment-1">.profile.</a></p>
<h2 id="misc-scripts">Misc scripts</h2>
<h3 id="nt-exec-command-with-a-finished-notification"><code>nt</code> - exec command with a finished notification</h3>
<p>Usage:</p>
@ -886,8 +886,8 @@
<li>If there is a merge conflict, notify</li>
<li>If there are changed files in the last <code>TIMEOUT_MIN</code> minutes, commit</li>
<li>Fetch</li>
<li>If there are were changes in the last <code>TTMEOUT_MIN</code>, merge (usually the merge has to be fast-forward)</li>
<li>If fetch was successful &amp; merge was successful or delayed because of changes in the last <code>TIMEOUT_MIN</code>, push</li>
<li>If there are were changes in the last <code>TTMEOUT_MIN</code>, merge (usually the merge has to be fast-forwarded)</li>
<li>If the fetch was successful &amp; the merge was either successful or delayed because of changes in the last <code>TIMEOUT_MIN</code>, push</li>
<li>Send a notification about the events above</li>
<li>Send a separate notification if there is a merge conflict</li>
</ul>

View file

@ -83,10 +83,10 @@
<p>At the moment of this writing, this &ldquo;almost anything&rdquo; includes:</p>
<ul>
<li><strong>Writing code</strong>. With LSP &amp; Co Emacs is as good as many IDEs, and is certainly on par with editors like VS Code.<br />
Emacs is also particularly good at writing Lisp code, e.g. Clojure, Common Lisp, and, of course, Emacs Lisp.</li>
Emacs is also particularly great at writing Lisp code, e.g. Clojure, Common Lisp, and, of course, Emacs Lisp.</li>
<li><strong>Literate programming</strong> with Org Mode. That includes:
<ul>
<li>Configuring the entirety of my software (that can be configured with text files).</li>
<li>Configuring the entirety of my software, that can be configured with text files.</li>
<li>Interactive programming like one provided by Jupyter Notebook.</li>
</ul>
</li>
@ -97,11 +97,11 @@ Emacs is also particularly good at writing Lisp code, e.g. Clojure, Common Lisp,
<li><strong>Task management</strong>, with Org Mode.</li>
<li><strong>Managing passwords</strong>, with pass.</li>
<li><strong>IRC</strong>, with ERC.</li>
<li><strong>Formatting documents</strong>, also with Org Mode. When the document is too complex, I prefer to write plain LaTeX, but I&rsquo;ve come to the conclusion that in most cases Org Mode covers my needs there.</li>
<li><strong>X Window management</strong>, with EXWM. So I could say I literally live in Emacs.</li>
<li><strong>Formatting documents</strong>, also with Org Mode. I&rsquo;ve written my Master&rsquo;s Thesis in Org Mode.</li>
<li><strong>X Window management</strong>, with EXWM. I literally live in Emacs.</li>
<li>&hellip;</li>
</ul>
<p>As I have hinted above, this file is a piece of literate configuration, where the actual code is interweaved with English-language commentary. One could argue that the commentary, and not the code, is the primary entity of the file.</p>
<p>As I have hinted above, this file is a piece of literate configuration, where the actual code is interweaved with (occasionally semi-broken) English-language commentary. One could argue that the commentary, and not the code, is the primary citizen of the file.</p>
<p>But at the same time, the configuration is personal, so the primary benefactor of the literate structure is me. The commentary is primarily meant to capture my state of mind at the moment of writing the code, which is immensely helpful for maintaining the code in the future. So the quality and quantity of the commentary are&hellip; varying.</p>
<p>Occasionally I save some promising experimentations from scratch buffers without much comment. Or I may not have enough time to describe things in substantial detail. Or, as it is at the moment when I&rsquo;m writing this, I have the time to write down whatever I consider necessary. Plus I usually incorporate my blog posts back into the config.</p>
<p>Of course, human minds share many similarities, so if you are an avid Emacs user, you have a chance to extract something of value from this document.</p>
@ -1636,7 +1636,7 @@ Emacs is also particularly good at writing Lisp code, e.g. Clojure, Common Lisp,
<h2 id="programming">Programming</h2>
<h3 id="general-setup">General setup</h3>
<h4 id="treemacs">Treemacs</h4>
<p><a href="https://github.com/Alexander-Miller/treemacs">Treemacs</a> is a quite large &amp; powerful package, but as of now I&rsquo;ve replaced it with dired. I still have a small configuration because lsp-mode and dap-mode depend on it.</p>
<p><a href="https://github.com/Alexander-Miller/treemacs">Treemacs</a> is a rather large &amp; powerful package, but as of now I&rsquo;ve replaced it with dired. I still have a small configuration because lsp-mode and dap-mode depend on it.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">use-package</span> <span style="color:#19177c">treemacs</span>
</span></span><span style="display:flex;"><span> <span style="color:#008000">:straight</span> <span style="color:#800">t</span>
</span></span><span style="display:flex;"><span> <span style="color:#008000">:defer</span> <span style="color:#800">t</span>
@ -1789,7 +1789,7 @@ Emacs is also particularly good at writing Lisp code, e.g. Clojure, Common Lisp,
</span></span><span style="display:flex;"><span> <span style="color:#008000">:after</span> <span style="color:#19177c">tree-sitter</span>)
</span></span></code></pre></div><h4 id="dap">DAP</h4>
<p>An Emacs client for Debugger Adapter Protocol.</p>
<p>As of the time of this writing, I mostly debug TypeScript, so the main competitor is Chrome Inspector for node.js.</p>
<p>Okay, so, I tried to use it many times&hellip; Chrome DevTools and ipdb / pudb are just better for me. Maybe I&rsquo;ll check out RealGUD instead&hellip; Will see.</p>
<p>References:</p>
<ul>
<li><a href="https://emacs-lsp.github.io/dap-mode/">dap-mode homepage</a></li>
@ -3640,6 +3640,14 @@ Emacs is also particularly good at writing Lisp code, e.g. Clojure, Common Lisp,
</span></span><span style="display:flex;"><span> <span style="color:#ba2121">&#34;C-c t a&#34;</span> <span style="color:#00f">#&#39;</span><span style="color:#19177c">org-transclusion-add</span>
</span></span><span style="display:flex;"><span> <span style="color:#ba2121">&#34;C-c t A&#34;</span> <span style="color:#00f">#&#39;</span><span style="color:#19177c">org-transclusion-add-all</span>
</span></span><span style="display:flex;"><span> <span style="color:#ba2121">&#34;C-c t t&#34;</span> <span style="color:#00f">#&#39;</span><span style="color:#19177c">org-transclusion-mode</span>))
</span></span></code></pre></div><h4 id="drawing">Drawing</h4>
<p>This package is unbelievably good. I would have never thought it&rsquo;s even possible to have this in Emacs.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">use-package</span> <span style="color:#19177c">edraw-org</span>
</span></span><span style="display:flex;"><span> <span style="color:#008000">:straight</span> (<span style="color:#008000">:host</span> <span style="color:#19177c">github</span> <span style="color:#008000">:repo</span> <span style="color:#ba2121">&#34;misohena/el-easydraw&#34;</span>)
</span></span><span style="display:flex;"><span> <span style="color:#008000">:if</span> (<span style="color:#008000">and</span> (<span style="color:#19177c">not</span> <span style="color:#19177c">my/is-termux</span>) (<span style="color:#19177c">not</span> <span style="color:#19177c">my/remote-server</span>))
</span></span><span style="display:flex;"><span> <span style="color:#008000">:after</span> (<span style="color:#19177c">org</span>)
</span></span><span style="display:flex;"><span> <span style="color:#008000">:config</span>
</span></span><span style="display:flex;"><span> (<span style="color:#19177c">edraw-org-setup-default</span>))
</span></span></code></pre></div><h4 id="managing-tables">Managing tables</h4>
<p>I use Org to manage some small tables which I want to process further. So here is a function that saves each table to a CSV file.</p>
<div class="highlight"><pre tabindex="0" style=";-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-emacs-lisp" data-lang="emacs-lisp"><span style="display:flex;"><span>(<span style="color:#008000">defun</span> <span style="color:#19177c">my/export-org-tables-to-csv</span> ()
@ -7944,6 +7952,7 @@ I&rsquo;ve seen a couple of cases where people would swap their username and ema
<li><a href="#toc">TOC</a></li>
<li><a href="#screenshots">Screenshots</a></li>
<li><a href="#transclusion">Transclusion</a></li>
<li><a href="#drawing">Drawing</a></li>
<li><a href="#managing-tables">Managing tables</a></li>
</ul>
</li>

View file

@ -76,7 +76,7 @@ My problem with any particular mail setup was that I use Gmail labels quite exte
<guid>https://sqrtminusone.xyz/configs/readme/</guid>
<description>These are my GNU/Linux configuration files. View at GitHub.
I use the literate configuration strategy via Emacs&amp;rsquo; Org Mode wherever possible. It has its pros and cons, but I find it pretty nice to keep the configs interweaved with comments in a handful of files
I use the literate configuration strategy via Emacs&amp;rsquo; Org Mode wherever possible. It has its pros and cons, but I find it pretty nice to keep the configs interweaved with comments in a handful of files.
The files themselves are managed and deployed via yadm, although I use Org Mode for things like config templating.
My current GNU/Linux distribution is GNU Guix.</description>
</item>

View file

@ -76,7 +76,7 @@
</figure>
<p>These are my GNU/Linux configuration files. <a href="https://github.com/SqrtMinusOne/dotfiles">View at GitHub</a>.</p>
<p>I use the <a href="https://leanpub.com/lit-config/read">literate configuration</a> strategy via Emacs&rsquo; <a href="https://orgmode.org/">Org Mode</a> wherever possible. It has its pros and cons, but I find it pretty nice to keep the configs interweaved with comments in a handful of files</p>
<p>I use the <a href="https://leanpub.com/lit-config/read">literate configuration</a> strategy via Emacs&rsquo; <a href="https://orgmode.org/">Org Mode</a> wherever possible. It has its pros and cons, but I find it 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>, although I use Org Mode for things like config templating.</p>
<p>My current GNU/Linux distribution is <a href="https://guix.gnu.org/">GNU Guix</a>. I like Guix because, among other things, it allows <a href="https://guix.gnu.org/cookbook/en/html_node/Advanced-package-management.html#Advanced-package-management">to declare the required software</a> in configuration files, so I can have the same set of programs across multiple machines (look for tables with &ldquo;Guix dependency&rdquo; in the header).</p>
<p>The central program to all of that is, of course, <a href="https://www.gnu.org/software/emacs/">GNU Emacs</a>. At the time of this writing, it takes ~50% of my screen time and has the largest share of configuration here.</p>
@ -124,16 +124,7 @@
</ul>
</li>
</ul>
<p>Posts about my configuration:</p>
<ul>
<li><a href="https://sqrtminusone.xyz/posts/2022-05-09-pdf/">Extending elfeed with PDF viewer and subtitles fetcher</a></li>
<li><a href="https://sqrtminusone.xyz/posts/2022-02-12-literate/">A few cases of literate configuration</a></li>
<li><a href="https://sqrtminusone.xyz/posts/2022-01-03-exwm/">Using EXWM and perspective.el on a multi-monitor setup</a></li>
<li><a href="https://sqrtminusone.xyz/posts/2021-10-04-emacs-i3/">Getting a consistent set of keybindings between i3 and Emacs</a></li>
<li><a href="https://sqrtminusone.xyz/posts/2021-09-07-emms/">My EMMS and elfeed setup</a></li>
<li><a href="https://sqrtminusone.xyz/posts/2021-05-01-org-python/">Replacing Jupyter Notebook with Org Mode</a></li>
<li><a href="https://sqrtminusone.xyz/posts/2021-02-27-gmail/">Multiple Gmail accounts &amp; labels with Emacs</a></li>
</ul>
<p>See also <a href="https://sqrtminusone.xyz/posts/">my blog posts</a>.</p>
<h2 id="some-statistics">Some statistics</h2>
<figure><img src="https://sqrtminusone.xyz/stats/all.png"/>
</figure>

View file

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang=""><head>
<meta name="generator" content="Hugo 0.111.2">
<meta name="generator" content="Hugo 0.111.3">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB