<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>webcodr</title>
    <link>https://webcodr.io/series/finding-things-fast/</link>
    <description>Recent content on webcodr</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 05 Jul 2026 20:28:50 +0000</lastBuildDate>
    <atom:link href="https://webcodr.io/series/finding-things-fast/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Find things even faster with srchr</title>
      <link>https://webcodr.io/2026/07/find-things-even-faster-with-srchr/</link>
      <pubDate>Sun, 05 Jul 2026 20:28:50 +0000</pubDate>
      <guid>https://webcodr.io/2026/07/find-things-even-faster-with-srchr/</guid>
      <description>Inspired by my last post about rgp and fdp I got the idea to combine both into a more powerful and easier tool called srchr.
It’s a TUI written in Rust and uses similar or the same libraries as rg, fd, fzf and bat, but in one package. There are no external dependencies and it comes for macOS, Linux and Windows in aarch64 and x86-64.
Currently srchr is not available via package managers, but there’s an installation script:
</description>
      <content:encoded><![CDATA[<p>Inspired by my last post about <code>rgp</code> and <code>fdp</code> I got the idea to combine both into a more powerful and easier tool called <code>srchr</code>.</p>
<p>It&rsquo;s a TUI written in Rust and uses similar or the same libraries as <code>rg</code>, <code>fd</code>, <code>fzf</code> and <code>bat</code>, but in one package. There are no external dependencies and it comes for macOS, Linux and Windows in aarch64 and x86-64.</p>
<p>Currently <code>srchr</code> is not available via package managers, but there&rsquo;s an installation script:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">curl -fsSL https://raw.githubusercontent.com/webcodr/srchr/main/install.sh <span class="p">|</span> sh
</span></span></code></pre></div><p>I will also publish <code>srchr</code> on Homebrew, the AUR and perhaps some other package managers.</p>
<p>Beware, it&rsquo;s still under development and the UI is functional, but not finished yet. At the moment there is just a hardcoded Tokyo Night inspired color theme, but this will also change in the near future.</p>
<p><a href="https://github.com/webcodr/srchr">srchr on GitHub</a></p>
<h3 id="update"><a href="#update" class="heading-anchor">Update</a></h3>
<p>It&rsquo;s now available on Homebrew for macOS and Linux!</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">brew install webcodr/tap/srchr
</span></span></code></pre></div>]]></content:encoded>
    </item>
    
    <item>
      <title>Using fd, rg, fzf and bat to find things fast</title>
      <link>https://webcodr.io/2026/07/using-fd-rg-fzf-and-bat-to-find-things-fast/</link>
      <pubDate>Sun, 05 Jul 2026 17:05:03 +0000</pubDate>
      <guid>https://webcodr.io/2026/07/using-fd-rg-fzf-and-bat-to-find-things-fast/</guid>
      <description>Modern terminal programs like fd or rg make it really easy to find stuff, but there’s still room for improvement. In this post I will show you how to use fish to write two small functions with fd, rg, fzf and bat to search for file names and file content with an interactive list and even a preview in the terminal.
I don’t know that stuff? First things first. If you already know fd or the other tools from above, feel free to skip this section.
</description>
      <content:encoded><![CDATA[<p>Modern terminal programs like <code>fd</code> or <code>rg</code> make it really easy to find stuff, but there&rsquo;s still room for improvement. In this post I will show you how to use fish to write two small functions with <code>fd</code>, <code>rg</code>, <code>fzf</code> and <code>bat</code> to search for file names and file content with an interactive list and even a preview in the terminal.</p>
<h2 id="i-dont-know-that-stuff"><a href="#i-dont-know-that-stuff" class="heading-anchor">I don&rsquo;t know that stuff?</a></h2>
<p>First things first. If you already know <code>fd</code> or the other tools from above, feel free to skip this section.</p>
<ul>
<li><code>fd</code> is a more user-friendly replacement for <code>find</code></li>
<li><code>rg</code> or ripgrep is <code>grep</code> on steroids, respecting git ignore files and skipping binaries or hidden files</li>
<li><code>fzf</code> is a command-line fuzzy finder. You basically can pipe everything into <code>fzf</code> and just type to filter the output</li>
<li><code>bat</code> is a modern version of <code>cat</code> with syntax highlighting and git integration</li>
</ul>
<h2 id="say-hi-to-rgp-and-fdp"><a href="#say-hi-to-rgp-and-fdp" class="heading-anchor">Say hi to rgp and fdp</a></h2>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fish" data-lang="fish"><span class="line"><span class="cl"><span class="k">function</span> <span class="nf">rgp</span>
</span></span><span class="line"><span class="cl">    <span class="k">set</span> <span class="na">-l</span> <span class="nv">search_term</span> <span class="nv">$argv</span><span class="o">[</span><span class="m">1</span><span class="o">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="k">test</span> <span class="na">-z</span> <span class="s2">&#34;</span><span class="nv">$search_term</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl">        <span class="k">echo</span> <span class="s2">&#34;Usage: rgp &lt;search_term&gt;&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">        <span class="k">return</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">    <span class="k">end</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="nf">rg</span> <span class="na">-l</span> <span class="nv">$search_term</span> <span class="o">|</span> <span class="nf">fzf</span> <span class="na">--preview</span> <span class="s1">&#39;bat --color always {}&#39;</span> <span class="na">--bind</span> <span class="s1">&#39;enter:become(&#34;$EDITOR&#34; {+})&#39;</span>
</span></span><span class="line"><span class="cl"><span class="k">end</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="k">function</span> <span class="nf">fdp</span>
</span></span><span class="line"><span class="cl">    <span class="k">set</span> <span class="na">-l</span> <span class="nv">search_term</span> <span class="nv">$argv</span><span class="o">[</span><span class="m">1</span><span class="o">]</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="k">test</span> <span class="na">-z</span> <span class="s2">&#34;</span><span class="nv">$search_term</span><span class="s2">&#34;</span>
</span></span><span class="line"><span class="cl">        <span class="k">echo</span> <span class="s2">&#34;Usage: fdp &lt;search_term&gt;&#34;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">        <span class="k">return</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">    <span class="k">end</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="nf">fd</span> <span class="na">-tf</span> <span class="nv">$search_term</span> <span class="o">|</span> <span class="nf">fzf</span> <span class="na">--preview</span> <span class="s1">&#39;bat --color always {}&#39;</span> <span class="na">--bind</span> <span class="s1">&#39;enter:become(&#34;$EDITOR&#34; {+})&#39;</span>
</span></span><span class="line"><span class="cl"><span class="k">end</span>
</span></span></code></pre></div><p>That&rsquo;s all you need. Put them into your fish config file or the fish functions folder.</p>
<h2 id="usage"><a href="#usage" class="heading-anchor">Usage</a></h2>
<p><code>rgp something</code> &ndash; this will use <code>rg</code> to recursively search the current directory for files with <code>something</code> inside. The result is piped into <code>fzf</code>. You can now filter the result further with <code>fzf</code> or select a file with the arrow keys and <code>bat</code> will give you a live preview of the file with syntax highlighting. Pressing <code>enter</code> will open the selected file with your default editor (environment variable <code>EDITOR</code>).</p>
<p><code>fdp</code> works similarly, but looks for file names instead of the file content and also pipes the result to <code>fzf</code> for further filtering, preview or opening the selected file.</p>
<p>Don&rsquo;t like fish? Here&rsquo;s a version that works with bash or zsh.</p>
<p><strong>Note</strong>: the <code>local</code> keyword is not POSIX-compliant. If you need that, just remove it, but this makes <code>search_term</code> global, so use with care.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">rgp<span class="o">()</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">    <span class="nb">local</span> <span class="nv">search_term</span><span class="o">=</span><span class="nv">$1</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="o">[</span> -z <span class="s2">&#34;</span><span class="nv">$search_term</span><span class="s2">&#34;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">        <span class="nb">echo</span> <span class="s2">&#34;Usage: rgp &lt;search_term&gt;&#34;</span>
</span></span><span class="line"><span class="cl">        
</span></span><span class="line"><span class="cl">        <span class="k">return</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">    <span class="k">fi</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    rg -l <span class="s2">&#34;</span><span class="nv">$search_term</span><span class="s2">&#34;</span> <span class="p">|</span> fzf --preview <span class="s1">&#39;bat --color always {}&#39;</span> --bind <span class="s1">&#39;enter:become(&#34;$EDITOR&#34; {+})&#39;</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">fdp<span class="o">()</span> <span class="o">{</span>
</span></span><span class="line"><span class="cl">    <span class="nb">local</span> <span class="nv">search_term</span><span class="o">=</span><span class="nv">$1</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    <span class="k">if</span> <span class="o">[</span> -z <span class="s2">&#34;</span><span class="nv">$search_term</span><span class="s2">&#34;</span> <span class="o">]</span><span class="p">;</span> <span class="k">then</span>
</span></span><span class="line"><span class="cl">        <span class="nb">echo</span> <span class="s2">&#34;Usage: fdp &lt;search_term&gt;&#34;</span>
</span></span><span class="line"><span class="cl">        
</span></span><span class="line"><span class="cl">        <span class="k">return</span> <span class="m">1</span>
</span></span><span class="line"><span class="cl">    <span class="k">fi</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">    fd -tf <span class="s2">&#34;</span><span class="nv">$search_term</span><span class="s2">&#34;</span> <span class="p">|</span> fzf --preview <span class="s1">&#39;bat --color always {}&#39;</span> --bind <span class="s1">&#39;enter:become(&#34;$EDITOR&#34; {+})&#39;</span>
</span></span><span class="line"><span class="cl"><span class="o">}</span>
</span></span></code></pre></div>]]></content:encoded>
    </item>
    
  </channel>
</rss>
