<pre><span></span><span class="c1">;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-</span>

<span class="c1">;; Place your private configuration here! Remember, you do not need to run &#39;doom</span>
<span class="c1">;; sync&#39; after modifying this file!</span>



<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">doom-theme</span><span class="w"> </span><span class="ss">&#39;doom-tokyo-night</span><span class="p">)</span>


<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">display-line-numbers-type</span><span class="w"> </span><span class="no">t</span><span class="p">)</span>


<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">org-directory</span><span class="w"> </span><span class="s">&quot;~/org/&quot;</span><span class="p">)</span>

<span class="c1">;; Corfu</span>


<span class="p">(</span><span class="nv">corfu-echo-mode</span><span class="w"> </span><span class="mi">+1</span><span class="p">)</span>
<span class="p">(</span><span class="nv">corfu-history-mode</span><span class="w"> </span><span class="mi">+1</span><span class="p">)</span>

<span class="p">(</span><span class="nv">add-to-list</span><span class="w"> </span><span class="ss">&#39;corfu-margin-formatters</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">nerd-icons-corfu-formatter</span><span class="p">)</span>

<span class="c1">;; (add-hook &#39;corfu-mode-hook #&#39;corfu-doc-mode)</span>
<span class="c1">;; Optionally:</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">nerd-icons-corfu-mapping</span>
<span class="w">      </span><span class="o">&#39;</span><span class="p">((</span><span class="nv">array</span><span class="w"> </span><span class="nb">:style</span><span class="w"> </span><span class="s">&quot;cod&quot;</span><span class="w"> </span><span class="nb">:icon</span><span class="w"> </span><span class="s">&quot;symbol_array&quot;</span><span class="w"> </span><span class="nb">:face</span><span class="w"> </span><span class="nv">font-lock-type-face</span><span class="p">)</span>
<span class="w">        </span><span class="p">(</span><span class="nv">boolean</span><span class="w"> </span><span class="nb">:style</span><span class="w"> </span><span class="s">&quot;cod&quot;</span><span class="w"> </span><span class="nb">:icon</span><span class="w"> </span><span class="s">&quot;symbol_boolean&quot;</span><span class="w"> </span><span class="nb">:face</span><span class="w"> </span><span class="nv">font-lock-builtin-face</span><span class="p">)</span>
<span class="w">        </span><span class="c1">;; ...</span>
<span class="w">        </span><span class="p">(</span><span class="no">t</span><span class="w"> </span><span class="nb">:style</span><span class="w"> </span><span class="s">&quot;cod&quot;</span><span class="w"> </span><span class="nb">:icon</span><span class="w"> </span><span class="s">&quot;code&quot;</span><span class="w"> </span><span class="nb">:face</span><span class="w"> </span><span class="nv">font-lock-warning-face</span><span class="p">)))</span>
<span class="w">        </span><span class="c1">;; Remember to add an entry for `t&#39;, the library uses that as default.</span>

<span class="c1">;; The Custom interface is also supported for tuning the variable above.</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">kill-whole-line</span><span class="w"> </span><span class="no">t</span><span class="p">)</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nf">user-full-name</span><span class="w"> </span><span class="s">&quot;Seb REDACATED&quot;</span><span class="w">    </span><span class="c1">;Really hope I remember to like,</span>
<span class="w">                                        </span><span class="c1">;update these when I copy this into my setup lmao</span>
<span class="w">      </span><span class="nv">user-mail-address</span><span class="w"> </span><span class="s">&quot;niceTry@sucker.thisisntaTLD&quot;</span><span class="p">)</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">auto-save-default</span><span class="w"> </span><span class="no">t</span>
<span class="w">      </span><span class="nv">make-backup-files</span><span class="w"> </span><span class="no">t</span><span class="p">)</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">confirm-kill-emacs</span><span class="w"> </span><span class="no">nil</span><span class="p">)</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">doom-font</span><span class="w"> </span><span class="p">(</span><span class="nf">font-spec</span><span class="w"> </span><span class="nb">:family</span><span class="w"> </span><span class="s">&quot;CodeNewRoman Nerd Font Mono&quot;</span><span class="w"> </span><span class="nb">:size</span><span class="w"> </span><span class="mi">14</span><span class="p">)</span>
<span class="w">      </span><span class="nv">doom-variable-pitch-font</span><span class="w"> </span><span class="p">(</span><span class="nf">font-spec</span><span class="w"> </span><span class="nb">:family</span><span class="w"> </span><span class="s">&quot;CodeNewRoman Nerd Font Mono&quot;</span><span class="w"> </span><span class="nb">:size</span><span class="w"> </span><span class="mi">14</span><span class="p">))</span>
<span class="p">(</span><span class="nv">custom-set-faces!</span>
<span class="w">  </span><span class="o">&#39;</span><span class="p">(</span><span class="nv">doom-dashboard-banner</span><span class="w"> </span><span class="nb">:inherit</span><span class="w"> </span><span class="nv">default</span><span class="p">)</span>
<span class="w">  </span><span class="o">&#39;</span><span class="p">(</span><span class="nv">doom-dashboard-loaded</span><span class="w"> </span><span class="nb">:inherit</span><span class="w"> </span><span class="nv">default</span><span class="p">))</span>


<span class="p">(</span><span class="nv">use-package!</span><span class="w"> </span><span class="nv">visual-regexp-steroids</span>
<span class="w">  </span><span class="nb">:defer</span><span class="w"> </span><span class="mi">3</span>
<span class="w">  </span><span class="nb">:config</span>
<span class="w">  </span><span class="c1">;; (require &#39;pcre2el)</span>
<span class="w">  </span><span class="c1">;; (setq vr/engine &#39;pcre2el)</span>
<span class="w">  </span><span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;C-c s r&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">vr/replace</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;C-c s q&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">vr/query-replace</span><span class="p">))</span>

<span class="p">(</span><span class="nv">after!</span><span class="w"> </span><span class="nv">undo-fu</span>
<span class="w">  </span><span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="nb">:map</span><span class="w"> </span><span class="nv">undo-fu-mode-map</span><span class="w"> </span><span class="s">&quot;M-/&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">undo-fu-only-redo</span><span class="p">))</span>

<span class="p">(</span><span class="nv">after!</span><span class="w"> </span><span class="nv">treemacs</span>
<span class="w">  </span><span class="p">(</span><span class="nv">treemacs-follow-mode</span><span class="w"> </span><span class="mi">1</span><span class="p">))</span>
<span class="p">(</span><span class="nb">unless</span><span class="w"> </span><span class="nf">window-system</span>
<span class="w">  </span><span class="p">(</span><span class="nv">xterm-mouse-mode</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;&lt;mouse-4&gt;&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;scroll-down-line</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;&lt;mouse-5&gt;&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;scroll-up-line</span><span class="p">))</span>
<span class="c1">;; (global-clipetty-mode)</span>
<span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;C-s&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">+default/search-buffer</span>
<span class="w">      </span><span class="s">&quot;C-t&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">eshell-toggle</span>
<span class="w">      </span><span class="p">)</span>

<span class="c1">;; (map! &quot;C-&lt;tab&gt;&quot; #&#39;format/region</span>
<span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;&lt;backtab&gt;&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">indent-rigidly-left-to-tab-stop</span>
<span class="w">      </span><span class="p">)</span>

<span class="p">(</span><span class="nv">use-package!</span><span class="w"> </span><span class="nv">eshell-follow</span>
<span class="w">  </span><span class="nb">:after-call</span><span class="w"> </span><span class="nv">eshell-follow-global-mode</span><span class="p">)</span>


<span class="p">(</span><span class="nb">defadvice</span><span class="w"> </span><span class="nv">kill-ring-save</span><span class="w"> </span><span class="p">(</span><span class="nv">before</span><span class="w"> </span><span class="nv">slick-copy</span><span class="w"> </span><span class="nv">activate</span><span class="w"> </span><span class="nv">compile</span><span class="p">)</span>
<span class="w">  </span><span class="s">&quot;When called interactively with no active region, copy a single line instead.&quot;</span>
<span class="w">  </span><span class="p">(</span><span class="k">interactive</span>
<span class="w">   </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="nv">mark-active</span>
<span class="w">       </span><span class="p">(</span><span class="nf">list</span><span class="w"> </span><span class="p">(</span><span class="nf">region-beginning</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nf">region-end</span><span class="p">))</span>
<span class="w">     </span><span class="p">(</span><span class="nf">message</span><span class="w"> </span><span class="s">&quot;Copied line&quot;</span><span class="p">)</span>
<span class="w">     </span><span class="p">(</span><span class="nf">list</span><span class="w"> </span><span class="p">(</span><span class="nf">line-beginning-position</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nf">line-beginning-position</span><span class="w"> </span><span class="mi">2</span><span class="p">)))))</span>

<span class="p">(</span><span class="nb">defadvice</span><span class="w"> </span><span class="nv">kill-ring-save</span><span class="w"> </span><span class="p">(</span><span class="nv">after</span><span class="w"> </span><span class="nv">keep-transient-mark-active</span><span class="w"> </span><span class="p">())</span><span class="w"> </span><span class="c1">;</span>
<span class="w">  </span><span class="s">&quot;Override the deactivation of the mark.&quot;</span>
<span class="w">  </span><span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">deactivate-mark</span><span class="w"> </span><span class="no">nil</span><span class="p">))</span>
<span class="p">(</span><span class="nv">ad-activate</span><span class="w"> </span><span class="ss">&#39;kill-ring-save</span><span class="p">)</span>

<span class="p">(</span><span class="nb">defun</span><span class="w"> </span><span class="nv">mark-unmark-toggle</span><span class="p">()</span><span class="w">             </span><span class="c1">;does what it says on the box ~~fuck this took me way too long lmao~~</span>
<span class="w">  </span><span class="p">(</span><span class="k">interactive</span>
<span class="w">   </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="nv">mark-active</span>
<span class="w">       </span><span class="p">(</span><span class="nv">deactivate-mark</span><span class="p">)</span>
<span class="w">     </span><span class="p">(</span><span class="nv">push-mark</span><span class="w"> </span><span class="no">nil</span><span class="w"> </span><span class="no">nil</span><span class="w"> </span><span class="no">t</span><span class="p">))))</span>

<span class="p">(</span><span class="nb">defadvice</span><span class="w"> </span><span class="nv">backward-kill-word</span><span class="w"> </span><span class="p">(</span><span class="nv">around</span><span class="w"> </span><span class="nv">delete-pair</span><span class="w"> </span><span class="nv">activate</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nf">eq</span><span class="w"> </span><span class="p">(</span><span class="nf">char-syntax</span><span class="w"> </span><span class="p">(</span><span class="nf">char-before</span><span class="p">))</span><span class="w"> </span><span class="sc">?\(</span><span class="p">)</span>
<span class="w">      </span><span class="p">(</span><span class="k">progn</span>
<span class="w">    </span><span class="p">(</span><span class="nf">backward-char</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="k">save-excursion</span>
<span class="w">      </span><span class="p">(</span><span class="nv">forward-sexp</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span>
<span class="w">      </span><span class="p">(</span><span class="nf">delete-char</span><span class="w"> </span><span class="mi">-1</span><span class="p">))</span>
<span class="w">    </span><span class="p">(</span><span class="nf">forward-char</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="nv">append-next-kill</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="nv">kill-backward-chars</span><span class="w"> </span><span class="mi">1</span><span class="p">))</span>
<span class="w">    </span><span class="nv">ad-do-it</span><span class="p">))</span>

<span class="p">(</span><span class="nb">defun</span><span class="w"> </span><span class="nv">acg/with-mark-active</span><span class="w"> </span><span class="p">(</span><span class="kp">&amp;rest</span><span class="w"> </span><span class="nv">args</span><span class="p">)</span>
<span class="w">  </span><span class="s">&quot;Keep mark active after command. To be used as advice AFTER any</span>
<span class="s">function that sets </span><span class="ss">`deactivate-mark&#39;</span><span class="s"> to t.&quot;</span>
<span class="w">  </span><span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">deactivate-mark</span><span class="w"> </span><span class="no">nil</span><span class="p">))</span>

<span class="p">(</span><span class="nv">advice-add</span><span class="w"> </span><span class="ss">&#39;comment-or-uncomment-region</span><span class="w"> </span><span class="nb">:after</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">acg/with-mark-active</span><span class="p">)</span>

<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">cd2/region-command</span><span class="w"> </span><span class="ss">&#39;cd2/comment-or-uncomment-lines</span><span class="p">)</span>

<span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;M-#&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">comment-dwim-2</span><span class="p">)</span>
<span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;C-@&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">mark-unmark-toggle</span><span class="p">)</span>
<span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;C-SPC&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">mark-unmark-toggle</span><span class="p">)</span>

<span class="p">(</span><span class="nb">defun</span><span class="w"> </span><span class="nv">kill-line-or-region</span><span class="w"> </span><span class="p">()</span>
<span class="w">  </span><span class="s">&quot;kill region if active only or kill line normally&quot;</span>
<span class="w">  </span><span class="p">(</span><span class="k">interactive</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nv">region-active-p</span><span class="p">)</span>
<span class="w">      </span><span class="p">(</span><span class="nf">call-interactively</span><span class="w"> </span><span class="ss">&#39;kill-region</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="nf">call-interactively</span><span class="w"> </span><span class="ss">&#39;kill-line</span><span class="p">)))</span>

<span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;C-k&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;kill-line-or-region</span><span class="p">)</span>

<span class="c1">;; (map! &quot;C-w&quot; #&#39;backward-kill-word)</span>
<span class="p">(</span><span class="nb">defun</span><span class="w"> </span><span class="nv">backward-kill-region-or-word</span><span class="w"> </span><span class="p">()</span>
<span class="w">  </span><span class="s">&quot;kill region if active only or kill line normally&quot;</span>
<span class="w">  </span><span class="p">(</span><span class="k">interactive</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nv">region-active-p</span><span class="p">)</span>
<span class="w">      </span><span class="p">(</span><span class="nf">call-interactively</span><span class="w"> </span><span class="ss">&#39;kill-region</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="nf">call-interactively</span><span class="w"> </span><span class="ss">&#39;backward-kill-word</span><span class="p">)))</span>
<span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;C-w&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;backward-kill-region-or-word</span><span class="p">)</span>


<span class="p">(</span><span class="nf">autoload</span>
<span class="w">  </span><span class="ss">&#39;ace-jump-mode</span>
<span class="w">  </span><span class="s">&quot;ace-jump-mode&quot;</span>
<span class="w">  </span><span class="s">&quot;Emacs quick move minor mode&quot;</span>
<span class="w">  </span><span class="no">t</span><span class="p">)</span>
<span class="c1">;; you can select the key you prefer to</span>
<span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="s">&quot;C-c C-t&quot;</span><span class="w"> </span><span class="nf">#&#39;</span><span class="nv">treemacs-select-window</span><span class="p">)</span>
<span class="w">  </span><span class="c1">;; config.el</span>
<span class="w">  </span><span class="c1">;; (require &#39;tera-mode)</span>
<span class="c1">;; (treemacs-no-png-images t)</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">doom-themes-treemacs-theme</span><span class="w"> </span><span class="s">&quot;doom-colors&quot;</span><span class="p">)</span>
<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">treemacs-no-png-images</span><span class="w"> </span><span class="no">t</span><span class="p">)</span>


<span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;C-x C-t&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;ivy-switch-buffer-other-window</span><span class="p">)</span>
<span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;C-&lt;tab&gt;&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;+ivy/switch-workspace-buffer</span><span class="p">)</span>

<span class="p">(</span><span class="k">setq</span><span class="w"> </span><span class="nv">persp-emacsclient-init-frame-behaviour-override</span><span class="w"> </span><span class="s">&quot;main&quot;</span><span class="p">)</span>

<span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;C-c SPC&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;avy-goto-char</span><span class="p">)</span>
<span class="p">(</span><span class="nv">global-set-key</span><span class="w"> </span><span class="p">(</span><span class="nv">kbd</span><span class="w"> </span><span class="s">&quot;C-c C-SPC&quot;</span><span class="p">)</span><span class="w"> </span><span class="ss">&#39;avy-goto-char</span><span class="p">)</span>

<span class="p">(</span><span class="nb">defun</span><span class="w"> </span><span class="nv">copy-to-clipboard</span><span class="w"> </span><span class="p">()</span>
<span class="w">  </span><span class="p">(</span><span class="k">interactive</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nv">display-graphic-p</span><span class="p">)</span>
<span class="w">      </span><span class="p">(</span><span class="k">progn</span>
<span class="w">        </span><span class="p">(</span><span class="nf">message</span><span class="w"> </span><span class="s">&quot;Yanked region to x-clipboard!&quot;</span><span class="p">)</span>
<span class="w">        </span><span class="p">(</span><span class="nf">call-interactively</span><span class="w"> </span><span class="ss">&#39;clipboard-kill-ring-save</span><span class="p">)</span>
<span class="w">        </span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nv">region-active-p</span><span class="p">)</span>
<span class="w">        </span><span class="p">(</span><span class="k">progn</span>
<span class="w">          </span><span class="p">(</span><span class="nv">shell-command-on-region</span><span class="w"> </span><span class="p">(</span><span class="nf">region-beginning</span><span class="p">)</span><span class="w"> </span><span class="p">(</span><span class="nf">region-end</span><span class="p">)</span><span class="w"> </span><span class="s">&quot;xsel -i -b&quot;</span><span class="p">)</span>
<span class="w">          </span><span class="p">(</span><span class="nf">message</span><span class="w"> </span><span class="s">&quot;Yanked region to clipboard!&quot;</span><span class="p">)</span>
<span class="w">          </span><span class="p">(</span><span class="nv">deactivate-mark</span><span class="p">))</span>
<span class="w">      </span><span class="p">(</span><span class="nf">message</span><span class="w"> </span><span class="s">&quot;No region active; can&#39;t yank to clipboard!&quot;</span><span class="p">)))</span>
<span class="w">  </span><span class="p">)</span>

<span class="p">(</span><span class="nb">defun</span><span class="w"> </span><span class="nv">paste-from-clipboard</span><span class="w"> </span><span class="p">()</span>
<span class="w">  </span><span class="p">(</span><span class="k">interactive</span><span class="p">)</span>
<span class="w">  </span><span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nv">display-graphic-p</span><span class="p">)</span>
<span class="w">      </span><span class="p">(</span><span class="k">progn</span>
<span class="w">        </span><span class="p">(</span><span class="nv">clipboard-yank</span><span class="p">)</span>
<span class="w">        </span><span class="p">(</span><span class="nf">message</span><span class="w"> </span><span class="s">&quot;graphics active&quot;</span><span class="p">)</span>
<span class="w">        </span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="nf">insert</span><span class="w"> </span><span class="p">(</span><span class="nv">shell-command-to-string</span><span class="w"> </span><span class="s">&quot;xsel -o -b&quot;</span><span class="p">))</span>
<span class="w">    </span><span class="p">)</span>
<span class="w">  </span><span class="p">)</span>


<span class="p">(</span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="nv">display-graphic-p</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="k">progn</span>
<span class="w">      </span><span class="c1">;; if graphic</span>
<span class="w">      </span><span class="p">(</span><span class="nv">use-package!</span><span class="w"> </span><span class="nv">corfu</span>
<span class="w">        </span><span class="nb">:custom</span>
<span class="w">        </span><span class="p">(</span><span class="nv">corfu-auto</span><span class="w"> </span><span class="no">t</span><span class="p">)</span><span class="w">               </span><span class="c1">;; Enable auto completion</span>
<span class="w">        </span><span class="p">(</span><span class="nv">corfu-preselect</span><span class="w"> </span><span class="ss">&#39;directory</span><span class="p">)</span><span class="w"> </span><span class="c1">;; Select the first candidate, except for directories</span>

<span class="w">        </span><span class="nb">:init</span>
<span class="w">        </span><span class="p">(</span><span class="nv">global-corfu-mode</span><span class="p">)</span>

<span class="w">        </span><span class="nb">:config</span>
<span class="w">        </span><span class="c1">;; Free the RET key for less intrusive behavior.</span>
<span class="w">        </span><span class="c1">;; Option 1: Unbind RET completely</span>
<span class="w">        </span><span class="c1">;; (keymap-unset corfu-map &quot;RET&quot;)</span>
<span class="w">        </span><span class="c1">;; Option 2: Use RET only in shell modes</span>
<span class="w">        </span><span class="p">(</span><span class="nv">keymap-set</span><span class="w"> </span><span class="nv">corfu-map</span><span class="w"> </span><span class="s">&quot;RET&quot;</span><span class="w"> </span><span class="o">`</span><span class="p">(</span><span class="w"> </span><span class="nv">menu-item</span><span class="w"> </span><span class="s">&quot;&quot;</span><span class="w"> </span><span class="no">nil</span><span class="w"> </span><span class="nb">:filter</span>
<span class="w">                                       </span><span class="o">,</span><span class="p">(</span><span class="nb">lambda</span><span class="w"> </span><span class="p">(</span><span class="kp">&amp;optional</span><span class="w"> </span><span class="nv">_</span><span class="p">)</span>
<span class="w">                                          </span><span class="p">(</span><span class="k">and</span><span class="w"> </span><span class="p">(</span><span class="nv">derived-mode-p</span><span class="w"> </span><span class="ss">&#39;eshell-mode</span><span class="w"> </span><span class="ss">&#39;comint-mode</span><span class="p">)</span>
<span class="w">                                               </span><span class="nf">#&#39;</span><span class="nv">corfu-send</span><span class="p">))))))</span>

<span class="w">  </span><span class="c1">;; else (optional)</span>
<span class="w">  </span><span class="p">(</span><span class="nv">use-package!</span><span class="w"> </span><span class="nv">corfu</span>
<span class="w">    </span><span class="nb">:custom</span>
<span class="w">    </span><span class="p">(</span><span class="nv">corfu-auto</span><span class="w"> </span><span class="no">t</span><span class="p">)</span><span class="w">               </span><span class="c1">;; Enable auto completion</span>
<span class="w">    </span><span class="p">(</span><span class="nv">corfu-preselect</span><span class="w"> </span><span class="ss">&#39;directory</span><span class="p">))</span><span class="w"> </span><span class="c1">;; Select the first candidate, except for directories</span>
<span class="w">  </span><span class="p">(</span><span class="nv">after!</span><span class="w"> </span><span class="nv">corfu</span>
<span class="w">    </span><span class="p">(</span><span class="nv">map!</span><span class="w"> </span><span class="nb">:map</span><span class="w"> </span><span class="nv">corfu-map</span>
<span class="w">          </span><span class="s">&quot;TAB&quot;</span><span class="w">     </span><span class="nf">#&#39;</span><span class="nv">corfu-insert</span><span class="p">))</span>
<span class="w">  </span><span class="p">(</span><span class="nv">keymap-unset</span><span class="w"> </span><span class="nv">corfu-map</span><span class="w"> </span><span class="s">&quot;RET&quot;</span><span class="p">)</span>
<span class="w">    </span><span class="p">(</span><span class="nv">corfu-terminal-mode</span><span class="w"> </span><span class="mi">+1</span><span class="p">))</span>



<span class="p">(</span><span class="nv">custom-set-faces!</span>
<span class="w">  </span><span class="o">&#39;</span><span class="p">(</span><span class="nv">default</span><span class="w"> </span><span class="nb">:background</span><span class="w"> </span><span class="no">nil</span><span class="p">))</span>



<span class="p">(</span><span class="nv">after!</span><span class="w"> </span><span class="nv">lsp-volar</span>
<span class="w">  </span><span class="c1">;; remove :system after lsp-volar loaded</span>
<span class="w">  </span><span class="p">(</span><span class="nv">lsp-dependency</span><span class="w"> </span><span class="ss">&#39;typescript</span>
<span class="w">                  </span><span class="o">&#39;</span><span class="p">(</span><span class="nb">:npm</span><span class="w"> </span><span class="nb">:package</span><span class="w"> </span><span class="s">&quot;typescript&quot;</span>
<span class="w">                    </span><span class="nb">:path</span><span class="w"> </span><span class="s">&quot;tsserver&quot;</span><span class="p">)))</span>
<span class="c1">;; Garbage collection (or lack thereof soon)</span>
<span class="p">(</span><span class="nb">defmacro</span><span class="w"> </span><span class="nv">k-time</span><span class="w"> </span><span class="p">(</span><span class="kp">&amp;rest</span><span class="w"> </span><span class="nv">body</span><span class="p">)</span>
<span class="w">  </span><span class="s">&quot;Measure and return the time it takes evaluating BODY.&quot;</span>
<span class="w">  </span><span class="o">`</span><span class="p">(</span><span class="k">let</span><span class="w"> </span><span class="p">((</span><span class="nv">time</span><span class="w"> </span><span class="p">(</span><span class="nf">current-time</span><span class="p">)))</span>
<span class="w">     </span><span class="o">,@</span><span class="nv">body</span>
<span class="w">     </span><span class="p">(</span><span class="nf">float-time</span><span class="w"> </span><span class="p">(</span><span class="nv">time-since</span><span class="w"> </span><span class="nv">time</span><span class="p">))))</span>


<span class="c1">;; When idle for 15sec run the GC no matter what.</span>
<span class="p">(</span><span class="k">defvar</span><span class="w"> </span><span class="nv">k-gc-timer</span>
<span class="w">  </span><span class="p">(</span><span class="nv">run-with-idle-timer</span><span class="w"> </span><span class="mi">15</span><span class="w"> </span><span class="no">t</span>
<span class="w">                       </span><span class="p">(</span><span class="nb">lambda</span><span class="w"> </span><span class="p">()</span>
<span class="w">                         </span><span class="p">(</span><span class="nf">message</span><span class="w"> </span><span class="s">&quot;Garbage Collector has run for %.06fsec&quot;</span>
<span class="w">                                  </span><span class="p">(</span><span class="nv">k-time</span><span class="w"> </span><span class="p">(</span><span class="nf">garbage-collect</span><span class="p">))))))</span>
</pre>
