diff --git a/shells/functions b/shells/functions index a899691c..a72a689e 100644 --- a/shells/functions +++ b/shells/functions @@ -34,11 +34,14 @@ function old() { mv "$1" "$1.old" } -function cdlc() { +function cdls() { cd "$@" + if [ ! $TMUX ]; then + pwd > ~/.current-folder + fi ls } -alias cd="cdlc" +alias cd="cdls" function mkcd() { mkdir -p "$1" @@ -184,6 +187,16 @@ function themes() { fi } +function debugToggle(){ + public_html=${PWD%/public_html*}/public_html + if [ -d $public_html ]; then + current=$(egrep "'WP_DEBUG'" "$public_html/wp-config.php" | egrep -o "(true|false)") + [[ $current == true ]] && newvalue=false || newvalue=true + sed -i "s/'WP_DEBUG'.*/'WP_DEBUG', $newvalue\)\;/g" "$public_html/wp-config.php" + echo "WP_DEBUG is now $newvalue"; + fi +} + ######################################## ## ## ## Search Functions ## diff --git a/shells/zsh/zshrc b/shells/zsh/zshrc index 63b76915..9f5a43fb 100644 --- a/shells/zsh/zshrc +++ b/shells/zsh/zshrc @@ -86,3 +86,8 @@ source $ZSH/oh-my-zsh.sh # alias ohmyzsh="mate ~/.oh-my-zsh" source ~/.dotfiles/shells/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + +if [ -f ~/.current-folder ] && [ ! $TMUX ]; then + cd "$(cat ~/.current-folder)" + clear +fi