My home directory, versioned. This includes my dotfiles, vim configuration, and a few other utilities.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.config
.home
.local/share/applications
.oh-my-zsh
.tmuxp
.vim
opt
.Xmodmap
.bash_aliases
.bash_completion
.bash_env
.bash_functions
.bash_prompt
.bashrc
.gitconfig
.gitignore
.gitmodules
.hgrc
.pgpass
.profile
.pythonstartup.py
.screenrc
.tmux.conf
.vimrc
.zshrc
PACKAGES
README.rst
fabfile.py
requirements.txt

README.rst

My dotfiles and $HOME

Cloning

In your $HOME, do this:

git init .
git remote add -t \* -f origin git@github.com:amontalenti/home.git
git checkout master

You may hit conflicts with your existing .bashrc or .profile. Just move those to another directory and let it run.

Shell

I use zsh. For years, I used bash out of habit. I still keep my .bashrc and associated bash files around, for the rare case where I'm forced to use bash.

My bash environment is covered in these files:

file description
~/.bashrc pulls everything together
~/.bash_aliases handy shortcuts
~/.bash_env sets up my environment the way I like
~/.bash_functions when an alias doesn't cut it

With zsh, I took a different approach. I have a simple .zshrc that implements the equivalent of .bash_env, and then my prompt is implemented via an oh-my-zsh theme that outsources most of its work to a Python script called zshprompt.

file description
~/.zshrc pulls everything together
~/.oh-my-zsh/themes/am.zsh-theme theme that provides my left and right prompt
~/opt/bin/zshprompt Python script to generate prompt
~/.bash_functions I use these across zsh and bash
~/.bash_aliases I use these across zsh and bash

The zshprompt script supports shortened paths, git branches, Python virtualenvs, and last process exit code. Here is what it looks like:

zshprompt

Here's the guide:

  • path = ~/repos/ptrack/streamparse
  • virtualenv = ptrack+streamparse
  • branch = feature/visitor-metrics

The right prompt auto-hides when you are writing a long command, and the path compresses uses a shortening approach (thus ~/r/p/streamparse). You can also see the exit status of 1 in red of the false command.

Editor

I use vim for text editing. I tend to use vim for editing all sorts of files, including:

  • Python
  • JavaScript
  • CSS and LESS
  • Clojure
  • JSON and XML
  • reStructuredText
  • Markdown
  • bash
  • Dockerfile
  • Thrift files
  • configuration files

My vim configuration is a bit customized, as I use vim as a kind of UNIX IDE. However, I don't go crazy remapping things; in general, I'm pretty happy with vim's default mappings and have learned to love them. Most of these customizations are just to make editing typical files for me nicer.

Some nice IDE-like plugins for me include:

I then have a couple of plugins that just expand the vim vocabulary a little. These include:

  • repeat, just makes the . command more flexible and scriptable
  • surround, adds a noun to vim for "surroundings", useful for quoting and parens

These are referenced via git's submodule facility, because this seemed like the cleanest thing. Therefore, after cloning this repo, make sure you also clone the submodules as such:

git submodule init
git submodule update

Then you will have all of the above.

Terminal and Editor Colors

In vim, I use the Mustang color scheme. Yes, I know about Solarized, and yes, I recognize that it is this new hotness with all of its fancy marketing pages, but honestly that color scheme will make me blind or make me want to murder my computer.

Mustang uses nice muted colors while still having enough contrast for scanning big chunks of code. I think it's very zen hacker like.

In tmux and screen, I use a matrix-like green-on-black color scheme. I do this so I can intimidate Parse.ly interns and make them think that learning UNIX will rewire their brain.

Unfortunately, there is some trickery with UNIX color schemes for terminals.

The first thing you have to learn about is that most terminals do not automatically place themselves in 256 color mode -- of course, they should, but this is UNIX. The software is Free and your time is worthless.

The answer is to be very mindful of two parts of your environment that will dramatically affect the way colors display. These are:

  • TERM environmental variable
  • Color palette of your terminal emulator

Let's cover these in turn. The TERM environmental variable should be xterm-256color. Except when it shouldn't, which is when it's running under tmux or screen (of course). In these environments, it should be screen-256color. If this isn't set appropriately, programs like vim won't use your fancy color scheme and you will be sad.

Finally, the color scheme will render differently depending on your color palette. What's going on here is that your terminal emulator can translate the colors being generated by vim and other programs, and translates them to actual pixel colors on your screen. (It's just yet another level of indirection.) I find that most of the default palettes are way too bright and loud. With gnome-terminal (Linux) and iTerm (OS X), I have been picking the Tango palettes, which are a tad muted and relatively standard across platforms.

Scripts

I put some scripts in ~/opt/bin that just make my life easier. Most of these are bash scripts, some are little Python scripts as well. Some of these are just meant to work around some UNIX annoyances.

Terminal Management

Originally, I used GNU screen for all my terminal management, so my .screenrc is included here. However, I have now switched to tmux, since I came across a nice book about it and it convinced me. Funny enough, I was able to port over most of my customizations of screen to tmux pretty straightforwardly. See .tmux.conf for that.

I also use a clever little tool called tmuxp, which is a Python frontend on tmux which allows you to save / re-open tmux "sessions".

Version Control

I used to use Mercurial, now I primarily use git. I don't customize these too heavily, but my .hgrc and .gitconfig are included here anyway.