mirror of
				https://github.com/akelge/vim
				synced 2025-11-03 23:14:25 +00:00 
			
		
		
		
	Repo aware prompt
This commit is contained in:
		@ -19,5 +19,8 @@ autoload -U bak
 | 
				
			|||||||
# fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false
 | 
					# fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false
 | 
				
			||||||
autoload -U fancyTerm
 | 
					autoload -U fancyTerm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# repo_char - returns a character based on the type of repo we are in
 | 
				
			||||||
 | 
					autoload -U repo_char
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#  vim: set ts=4 sw=4 tw=0 ft=zsh : 
 | 
					#  vim: set ts=4 sw=4 tw=0 ft=zsh : 
 | 
				
			||||||
 | 
				
			|||||||
@ -4,14 +4,14 @@ if `fancyTerm`; then
 | 
				
			|||||||
    I="%m::%."
 | 
					    I="%m::%."
 | 
				
			||||||
    # L="$FX[bold]$FX[italic]$BG[111]$FG[239]@%m::%2~ $BG[000]
 | 
					    # L="$FX[bold]$FX[italic]$BG[111]$FG[239]@%m::%2~ $BG[000]
 | 
				
			||||||
# $FG[228]%#$FX[reset] "
 | 
					# $FG[228]%#$FX[reset] "
 | 
				
			||||||
    L="$FX[bold]$FX[italic]$BG[062]@%m::%2~ $BG[000]
 | 
					L='$FX[bold]$FX[italic]$BG[062]@%m::%2~$(repo_char)$BG[000]
 | 
				
			||||||
$FG[220]%#$FX[reset] "
 | 
					$FG[220]%#$FX[reset] '
 | 
				
			||||||
    PS1="%{]2;$W%}%{]1;$I%}$L"
 | 
					PS1="%{]2;$W%}%{]1;$I%}$L"
 | 
				
			||||||
    unset W I L
 | 
					    unset W I L
 | 
				
			||||||
 | 
					
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
    # We are not on xterminal
 | 
					    # We are not on xterminal
 | 
				
			||||||
    PS1="%B%K{blue}%F{white}[%l] %n@%m:%~ %f%k%F{yellow}%#%f%b "
 | 
					    PS1="%B%K{blue}%F{white}[%l] %n@%m:%~ %f%k%F{yellow}%# $(repo_char)%f%b "
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										7
									
								
								zsh/zsh.d/zshfunctions/repo_char
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								zsh/zsh.d/zshfunctions/repo_char
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					function repo_char {
 | 
				
			||||||
 | 
					#    git branch > /dev/null 2> /dev/null && echo '±' && return
 | 
				
			||||||
 | 
					#    svn info > /dev/null 2> /dev/null && echo '\u03a3' && return
 | 
				
			||||||
 | 
					#    echo '\u25cb'
 | 
				
			||||||
 | 
					    git branch > /dev/null 2> /dev/null && echo ' «git' && return
 | 
				
			||||||
 | 
					    svn info > /dev/null 2> /dev/null && echo ' «svn' && return
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user