Blog

The thoughts, opinions, happenings, and just plain ramblings of a seemingly boring person.

Open-Sourcing My .bashrc File on GitHub

gitprompt_Lucas_bullettrain_tags I've posted some pretty nerdy things on this blog over the years, but this would have to be one of the nerdiest things I've ever posted.

I use a Linux operating system on my work laptop (Fedora, to be precise). We're now fairly entrenched in a git workflow for the documentation we write: asciidoc(tor)-based source, and GitLab CE or GitHub as the hosted VCS.

For the non-uber-tech-savvy: because of the git workflow (amongst other things), I spend a lot of time running commands in a bash shell (or command prompt). One of the files that controls the settings for this prompt is .bashrc. It allows me to add additional scripts and functions to my bash shell, as well as define things like aliases (shortcuts to execute other commands).

In the spirit of open source (and as a good backup 😉 ), I am publishing my .bashrc file on GitHub.

I am also publishing my custom theme files for the bash-git-prompt script which I use to show git repository status at the bash prompt. The most recent one is for a dark background (shown above), and is inspired by the bullet train theme for oh-my-zsh. I was thoroughly impressed by the original bullet train theme after seeing it on Martin's shell, but I didn't really like oh-my-zsh enough to change away from a normal bash shell (one reason being no apparent support for showing numbers of modified/staged/untracked files at the prompt, amongst other things). So I made a bash-git-prompt look-alike theme to be bash compatible (don't ask how long it took :S). The other theme (also shown below), is my original one-line light background theme that I used for a while.

Also, although I'm tempted by regular zsh, unfortunately bash-git-prompt doesn't seem to work with it.

gitprompt

These have been helpful for other people, so feel free to copy/clone/use them for yourself. If you have any tips or tricks on how you use your shell, please share them!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.