Skip to content

Latest commit

 

History

History
206 lines (135 loc) · 8.51 KB

README.md

File metadata and controls

206 lines (135 loc) · 8.51 KB

Terminal setup Terminal

The default shell is sh that is symlinked to bash in most Linux systems

The Z Shell (ZSH) ZSH

Referred from: OMZ GitHub guide , Fedora Magazine page , Tecmint article

  • Install the zsh shell via your package manager

    sudo dnf update
    sudo dnf install -y zsh
  • Make zsh as your default shell (If the chsh command isn't found, run sudo dnf install -y util-linux-user)

    # List all available shells
    chsh -l
    # Make 'zsh' the default shell
    chsh -s $(which zsh)
  • Reboot the system. Open the terminal, it opens the setup wizard asking for multiple options to configure ZSH. In the wizard, select options as per your preference. These will be saved in your Shell config file i.e. ~/.zshrc

  • Ensure your shell being loaded is zsh whenever you open terminal

    echo $SHELL
    # The output should be: /usr/bin/zsh

Oh-My-Zsh (OMZ) Oh-My-ZSH

It provides many plugins, themes etc for ZSH

OMZ Install:

As per the OMZ Website and OMZ GitHub

sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"

Themes: OMZ themes , Extended themes, powerlevel10k

Ensure at least one powerline or nerd font is installed to support special characters or glyphs in your theme. Refer my Fonts Guide

Another new shell prompt alternative is Starship


OMZ Plugins

  • First see if that plugin is present in the list of plugins available for OMZ
  • Else, you'll need to put them inside in the $ZSH_CUSTOM/plugins folder. The ZSH_CUSTOM variable is by deafult ~/.oh-my-zsh/custom
  • Finally specify your plugins for zsh to load as plugins=(git dnf ...) in the ~/.zshrc file

To view all set aliases at once just enter alias in terminal

More ZSH utils: blog

ZSH Auto-suggestions and Syntax-highlighting

These are't included by OMZ

Installation instructions: zsh-autosuggestions , zsh-syntax-highlighting

Below commands clone the two repos into $ZSH_CUSTOM/plugins/

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Make sure to include them in the plugins=(...) array inside ~/.zshrc file

Final ZSH Profile

The starting default OMZ profile is available at ~/.oh-my-zsh/templates/zshrc.zsh-template

You can refer my .zshrc file


Alacritty Alacritty

It is a modern cross-platform terminal emulator written in Rust that utilizes your GPU

Referring from the build instructions for Linux from their site

  • Make sure Rust is installed. Refer my Rust installation page. Then, update rustup to latest stable version:

    rustup override set stable
    rustup update stable
  • Clone the Alacritty source code:

    git clone [email protected]:alacritty/alacritty.git
  • Install the required dependencies as per your distro. Mine is Fedora(dnf) but you can refer their Dependencies section for your respective distro

    sudo dnf install cmake freetype-devel fontconfig-devel libxcb-devel libxkbcommon-devel g++ scdoc
  • Build application from the source code. The built binary should be at target/release/alacritty

    cd alacritty
    cargo build --release
  • Create desktop entry for the application:

    sudo cp target/release/alacritty /usr/local/bin
    sudo cp extra/logo/alacritty-term.svg /usr/share/pixmaps/Alacritty.svg
    sudo desktop-file-install extra/linux/Alacritty.desktop
    sudo update-desktop-database
  • Add manuals i.e. man pages:

    sudo mkdir -p /usr/local/share/man/man1
    sudo mkdir -p /usr/local/share/man/man5
    scdoc < extra/man/alacritty.1.scd | gzip -c | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
    scdoc < extra/man/alacritty-msg.1.scd | gzip -c | sudo tee /usr/local/share/man/man1/alacritty-msg.1.gz > /dev/null
    scdoc < extra/man/alacritty.5.scd | gzip -c | sudo tee /usr/local/share/man/man5/alacritty.5.gz > /dev/null
    scdoc < extra/man/alacritty-bindings.5.scd | gzip -c | sudo tee /usr/local/share/man/man5/alacritty-bindings.5.gz > /dev/null
  • Add completions for your shell. Mine is zsh but you can refer their Shell completions section for your respective shell

    mkdir -p ~/.zsh_functions
    cp extra/completions/_alacritty ~/.zsh_functions/_alacritty

    Then, add this line at the end of your shell config file (~/.zshrc):

    fpath+=~/.zsh_functions
  • Reload shell:

    exec $(which $SHELL)
  • Add a custom keyboard shortcut (I set it as Super + T) to launch alacritty command instead of the usual terminal command (was gnome-terminal in Fedora)

  • Your Alacritty settings are kept in ~/.alacritty.toml config file (create one if it doesn't exist) so edit it to personalize your terminal. You can refer my .alacritty.toml file as well as their Configuration page for more options


CLI Utilities

Package Description
fzf Fuzzy finder
bat Colored cat
eza Colored ls
jq Pretty JSON
ripgrep (rg) Regex grep
zoxide (z) Smarter cd

Install those utils via your package manager (For Fedora, it's dnf)

sudo dnf install -y fzf bat jq eza ripgrep zoxide

Watch this video for a quick demo showcase 👇

<iframe width="480" height="270" src="https://www.youtube.com/embed/2OHrTQVlRMg?si=ty6XNzzHYQAW4Qe5" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

More optional utils:

  • Fast, user-friendly find : fd
  • Multiple Runtime version manager : asdf
  • Run arbitrary commands on file change : entr
  • Fix previous command : thefuck
  • Midnight Commander, a visual file manager : mc