Deep in F-dotfiles : zsh package
This post is the first of a serie focused on some cool things stored in my dotfiles. The topical organization of my dotfiles is such that each blog post will be dedicated to a given package. Today we will start with the basics, setup of the shell with the
├── .oh_my.zsh Zsh theme and plugins
│ ├── aliases.zsh
│ ├── config.zsh Configure shell behavior
│ ├── dircolors.256dark Colored ls
│ └── functions.zsh Custom shell functions
└── .zshrc Routine loading all .zsh files
The setup file weights a dozen lines (comments excluded) but has a tremendous impact on my productivity, which is no surprise given that I spend most of my work day in a shell session. I can live without the badass prompt, but I feel the pain when I ssh onto servers and lose my
history-substring-search plugins superpowers.
I don’t use many plugins as I want to keep my prompt snappy, but core zsh is shipped with a bunch of powerful features already.
I use custom bash aliases parsimoniously, I prefer to do things the canonical way. My primary use for aliases is to add default flags that i consider essential to commands like
But nothing fancy here.
That’s where I put settings relative to shell core functions. In particular the
history config is here : the filesize is boosted and the
SHARE_HISTORY attribute makes the history work ok with multiple iTerm opened tabs.
TMOUT setting to
60 seconds so that the hour in my prompt get updated : doing it one per minute does not distract the eye and means you always have current time in prompt even when you’re idle.
Where things get interesting. We have
who commands but the need for
where arise much more frequently :
find . -name \*$1\*
But the one function I would bring with me on a desert island is the one wrapping
ssh command that attaches me to an existing tmux session once connected.
This file is responsible to source all the .zsh files located in my
~/.zsh directory. It’s useful when you want a dotfiles package to alter an environment variable eg
$PATH, you just write a
<package>/.zsh/<package>.env and reinstall the package via
This dynamic sourcing step is what makes F-dotfiles packages installs so seamless.
Any question or insights to share regarding zsh setup ? Please leave a comment.