67 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			67 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
#!/bin/bash
 | 
						|
 | 
						|
alias q='exit'
 | 
						|
alias clr='clear'
 | 
						|
alias catn='cat -n'         # cat + line numbers
 | 
						|
# Allow sudo with aliases
 | 
						|
alias sudo='sudo '
 | 
						|
alias ls='ls -G'
 | 
						|
alias l='ls -o'
 | 
						|
alias la='ls -AGFoh'
 | 
						|
 | 
						|
# Command fixes
 | 
						|
alias ln="${aliases[ln]:-ln} -v"    # verbose ln
 | 
						|
alias wget='wget -c'                # Resume download if possible
 | 
						|
alias rsyncd='rsync -va --delete'   # Hard sync two directories
 | 
						|
 | 
						|
# Shortcut for git
 | 
						|
is-callable hub && alias git='hub'
 | 
						|
g() { [ $# -eq 0 ] && git status --short || git $* }
 | 
						|
 | 
						|
alias gi='git init'
 | 
						|
alias ga='git add'
 | 
						|
alias gap='git add --patch'
 | 
						|
alias gc='git commit --verbose'
 | 
						|
alias gcm='git commit --verbose -m'
 | 
						|
alias gco='git checkout'
 | 
						|
alias gcl='git clone'
 | 
						|
alias gp='git push'
 | 
						|
alias gpl='git pull'
 | 
						|
alias gb='git branch'
 | 
						|
alias gt='git tag'
 | 
						|
alias gs='git status --short'
 | 
						|
alias gS='git status'
 | 
						|
alias gr='git reset "HEAD^"'
 | 
						|
alias gd='git diff'
 | 
						|
 | 
						|
if is-callable 'tmux'; then
 | 
						|
    alias t='tmux'
 | 
						|
 | 
						|
    # Start new session or create a grouped session so I'm not simply watching
 | 
						|
    # the same session in both windows.
 | 
						|
    alias ta='tmux new -s $(hostname) || tmux new -t $(hostname) -s $(hostname)-2 || tmux attach -t "io-2"'
 | 
						|
 | 
						|
    function ts {
 | 
						|
        tmux send-keys "$*"
 | 
						|
    }
 | 
						|
 | 
						|
    alias tls='tmux ls'
 | 
						|
    # New instance attached to old session
 | 
						|
    alias tn='tmux new-session -t "x"'
 | 
						|
fi
 | 
						|
 | 
						|
alias va='vagrant'
 | 
						|
alias rk='rake'
 | 
						|
alias rkg='rake -g'
 | 
						|
 | 
						|
# Interpreters
 | 
						|
alias rb='ruby'
 | 
						|
alias rbe='rbenv'
 | 
						|
alias b='bundle'
 | 
						|
alias be='bundle exec'
 | 
						|
alias bi='bundle install --path vendor'
 | 
						|
 | 
						|
alias py='python'
 | 
						|
alias pye='pyenv'
 | 
						|
alias pyi='ipython'
 |