dotfiles
dotfiles copied to clipboard
My dotfiles, including configuration for zsh, tmux, psql
dotfiles
This includes my configuration for ZSH, git, psql, irb, tmux and others.
Requirements
- git
- make
Install
To set up all of the files as symlinks in your home directory, just run this:
make all
ZSH
ZSH is set up to have full completion for killing processes, cd-ing to a
directory, ssh-ing to known hosts and other stuff.
Keybindings
The Vim keybindings are activated by default. Plus some non-Vim keybindings:
Ctrl-Rto search back in ZSH history incrementally.Ctrl-Sto search forward in ZSH history incrementally.Ctrl-Yto accept a search result.Ctrl-Pto go back in history.Ctrl-Nto go forward in history.Ctrl-Ato go to the beginning of the line.Ctrl-Eto go to the end of the line.Ctrl-Qto push the current line onto the stack to run a new command.
Aliases
Some aliases that are set up:
hs- Search through ZSH history.tma- Attach to a running a tmux session.tmn- Create a new tmux session.fazz- Usefzzwithag.fizz- Usefzzwithfind.
There are also shortcuts for the most commonly used git subcommands and other stuff.
Aliases that only work on Linux, or only work on OS X, are in
zsh.d/aliases.Linux.sh and zsh.d/aliases.Darwin.sh respectively and sourced
automatically.
Functions
Some functions defined in zshrc:
mkdircd- Create a directory andcdinto it.serve- Serve the current directory with Python's SimpleHTTPServer.gifs3- Push a gif to S3 and copy the resulting URL to the clipboard.vimfzz- Runfzzwithagand open the results in Vim.cdzz- Find files withfzzandfind, thencdinto the first resulting directory.
Prompt
The ZSH prompt shows the current directory, the current git branch, whether the git branch is dirty or not.
The prompt also shows whether a background job is running in the current session or not. Here it is without a background job and a dirty directory:

Here is the prompt after Vim has been suspended with Ctrl-Z:

The setup here allows me to define a new color for the current directoy on each
machine I clone this repo to, by adding the file zsh.d/dir_info_color.

Environment
Vim is set up as the default editor in psql with PSQL_EDITOR, so
it starts when \e is used in psql.
The delay for key combinations is redureced with KEYTIMEOUT. EDITOR is, of
course, Vim.
Go is also set up. As is the PATH.
Platform-dependent environment variables are set up in zsh.d/env.Linux.sh and
zsh.d/env.Darwin.sh.