Last active
August 29, 2015 14:15
-
-
Save msollami/6ccc2e413a77021110ed to your computer and use it in GitHub Desktop.
sollami-zshrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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