Skip to content

Instantly share code, notes, and snippets.

@msollami
Last active August 29, 2015 14:15
Show Gist options
  • Save msollami/6ccc2e413a77021110ed to your computer and use it in GitHub Desktop.
Save msollami/6ccc2e413a77021110ed to your computer and use it in GitHub Desktop.
sollami-zshrc
alias ssh='ssh -YC'
alias ll='ls -lahG --color=auto'
alias gcb='git rev-parse --abbrev-ref HEAD'
alias ..="cd .."
alias ..2="cd ../.."
alias ..3="cd ../../.."
alias ..4="cd ../../../.."
alias ..5="cd ../../../../.."
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."
function mcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
function mygrep { grep -rnIi "$1" . --color; }
function c () {
cd "$@" && ls
}
# a visual recursive list of all files and directories
function tree()
{
find . | sed -e 's/[^\/]*\//|--/g' -e 's/-- |/ |/g' | $PAGER
}
# recursive text search (ack is also nifty)
function f()
{
find . -name '*' | xargs grep -l $1
}
# recursive search and replace (ignoring hidden files and dirs), example: replace foo bar
function replace()
{
find . \( ! -regex '.*/\..*' \) -type f | xargs perl -pi -e "s/$1/$2/g"
}
function print_and_eval() {
echo "\e[0;37m$1\e[0m"
eval $1
}
function gpull() { print_and_eval "git pull origin $(gcurrbranch)" }
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment