<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Tong</title>
    <description>The latest articles on Forem by Tong (@hackinggate).</description>
    <link>https://forem.com/hackinggate</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F884053%2Fa7fffc62-769d-4486-b51c-760a8009dfc7.jpeg</url>
      <title>Forem: Tong</title>
      <link>https://forem.com/hackinggate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hackinggate"/>
    <language>en</language>
    <item>
      <title>Setup your fancy terminal</title>
      <dc:creator>Tong</dc:creator>
      <pubDate>Fri, 08 Jul 2022 16:33:35 +0000</pubDate>
      <link>https://forem.com/hackinggate/setup-your-fancy-terminal-2lea</link>
      <guid>https://forem.com/hackinggate/setup-your-fancy-terminal-2lea</guid>
      <description>&lt;h2&gt;
  
  
  ﻿Setup your fancy terminal
&lt;/h2&gt;

&lt;p&gt;Using your shell with Oh My Zsh and Starship on macOS&lt;/p&gt;

&lt;p&gt;Some use &lt;a href="https://fishshell.com/"&gt;fish shell&lt;/a&gt; as it is an interactive, user-friendly, and modern shell. But it does not have POSIX sh compatibility. Using fish as your default shell could break part of your system. In this post, I will focus on zsh. With powerful plugins. You can have a powerful interactive interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install &lt;a href="http://www.zsh.org/"&gt;Z shell (zsh)&lt;/a&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install &lt;a href="https://ohmyz.sh/"&gt;Oh My Zsh (omz)&lt;/a&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set zsh as your default shell
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;chsh &lt;span class="nt"&gt;-s&lt;/span&gt; /usr/local/bin/zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install &lt;a href="https://github.com/zsh-users"&gt;Oh My Zsh plugins&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Clone &lt;a href="https://github.com/zsh-users/zsh-autosuggestions.git"&gt;zsh-autosuggestions&lt;/a&gt;, &lt;a href="https://github.com/zsh-users/zsh-syntax-highlighting.git"&gt;zsh-syntax-highlighting&lt;/a&gt; and &lt;a href="https://github.com/zsh-users/zsh-completions.git"&gt;zsh-completions&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/zsh-users/zsh-autosuggestions.git &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-completions.git &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;ZSH_CUSTOM&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="p"&gt;~/.oh-my-zsh/custom&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/plugins/zsh-completions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the plugin to the list of plugins for Oh My Zsh to load (inside ~/.zshrc):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;plugins=( 
    # other plugins...
    zsh-autosuggestions
    zsh-syntax-highlighting
    zsh-completions
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;a href="http://starship.rs/"&gt;Starship.rs&lt;/a&gt; (a fast fancy prompt written in Rust)
&lt;/h2&gt;

&lt;p&gt;You need &lt;a href="https://www.nerdfonts.com/"&gt;Nerd Font&lt;/a&gt; installed and enabled in your terminal.&lt;/p&gt;

&lt;p&gt;We will install &lt;a href="https://www.nerdfonts.com/font-downloads"&gt;Fira Code Nerd Font&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew tap homebrew/cask-fonts
brew &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--cask&lt;/span&gt; font-fira-code-nerd-font
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open your terminal preferences and enable the font you've just downloaded.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;⌘,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following to the end of &lt;code&gt;~/.zshrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;eval "$(starship init zsh)"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XCdpP5QA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/macj1pii2j2whysky6o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XCdpP5QA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/macj1pii2j2whysky6o2.png" alt="Terminal screenshot" width="880" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>zsh</category>
      <category>shell</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
