~hristoast/hristoast

hristoast/site/why-i-like-fish.html -rw-r--r-- 3.9 KiB
4c97c4e5Hristos N. Triantafillou No more zen2 12 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<h1 id="title">Why I Like Fish</h1>

<div id="dates">
  <span>Posted: <time id="post-date">2017-02-09</time></span>
</div>

<p>I am of course talking about the <a href="http://fishshell.com/">Friendly Interactive SHell</a>!</p>

<p id="post-excerpt">
  For about three or four years now, I've been a pretty happy <a href="http://zsh.sourceforge.net/"><code>zsh</code></a> user.  I had a pretty decent, not-too-complex/customized setup based on a popular framework that bills itself as "minimal", but a recent whim prompted me to check out <code>fish</code>.
</p>

<p>
  The familiarity offered by <code>zsh</code> wasn't enough, though, when compared to the tradeoff of far less config for as much as or arguable more functionality.  Intrigued? Want to hear more?
</p>

<div id="toc"></div>

<h3>Why <code>fish</code>?</h3>

<p>
  At the top of <a href="http://fishshell.com/">fishshell.com</a>, <code>fish</code> bills itself as "a command line shell for the 90s", and it's <a href="http://fishshell.com/docs/current/design.html">design document</a> says "Configurability is the root of all evil".  Bold words, especially for someone like me who deeply values configurability and control.  It turns out, these points work in favor of <code>fish</code> and the resulting experience has been awesome for me!
</p>

<p>
  With <code>fish</code>, I get almost all of the functionality I had with <code>zsh</code> and <a href="https://github.com/sorin-ionescu/prezto">zprezto</a> out of the box!  Things like command and tab-completion not only work equally well but are actually more elegant in my opinion.  And that's with zero configuration.
</p>

<h3>But I want to change that</h3>

<p>
  Okay so configuration is evil... I don't necessarily agree with that as a blanket statement but it works well for <code>fish</code>.  But what if you don't love the default prompt?  Well don't worry, I didn't either and the path to customization is better than you might expect.
</p>

<p>
  Okay so configuration is evil... I don't necessarily agree with that as a blanket statement but it works well for <code>fish</code>.  But what if you don't love the default prompt?  Well don't worry, I didn't either and the path to customization is better than you might expect.
</p>

<h4><code>fish_config</code></h4>

<p>
  To begin down the path of <code>fish</code> customization, run the <code>fish_config</code> command.  This will open a web browser to a local "fish shell configuration" page, which allows you to tweak colors or your prompt, view functions, variables, history, or bindings.
</p>

<p>
  This is a really great place to start on your own prompt or whatever;  Just select a default that has something you like and tweak away.  But if that isn't enough, you can always reference the excellent themes and functions in <a href="https://github.com/oh-my-fish/oh-my-fish">oh-my-fish</a> for your own.
</p>

<h4>Aliases?  Functions!</h4>

<p>
  In <code>fish</code>, command aliases as you know them from <code>bash</code> aren't really idiomatic;  You can use <code>alias</code>, which is just a wrapper for <code>function</code>, and it will behave like you expect it to, but <a href="http://fishshell.com/docs/current/commands.html#alias">the official documentation recommends</a> making a function.
</p>

<h4>Oh-my-fish</h4>

<p>
  I personally didn't go with oh-my-fish (just using bits of themes and etc.) because I didn't feel like I needed to;  As mentioned earlier, you really get so much out of the box with <code>fish</code> that it just doesn't feel necessary.  Perhaps some day I'll take it for a test spin but for now I'm totally cool with the handful of functions (aliases) I wrote myself.
</p>

<h3>Conclusion?</h3>

<p>
  This concludes my little rant about <code>fish</code>.  I hope I've shown why it's so darned nifty - give it a shot sometime.  Their <a href="http://fishshell.com/docs/current/faq.html">FAQ</a> (and the rest of their documentation, in general) is very good so make sure to give it a read.
</p>