logo

gertjanassies.dev


ramblings of a chaotic mind

An opinionated terminal experience

on 2023-02-01 by Gertjan Assies reading time 0 min, viewed 9 times, read 0 times, liked 0 times

An opinionated terminal experience

As I got a new work laptop (Macbook Pro M1) recently, I’ve recorded the steps I did to get it to behave as I want, and hopefully, be a little bit more productive. (I’m very aware of the delicate balance between spending time on being more productive and actually being productive)

It all starts with homebrew. as most of the other stuff is installed via brew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Now I install a font to use within the terminal, that works with the theme I’ll select later

brew tap homebrew/cask-fonts  
brew install font-hack-nerd-font

This is the Powerline Hack font but enhanced with font-awesome icons

Now for the Terminal itself, I like Iterm2 for its configurability and the fact that it can have a screen slide down from the top, much like the terminal in Quake.

After installing, I go to the profiles sections and add a new profile, where I select “Full width, top of the screen in windows -> Style and enable a hotkey (in my case double-tap ctrl)
And in both profiles, I set the font to ‘hack nerd font mono’ and change the dark blue colour to a lighter one, as the darker one is hardly readable on a block background

Now for the shell, I like fish and by installing the oh-my-fish framework I can then add the agnoster theme.

brew install fish
curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish
omf install agnoster

Now I install lsd (ls deluxe) which gives me icons for filetypes and different shades of green depending on how old or new the files are the Hack Nerd font is needed here for the icons

brew install lsd

And I add the following aliases to the aliases.fish file in ~/.config/fish

alias ls='lsd'  
alias ll='lsd -la'

Then I install fig to have the best AI powered autocomplete there is

brew install fig

I also add some helper functions in fish to make life a bit easier, these are just a few examples, I have loads more

function mcd -d "make and change into directory"  
    set -l dir $argv[1]  
    mkdir -p $dir; and cd $dir  
end  
  
function reload -d "reload fish and omf"  
    echo "Reloading fish config"  
    source ~/.config/fish/config.fish  
    echo "Reloading omf"  
    omf reload  
end  
  
function urlencode -d "URL Encode any arguments"  
  perl -MURI::Escape -le "print uri_escape('$argv')"  
end

In the end it looks like this:

terminal screenshot

Hopefully I showed you some things, that might make your commandline experience a bit more pleasurable.

Attribution: Cover Photo by Javardh on Unsplash

Opinions expressed here are my own and not the views of my employer or anyone else, (re)use is free, but quoting the source is appreciated.
This blog is licensed under a Creative Commons Attribution 4.0 International License. © 2023 by Gertjan Assies