zshrc: Add prompt
This commit is contained in:
		
							
								
								
									
										22
									
								
								shrc/zshrc
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								shrc/zshrc
									
									
									
									
									
								
							| @@ -9,15 +9,33 @@ HISTFILE=~/.histfile | |||||||
| HISTSIZE=1000 | HISTSIZE=1000 | ||||||
| SAVEHIST=1000 | SAVEHIST=1000 | ||||||
|  |  | ||||||
| setopt appendhistory autocd extendedglob nomatch prompt_subst | setopt appendhistory autocd extendedglob nomatch | ||||||
| unsetopt beep notify | unsetopt beep notify | ||||||
| bindkey -v | bindkey -e | ||||||
|  |  | ||||||
|  | # Partial history matching | ||||||
| bindkey '\e[A' history-beginning-search-backward | bindkey '\e[A' history-beginning-search-backward | ||||||
| bindkey '\e[B' history-beginning-search-forward | bindkey '\e[B' history-beginning-search-forward | ||||||
|  |  | ||||||
|  | # Set up styling | ||||||
| zstyle :compinstall filename '/home/salt/.zshrc' | zstyle :compinstall filename '/home/salt/.zshrc' | ||||||
|  |  | ||||||
|  | # Completion | ||||||
| autoload -Uz compinit | autoload -Uz compinit | ||||||
| compinit | compinit | ||||||
|  |  | ||||||
|  | # The prompt | ||||||
|  | autoload -Uz promptinit | ||||||
|  | setopt prompt_percent | ||||||
|  | if [ "$SSH_CLIENT" = "" ]; then | ||||||
|  | 	PROMPT="[%F{blue}%~" | ||||||
|  | else | ||||||
|  | 	PROMPT="[%F{red}%B%m%b:%~" | ||||||
|  | fi | ||||||
|  | PROMPT="$PROMPT%f]%(0?..%F{red}?%f)%(!.%F{red}#%f.%F{green}$%f) " | ||||||
|  | promptinit | ||||||
|  |  | ||||||
|  | # Source .profile | ||||||
| if [[ -f "$HOME/.profile" ]]; then | if [[ -f "$HOME/.profile" ]]; then | ||||||
| 	source "$HOME/.profile" 2>& /dev/null | 	source "$HOME/.profile" 2>& /dev/null | ||||||
| fi | fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user