Skip to content
forked from twe4ked/dotfiles

Very simple, well commented dotfiles (bash, zsh, oh-my-zsh, osx)

Notifications You must be signed in to change notification settings

yelsa/dotfiles-2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

To install, in terminal navigate to your home folder and run git clone http://github.com/twe4ked/dotfiles.git .dotfiles to pull down these files.

Next, open your ~/.profile in a text editor and add the following at the bottom. If you don’t have a ~/.profile simply create one and it will automatically be run by terminal.app when each time you run it.

# Contents of ~/.profile
if [ -e ~/.dotfiles ]; then
  . ~/.dotfiles/config
fi

Setup symlinks for .irbrc ln -s ~/.dotfiles/lib/irbrc .irbrc # Setup .irbrc symlink (command must be run from your home folder)

zsh specific
Install oh-my-zsh wget http://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

Setup symlinks for my.zsh-theme:
ln -s ~/.dotfiles/zsh/zsh-theme my.zsh-theme # Setup my.zsh-theme symlink (command must be run from ~/.oh-my-zsh/themes)

Remove ~/.zshrc and replace with a symlink to the custom version:
ln -s ~/.dotfiles/zsh/zshrc .zshrc # Setup .zshrc symlink (command must be run from ~/)

oh-my-zsh is a community-driven framework for managing your zsh configuration.

Basic features

  • Custom functions
  • Hints file
  • Bash and zsh compatible
  • Great looking and very helpful prompt
    • Git stashes
    • Git Branch
    • Git status
    • RVM info
    • Time
    • Custom current working directory shortener [bjeanes]
    • Only show user@hostname when needed
    • Battery level indicator

Config

This file loads the rest of the config and also acts as a place to put major items.

  • Search /Sites folder on ‘cd’ command
  • Set textmate as default editor
  • Make git colourful
  • Sets title of window to be user@host
  • .irbrc to make irb awesome (view framework/syntax highlighting/tab-completions/pretty-print/auto tab indentation).
  • Sources MOTD
    • Prints current shell
    • Shows random hint

Prompt

What you have to look at all day.

[~/.dotfiles (git-branch)] » user@hostname (bash)
[~/.dotfiles] » user@hostname (zsh) (rvm) ± (master*) 1+ [19:30] ⚡

The ⚡ symbol changes colour based on battery levels.
1+ is the number of git stashes
user@hostname only displays when user = root or connected over ssh

Aliases

Main

dotfiles/aliases/aliases

  • ‘et’ = Open current folder with textmate
  • ‘eprof’ = Edit these files
  • ‘reload’/‘sprof’ = Reload these files
  • ‘pubkey’ = Copy pub keys to clipboard
  • ‘gi’ = Gem install with sudo at the front and without including ri and rdoc
  • ‘show_hidden’ = Show hidden files in Finder
  • ‘hide_hidden’ = Hide hidden files in Finder
  • ‘o.’ = Open the current directory
  • ‘hints’ = Show hints
  • ‘tmbundles’ = Go to textmate bundles folder

Rails aliases

dotfiles/aliases/rails

# Rails stuff
alias logs='tail -f -0 ./log/*.log'
alias migrate='rake db:migrate'
alias rollback='rake db:rollback'
alias r='rake'

# Rails 3 aliases with backwards compatibility
alias ss="[ -e script/server ] && script/server || rails server"
alias sc="[ -e script/console ] && script/console || rails console"
# Generate aliases
alias model="[ -e script/generate ] && script/generate model || rails generate model"
alias controller="[ -e script/generate ] && script/generate controller || rails generate controller"
alias migration="[ -e script/generate ] && script/generate migration || rails generate migration"

Git aliases

dotfiles/aliases/git

alias gst='git status'
alias gl='git pull --rebase'
alias gp='git push'
alias ga='git add'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gb='git branch'
alias gbc='git branch --color'
alias gba='git branch -a'
alias gco='git checkout'
alias gdc='git-svn dcommit'
alias gk='gitk --all &'
alias gitlog='git log --oneline --decorate --graph'

# Push to Heroku
alias gph='gp heroku'

# Show git config
alias gitconfig='cat .git/config'
# Edit git config
alias egitconfig='mate .git/config'

# Alias for opening GitX
alias gitx="open -b nl.frim.GitX"

Other interesting things

m path/to/project
If no arguments are supplied open the current folder with TextMate

o path/to/project
Use ‘o’ instead of ‘open’ (o ~/Sites will open the sites folder), if no arguments are supplied open the current folder,

Restart passenger server

rp looks for a tmp directory, if there is no tmp directory it prompts you to create one, once it finds a tmp directory it touches tmp/restart.txt to tell passenger to restart.

Hints

There is a random hint taken from lib/hints.txt inserted into the motd each time it is run. You can show all hints by running the following alias:
alias hints='cat ~/.dotfiles/lib/hints.txt' # Show hints

Bash specific

  • Ignore case in auto complete
  • Removes the bell
  • Automatically show completion without double tab-ing

Github function

To use supply a minumum of two arguments; username, repository name
Supply a third argument to specify what folder you want to project to be cloned into
git clone http://github.com/[argument 1]/[argument 2] [argument 3]

github twe4ked dotfiles .dotfiles

Supported

  • HIRB – A mini view framework for console/irb. Console goodies include a no-wrap table, auto-pager, tree and menu.
  • WirbleIRB syntax highlighting
  • oh-my-zsh is a community-driven framework for managing your zsh configuration.

Based on work by bjeanes

To Do

  • Only load battery.py on macbook

About

Very simple, well commented dotfiles (bash, zsh, oh-my-zsh, osx)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published