Skip to content

Latest commit

 

History

History
153 lines (108 loc) · 6.82 KB

File metadata and controls

153 lines (108 loc) · 6.82 KB

Turn your $SHELL into a beautiful $HOME

Repository for the MSD group meeting about sexy shell configurations given on 2024-04-25 by Julian Geiger at PSI.

Installation instructions via docker

To take it for a spin, clone the repo, install Docker and Docker Desktop, and fire both up. Then, from inside the repo, run:

docker buildx build -t msd-gm-docker -f Dockerfile .

Now, feel free to grab a ☕... this is gonna take a few minutes. Once your image is built, run the container via:

docker run -it msd-gm-docker

or attach it to VSCode via the Docker VS Code extension.

Tip: If you want to skip the build process, you can also directly run it by using the container registry of this repo via:

docker run -it ghcr.io/geigerj2/msd-gm-shell:latest

which will automatically pull the image in the background (thanks, @unkcpz!).

You are now ready to explore your beautiful new $HOME.

What the fuzz is about

Today, we will go on a journey from:
to:
Because why spend half an hour on a task, when you can spend half a day automating it?

So buckle up!

The $HOME decor

When the container starts up, you will find a running Ubuntu 22.04 instance with working bash, zsh, and fish installations. We will explore their configurations - in this order - with increasing time dedicated to each $SHELL. The main tools that are set up are the following:

Turn-key solutions

  • oh-my configs → Custom configuration frameworks created by the community (themes, plugins, etc.):
  • Prompt customization frameworks:
    • Sorry, seems like no comparable tool exists for bash 😢
    • Powerlevel10k for zsh (to avoid having to run the interactive configuration, my .p10k.zsh file is part of this repo)
    • Tide for fish:
      • As a little teaser, let's actually go ahead and install that right now via:
      fisher install ilancosman/tide@v6
      

→ Which also gives me an excuse to use fish from now on 😁

Tools I cannot live without

  • tmux → Terminal multiplexer (my personal config is part of this repo)
  • atuin → Replaces your shell history with an SQLite database (synchronizes between computers 😉)
  • zoxide → Creates a database of your visited paths
    • Or, alternatively z (pure fish implementation)

More shell candy

  • exa → "Modern replacement for ls" (more symbols!)
    • exa archived → eza
  • bat → "A cat clone with wings" (and syntax highlighting 😉)
  • entr → Run arbitrary commands on file changes
  • git plugins for zsh (part of oh-my-zsh) and fishplugin-git

Why you should use Fish

  • It underlines existing paths/files → No more "no such file or directory"
  • Neat autosuggestions (to be fair, this plugin achieves the same in zsh)
  • Then, let's check out fish_config
  • Interactive CLI command/options search
  • Cherry on top → fzf fish plugin
    • Based on fzf → Command line fuzzy finder
  • And a shameless self-promotion of my aiida fish plugin 🚀

(even more fish)

A caveat

  • fish not POSIX compliant (unlike bash and zsh) → Different (but, I would argue, better) syntax
  • Different configuration (setting environment variables, defining functions, no ~/.fishrc file)

→ If you don't want to enter this rabbit hole, stay with zsh for now (or use my Dockerfile 😇)
→ But, you can always enter other shells, or execute scripts with bash <your-script>.sh

Honorable mentions (mileage may vary)

  • gh → GitHub CLI and gh act → run GitHub actions locally (sorry for all the failed CI activity, @sphuber 😢)
  • fd → "A simple, fast and user-friendly alternative to find"
  • ripgrep → Fast, recursive terminal regex search
  • lazygit → Terminal git UI for keyboard warriors
  • gdu → Disk usage analyzer
  • bottom → "Yet another cross-platform graphical process/system monitor"
  • AstroNvim(neo)vim on steroids (don't worry, beloved VSCode - you will never be replaced)
    • Good to learn some of the nitty-gritty details, but I discourage trying to customize that yourself, as you'll literally need to learn a (probably) new language (Lua)
AstroNvim screenshot

Acknowledgements

GPT4, GitHub copilot, Pol Sanz → ,

the software-treats Slack channel of the Nuria Lopez Group (ICIQ), and all of you for listening to this rant.