Learn Docker With My Newest Course

Dive into Docker takes you from "What is Docker?" to confidently applying Docker to your own projects. It's packed with best practices and examples. Start Learning Docker →

I Recently Switched to Zsh and Created a Dotfiles Install Script

blog/cards/i-recently-switched-to-zsh-and-created-a-dotfiles-install-script.jpg

I made the switch from Bash to Zsh, and with that I made a dotfiles install script that works on most Linux distros and macOS.

Quick Jump: Demo Video

I feel like I’m about 5 years late to a really good party. I’m just getting started with Zsh but here’s a few plugins and Zsh features that I enjoyed minutes after getting set up with Zsh.

With this new addition to my dotfiles, I also created an install script that fully works on any Debian / Ubuntu based distro of Linux (native or WSL), macOS and with 1 manual step it’ll also work on any other Linux distro.

Demo Video

Commands

If you don’t want to run the installer on your dev box right away you can try it out in Docker:

$ docker container run --rm -it debian:buster-slim

# [Everything listed below is expected to be run in this container]

# We only need to do this inside of Docker since sudo / curl aren't installed by default:
$ apt-get update && apt-get install sudo curl

# This is all you would have to run if you weren't using Docker:
$ bash <(curl -sS https://raw.githubusercontent.com/nickjj/dotfiles/master/install)

# [Answer a few questions from the script]

# These steps are only necessary due to a few limitations of Docker:
$ zsh
$ source ~/.config/zsh/.zprofile
$ source ~/.config/zsh/.zshrc

Just a heads up, a couple of colors are off due to running things in Docker. It’s all good once it’s installed in a non-Docker environment.

Timestamps

  • 0:46 – I should have switched to Zsh a long time ago
  • 1:52 – An updated prompt that shows if the last command failed
  • 3:03 – A quick peek at my .zshrc
  • 6:30 – Creating a tiny Bash script to manage Zsh plugins
  • 7:31 – The new install script
  • 8:17 – Running the script inside of a Docker container to test it
  • 9:44 – Curling down the install script and running it
  • 11:17 – Picking where you want to clone my dotfiles to
  • 11:54 – Installing a few things and prompting you before it creates symlinks
  • 13:47 – Installing asdf and Node (required by the Markdown preview Vim plugin)
  • 14:06 – Programmatically installing Vim and tmux plugins from the command line
  • 15:52 – Verifying everything works (it’s a bit clunky within Docker)
  • 18:39 – Found a bug or a way to improve things? Please let me know

Are you using Zsh? What’s your favorite plugins and settings? Let me know below.

Never Miss a Tip, Trick or Tutorial

Like you, I'm super protective of my inbox, so don't worry about getting spammed. You can expect a few emails per month (at most), and you can 1-click unsubscribe at any time. See what else you'll get too.



Comments