Shell configuration

What is a shell?

Shell configuration files

Commonly used shell config locations:

  • ~/.bashrc
  • ~/.zshrc
  • ~/.config/fish/

.bashrc

This is where bash configs live.

.zshrc

Similar to .bashrc, also where configs live, but with a slightly different syntax.

Shell prompts

These are a few shell prompts:


Shell prompt Customization

  • Manual configuration
  • Templates from web
    • use an online generator
    • copy someones "dotfiles"
  • Extensions

Starship prompt

  • Starship is a rust-based cross platform prompt
    • Requires installing starship on each device
  • Config in a toml file

Terminals

Terminals effect many things:

  • Fonts
  • Colors
  • Ligatures
  • and many more features

Fonts

  • Many configs make use of fonts with fancy characters (nerdfonts)
  • Installed on end machine and selected in the terminal application
  • Monospaced fonts are good for terminals

Fonts cont.

  • Some fonts include ligatures
  • Common fonts:
    • Cascadia Code / Cascadia Cove
    • Fira Code / FiraCode Nerd Font
    • Iosevka

Shell extensions/plugins

  • Some people may want extensions that add features or themes
  • Often this is done via an plugin manager
    • oh-my-zsh (omz) for zsh
    • oh-my-bash? for bash
    • fisher for fish
  • Plugins can offer things like:
    • Advanced autocomplete
    • Integration with other tools (password manager, etc.)
    • Preset keybindings

My recommendations

Minimal:

  • should use minimal to no plugins
  • one .bashrc file (to make copying to new machines easy)
  • aliases for git commands
  • aliases for ls
  • history-based autocomplete with arrow keys
  • show git status in prompt
  • does not need nerdfonts/ligatures to be readable

My recommendations cont.

Maximal:

  • Can be as large as desired (until it impacts performance noticeably)
  • Use plugins for commonly used tools
    • Password manager
    • git
    • aws cli
  • theme that utilizes special fonts
  • aliases for ls and other commands
  • better fuzzy search (fzf)

Other command line utilities

Alternatives for standard commands:

  • bat fancy cat alternative
  • fd fast find alternative
  • fzf cli fuzzy finder
  • tldr condensed examples, like man
  • exa alternative to ls
  • lsd alternative to ls
  • ripgrep/rg alterative to grep

Demo: `.bashrc` from my flip

Demo: my `.zshrc`

https://wiki.archlinux.org/title/Bash/Prompt_customization

DEMO: bash prompt creation

DEMO: my prompt + config

Terminals will be a sperate talk

DEMO: my zsh plugins