Skip to content
Home

Setup `fish` shell and `oh my fish`

Install fish

friendly interactive shell

sudo apt install fish
# setup `fish` as default shell
chsh -s $(which fish)
# alternative to set the default shell, if the above method does not work.
# find where fish is installed
which fish
# open the file
sudo nano /etc/shells
# add the path from above in the file.

Restart the operating system for the changes to be updated

Install oh-my-fish

Oh My Fish provides core infrastructure to allow you to install packages which extend or modify the look of your shell. It’s fast, extensible and easy to use.

https://github.com/oh-my-fish/oh-my-fish

# Install Oh-My-Fish, required for themes
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
omf install bobthefish
# [Optional] Install NerdFont --> FiraCode
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/FiraCode.zip -O FiraCode.zip
unzip FiraCode.zip -d FiraCode
mkdir -p ~/.fonts
cp FiraCode/*.ttf ~/.fonts/
fc-cache -fv
fc-list | grep "FiraCode"
rm -rf FiraCode.zip FiraCode
set -g theme_powerline_fonts no
#activating the nerd-fonts in the `fish` terminal
set -g theme_nerd_fonts yes

Troubleshoot

For GNOME Terminal (default terminal on Ubuntu)

  1. Open GNOME Terminal Preferences:

    • Open the terminal.
    • Click the hamburger menu (☰) in the top-right corner.
    • Select Preferences.
  2. Select Your Profile:

    • In the left pane, choose the profile you want to edit (e.g., “Unnamed” or “Default”).
  3. Change Font:

    • Scroll down to the Text section.
    • Toggle Custom Font on.
    • Click the font selection box, and a font chooser dialog will appear.
  4. Select Font:

    • Search for FiraCode Nerd Font in the font list.
    • Choose the desired size and click Select.
  5. Save and Close:

    • The font will update immediately. Close the preferences window to apply the changes.

For VS Code

In the Editor

  1. Open VS Code Settings:

    • Click the gear icon in the bottom-left corner and select Settings.
    • Alternatively, press Ctrl + ,.
  2. Search for Font Family:

    • In the search bar at the top, type editor.fontFamily.
  3. Update the Font Family:

    • Click the pencil icon next to Editor: Font Family and edit the field.
    • Add FiraCode Nerd Font at the beginning of the list:
      "FiraCode Nerd Font", Consolas, "Courier New", monospace
  4. Enable Font Ligatures (Optional):

    • Search for editor.fontLigatures in the settings.
    • Toggle the option On, or add this line in your settings.json file:
      "editor.fontLigatures": true

In the Integrated Terminal

  1. Open Settings:

    • Follow the steps above to access the Settings.
  2. Search for Terminal Font Family:

    • In the search bar, type terminal.integrated.fontFamily.
  3. Update the Terminal Font:

    • Click the pencil icon and edit the field.
    • Add FiraCode Nerd Font:
  4. Adjust Font Size (Optional):

    • Search for terminal.integrated.fontSize and increase or decrease the size as needed, e.g., 14.

Options to override some of the following default options in config.fish:

set -g theme_display_git no
set -g theme_display_git_dirty no
set -g theme_display_git_untracked no
set -g theme_display_git_ahead_verbose yes
set -g theme_display_git_dirty_verbose yes
set -g theme_display_git_stashed_verbose yes
set -g theme_display_git_default_branch yes
set -g theme_git_default_branches master main
set -g theme_git_worktree_support yes
set -g theme_use_abbreviated_branch_name yes
set -g theme_display_vagrant yes
set -g theme_display_docker_machine no
set -g theme_display_k8s_context yes
set -g theme_display_hg yes
set -g theme_display_virtualenv no
set -g theme_display_nix no
set -g theme_display_ruby no
set -g theme_display_node yes
set -g theme_display_user ssh
set -g theme_display_hostname ssh
set -g theme_display_vi no
set -g theme_display_date no
set -g theme_display_cmd_duration yes
set -g theme_title_display_process yes
set -g theme_title_display_path no
set -g theme_title_display_user yes
set -g theme_title_use_abbreviated_path no
set -g theme_date_format "+%a %H:%M"
set -g theme_date_timezone America/Los_Angeles
set -g theme_avoid_ambiguous_glyphs yes
set -g theme_powerline_fonts no
set -g theme_nerd_fonts yes
set -g theme_show_exit_status yes
set -g theme_display_jobs_verbose yes
set -g default_user your_normal_user
set -g theme_color_scheme dark
set -g fish_prompt_pwd_dir_length 0
set -g theme_project_dir_length 1
set -g theme_newline_cursor yes
set -g theme_newline_prompt '$ '