mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-10-30 15:56:28 +08:00 
			
		
		
		
	Added more styles used in zle_highlight. Updated main README.md and highlighters/main/README.md.
This commit is contained in:
		
							parent
							
								
									103aecc52e
								
							
						
					
					
						commit
						ad75e32f98
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
zsh-syntax-highlighting
 | 
					zsh-syntax-highlighting
 | 
				
			||||||
=======================
 | 
					=======================
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Syntax highlighting for [Zsh](http://www.zsh.org).**
 | 
					Enhanced highlighting of the [Zsh](http://www.zsh.org) command-line, including syntax, paths, files, selected regions, searched patterns and much more.
 | 
				
			||||||
 | 
					
 | 
				
			||||||

 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -47,6 +47,10 @@ This highlighter defines the following styles:
 | 
				
			|||||||
* `dollar-double-quoted-argument` -  dollar double quoted arguments
 | 
					* `dollar-double-quoted-argument` -  dollar double quoted arguments
 | 
				
			||||||
* `back-double-quoted-argument` -  back double quoted arguments
 | 
					* `back-double-quoted-argument` -  back double quoted arguments
 | 
				
			||||||
* `assign` - variable assignments
 | 
					* `assign` - variable assignments
 | 
				
			||||||
 | 
					* `isearch` - matched string in history-incremental-search* widgets
 | 
				
			||||||
 | 
					* `region` - selected region (between the point and the mark)
 | 
				
			||||||
 | 
					* `special` - unprintable characters
 | 
				
			||||||
 | 
					* `suffix` - suffix characters used in the completion system
 | 
				
			||||||
* `default` - parts of the buffer that do not match anything
 | 
					* `default` - parts of the buffer that do not match anything
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
 | 
					To override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`, for example in `~/.zshrc`:
 | 
				
			||||||
 | 
				
			|||||||
@ -56,6 +56,10 @@
 | 
				
			|||||||
: ${ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]:=fg=cyan}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]:=fg=cyan}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]:=fg=cyan}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]:=fg=cyan}
 | 
				
			||||||
: ${ZSH_HIGHLIGHT_STYLES[assign]:=none}
 | 
					: ${ZSH_HIGHLIGHT_STYLES[assign]:=none}
 | 
				
			||||||
 | 
					: ${ZSH_HIGHLIGHT_STYLES[isearch]:=fg=yellow,bg=red,bold}
 | 
				
			||||||
 | 
					: ${ZSH_HIGHLIGHT_STYLES[region]:=bg=blue}
 | 
				
			||||||
 | 
					: ${ZSH_HIGHLIGHT_STYLES[special]:=none}
 | 
				
			||||||
 | 
					: ${ZSH_HIGHLIGHT_STYLES[suffix]:=none}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Whether the highlighter should be called or not.
 | 
					# Whether the highlighter should be called or not.
 | 
				
			||||||
_zsh_highlight_main_highlighter_predicate()
 | 
					_zsh_highlight_main_highlighter_predicate()
 | 
				
			||||||
 | 
				
			|||||||
@ -93,6 +93,9 @@ _zsh_highlight()
 | 
				
			|||||||
	    
 | 
						    
 | 
				
			||||||
	done
 | 
						done
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						# Set zle_highlight according to user definition on this package level
 | 
				
			||||||
 | 
						zle_highlight=(default:$ZSH_HIGHLIGHT_STYLES[default] isearch:$ZSH_HIGHLIGHT_STYLES[isearch] region:$ZSH_HIGHLIGHT_STYLES[region] special:$ZSH_HIGHLIGHT_STYLES[special] suffix:$ZSH_HIGHLIGHT_STYLES[suffix])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	# Bring back region higlighting from zle_highlight array (was overwriten by region_highlight)
 | 
						# Bring back region higlighting from zle_highlight array (was overwriten by region_highlight)
 | 
				
			||||||
	((REGION_ACTIVE)) && region_highlight+=("$((CURSOR < MARK ? CURSOR : MARK)) $((CURSOR > MARK ? CURSOR : MARK)) ${${(M)zle_highlight[@]:#region*}#region:}")
 | 
						((REGION_ACTIVE)) && region_highlight+=("$((CURSOR < MARK ? CURSOR : MARK)) $((CURSOR > MARK ? CURSOR : MARK)) ${${(M)zle_highlight[@]:#region*}#region:}")
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user