adds autoCD into most recent directory and debug function
When cding into a directory, the path is saved in ~/.current-folder ZSHRC then cds into this folder if the file exists and not in a tmux session Also added a function debug to functions which will toggle the value of wp-debug in wp-config
This commit is contained in:
		
							parent
							
								
									f1b9bda888
								
							
						
					
					
						commit
						e8b2b2e541
					
				
					 2 changed files with 20 additions and 2 deletions
				
			
		|  | @ -34,11 +34,14 @@ function old() { | ||||||
| 	mv "$1" "$1.old" | 	mv "$1" "$1.old" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function cdlc() { | function cdls() { | ||||||
| 	cd "$@" | 	cd "$@" | ||||||
|  | 	if [ ! $TMUX ]; then | ||||||
|  | 		pwd > ~/.current-folder | ||||||
|  | 	fi | ||||||
| 	ls | 	ls | ||||||
| } | } | ||||||
| alias cd="cdlc" | alias cd="cdls" | ||||||
| 
 | 
 | ||||||
| function mkcd() { | function mkcd() { | ||||||
| 	mkdir -p "$1" | 	mkdir -p "$1" | ||||||
|  | @ -184,6 +187,16 @@ function themes() { | ||||||
| 	fi | 	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           ## | ##         Search Functions           ## | ||||||
|  |  | ||||||
|  | @ -86,3 +86,8 @@ source $ZSH/oh-my-zsh.sh | ||||||
| # alias ohmyzsh="mate ~/.oh-my-zsh" | # alias ohmyzsh="mate ~/.oh-my-zsh" | ||||||
| 
 | 
 | ||||||
| source ~/.dotfiles/shells/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | source ~/.dotfiles/shells/zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh | ||||||
|  | 
 | ||||||
|  | if [ -f ~/.current-folder ] && [ ! $TMUX ]; then | ||||||
|  | 	cd "$(cat ~/.current-folder)" | ||||||
|  | 	clear | ||||||
|  | fi | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue