Created
February 27, 2020 16:49
-
-
Save shiqimei/7e4895fd0f9f3a2f03921f4dbedf135b to your computer and use it in GitHub Desktop.
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
source /etc/bash_completion | |
shopt -s histappend | |
HISTSIZE=1000 | |
HISTFILESIZE=2000 | |
shopt -s checkwinsize | |
case "$TERM" in | |
xterm-color|*-256color) color_prompt=yes;; | |
esac | |
git() { proxychains4 -q /usr/local/bin/git "$@"; } | |
cd() { builtin cd "$@"; ls; } | |
rm() { | |
day=`date +"%Y-%m-%d"`; | |
time=`date +"%H%M%S"`; | |
mkdir -p ~/.Trash/$day/$time; | |
for item in "$@"; do | |
if [[ "$item" != "-r" ]] && [[ "$item" != "-f" ]] && [[ "$item" != "-rf" ]]; then | |
mv $item ~/.Trash/$day/$time/ | |
fi | |
done | |
} | |
code() { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} | |
log() { bash -c "$@ 2>&1 | gsed -ur 's/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g;' | tee ~/.log"; } | |
meteor() { log meteor "$@"; } | |
new() { | |
pre_path=`pwd` | |
post_path='/Users/lolimay/Code/Web/blog/source/_posts' | |
builtin cd /Users/lolimay/Code/Web/blog/source/_posts | |
hexo new "$@" | |
code $post_path | |
builtin cd $pre_path; | |
} | |
sa() { browser-sync start --server --files '*.js, *.css, *.html' "$@"; } | |
volume() { sudo osascript -e "set Volume $@"; } | |
alias cd..='cd ..' | |
alias web='cd /Users/lolimay/Code/Web' | |
alias cdcode='cd /Users/lolimay/Code' | |
alias code.='code ./' | |
alias cls='clear' | |
set -o vi | |
stty -ixon | |
export PS1="" | |
# Colors | |
export EDITOR=vim | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
export PATH="$PATH:/Users/lolimay/Library/Python/3.7/bin" | |
export JAVA_HOME="/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home" | |
export JIRA_HOME="/Users/lolimay/Jira" | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" | |
export LC_ALL=en_US.UTF-8 | |
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 | |
if [[ $TERM != *"screen"* ]]; then tmux; fi | |
if type ag &> /dev/null; then | |
export FZF_DEFAULT_COMMAND='ag -p ~/.gitignore -g ""' | |
fi | |
if type rg &> /dev/null; then | |
export FZF_DEFAULT_COMMAND='rg --files --hidden' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment