<?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: Devashish Nayak</title>
    <description>The latest articles on Forem by Devashish Nayak (@devashishnayak).</description>
    <link>https://forem.com/devashishnayak</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%2F1265529%2Fa7427466-b5e1-4113-8e62-f0e6d6217236.jpeg</url>
      <title>Forem: Devashish Nayak</title>
      <link>https://forem.com/devashishnayak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/devashishnayak"/>
    <language>en</language>
    <item>
      <title>Elevate Your VS Code Terminal with a Sleek Starship Prompt</title>
      <dc:creator>Devashish Nayak</dc:creator>
      <pubDate>Thu, 25 Jan 2024 08:47:28 +0000</pubDate>
      <link>https://forem.com/devashishnayak/elevate-your-vs-code-terminal-with-a-sleek-starship-prompt-29af</link>
      <guid>https://forem.com/devashishnayak/elevate-your-vs-code-terminal-with-a-sleek-starship-prompt-29af</guid>
      <description>&lt;p&gt;Customizing your terminal can not only be a fun expression of your style but can significantly improve your productivity by providing essential information at a glance. Today, I'm sharing my &lt;code&gt;starship.toml&lt;/code&gt; configuration which mimics the look of the terminal as shown in the VS Code documentation but adds a personal touch.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Starship?
&lt;/h2&gt;

&lt;p&gt;Starship is a minimal, blazing-fast, and infinitely customizable prompt for any shell. It allows you to get information quickly about your current directory and project, all with a beautiful design that can be as simple or as complex as you wish.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration Behind My Configuration
&lt;/h2&gt;

&lt;p&gt;The default terminal is functional, but it doesn't spark joy nor does it efficiently convey information. My aim was to create a prompt that is both visually appealing and informative, reducing the need for additional commands to understand my environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Heart of the Terminal: &lt;code&gt;starship.toml&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here's a peek at the &lt;code&gt;starship.toml&lt;/code&gt; file that powers my terminal's appearance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c"&gt;# Get editor completions based on the config schema&lt;/span&gt;
&lt;span class="py"&gt;"$schema"&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'https://starship.rs/config-schema.json'&lt;/span&gt;

&lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"""&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;[](fg:#da6871 bg:#00FFFFFF)&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;$directory&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;[](fg:#da6871 bg:#fef199)&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;$git_branch&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;[](fg:#fef199 bg:#3a9ef4)&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;$git_status&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;$git_metrics&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;[](fg:#3a9ef4 bg:#00FFFFFF)&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;$nodejs
$character&lt;/span&gt;&lt;span class="se"&gt;\
&lt;/span&gt;&lt;span class="s"&gt;"""&lt;/span&gt;

&lt;span class="c"&gt;# Inserts a blank line between shell prompts&lt;/span&gt;
&lt;span class="py"&gt;add_newline&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;

&lt;span class="nn"&gt;[directory]&lt;/span&gt;
&lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"[$path ]($style)"&lt;/span&gt;
&lt;span class="py"&gt;style&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fg:#121111 bg:#da6871"&lt;/span&gt;

&lt;span class="nn"&gt;[git_branch]&lt;/span&gt;
&lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'[ $symbol$branch(:$remote_branch) ]($style)'&lt;/span&gt;
&lt;span class="py"&gt;symbol&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt;
&lt;span class="py"&gt;style&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fg:#121111 bg:#fef199"&lt;/span&gt;

&lt;span class="nn"&gt;[git_status]&lt;/span&gt;
&lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'[ $all_status ]($style)'&lt;/span&gt;
&lt;span class="py"&gt;style&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fg:#121111 bg:#3a9ef4"&lt;/span&gt;

&lt;span class="nn"&gt;[git_metrics]&lt;/span&gt;
&lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"([+$added ]($added_style))[]($added_style)"&lt;/span&gt;
&lt;span class="py"&gt;added_style&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fg:#121111 bg:#3a9ef4"&lt;/span&gt;
&lt;span class="py"&gt;deleted_style&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fg:bright-red bg:235"&lt;/span&gt;
&lt;span class="py"&gt;disabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

&lt;span class="nn"&gt;[nodejs]&lt;/span&gt;
&lt;span class="py"&gt;format&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;' via [ $version](bold green) '&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each element in the configuration serves a purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;$directory&lt;/code&gt; shows the current working directory.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;$git_branch&lt;/code&gt; displays the current branch in the git repository.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;$git_status&lt;/code&gt; and &lt;code&gt;$git_metrics&lt;/code&gt; provide at-a-glance information about the repository's status.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;$nodejs&lt;/code&gt; shows the currently installed Node.js version, which is especially useful for JS developers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Resulting Look
&lt;/h2&gt;

&lt;p&gt;Once applied, this configuration transforms the prompt into a vibrant display of colors and icons. The directory path is highlighted in pink, the git branch in yellow, and git status in blue, followed by the Node.js version in green. It's a prompt that not only looks good but feels intuitive to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Customize?
&lt;/h2&gt;

&lt;p&gt;A customized prompt can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reduce the time taken to understand the current project state.&lt;/li&gt;
&lt;li&gt;Decrease the reliance on executing multiple commands.&lt;/li&gt;
&lt;li&gt;Make the development environment more enjoyable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Can You Customize Your Own?
&lt;/h2&gt;

&lt;p&gt;To use this configuration:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Starship, if you haven't already, from &lt;a href="https://starship.rs/"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;starship.toml&lt;/code&gt; file in your home directory.&lt;/li&gt;
&lt;li&gt;Paste the configuration shared above into the file.&lt;/li&gt;
&lt;li&gt;Open a new terminal window to see the changes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;A terminal is not just a tool; it's the developer's habitat. Customizing it can lead to a more pleasant and productive development experience. I encourage you to try this configuration and tweak it to match your workflow and style.&lt;/p&gt;

&lt;h2&gt;
  
  
  Share Your Setup!
&lt;/h2&gt;

&lt;p&gt;Got an amazing prompt setup of your own? Share it in the comments below! Let's inspire each other and make our development environments a place we love to work in.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>development</category>
      <category>terminal</category>
      <category>starship</category>
    </item>
  </channel>
</rss>
