Zsh


Customizing your zsh prompt via themes

This post intends to give a great start to customizing your prompt, that thing you’re looking at all day whilst cruising the depths of linux ;P If you use oh-my-zsh or any one of the other frameworks, it’s quite easy to not care and just chose one of the provided themes. Below I’ll talk about some cool projects and sources of content for managing themes in your prompt. Antigen It’s even easier to dynamically switch themes using antigen, an open-source project which manages grabbing plugins and themes from github.

Continue reading ↦

Changing your iTerm2 window title

For zsh, I decided I wanted to simply add a line to my zshrc file to set the window title for iTerm2 to $(hostname) of the box I was currently logged in to: echo -ne "\e]1;${(hostname)}\a" Yes, its that easy:) Looking a little further into the superuser question. it appears theres another way that works for both bash and zsh and, by the author’s note: This way you can immediately see what host you’re connected to in what window, and the window title for each tab shows user & CWD.

Continue reading ↦

ZSH Arrays and you

So after fighting with zsh for a bit, it seems there is never, ever, a 0 element in zsh arrays. All arrays start populating at element 1 i.e $array[1] Here is some example code to help ya populate and pilfer through an array of elements if its got at least one element: # the following ssh command will return location of each loaded key. for this example, we only have one key loaded.

Continue reading ↦

I really wanted terminal printing to be in color

Yeah. ccze. is awesome! I really wanted to use it across my systems and with all applicable commands like head, tail, cat, etc.. So I wrote a zsh function to check if the command exists and utilize it. This was kind of a pain because of the corner cases (people using pipes or redirection with the command etc..) Through it all, I created two new commands, catless and tacless. Read some of the comments to find why.

Continue reading ↦