Add all zle hookable functions
This commit is contained in:
		
							parent
							
								
									0c138706a7
								
							
						
					
					
						commit
						5afa8fcb32
					
				|  | @ -1,8 +1,10 @@ | ||||||
| #!/usr/bin/env zsh | #!/usr/bin/env zsh | ||||||
| # Copyleft 2010 zsh-syntax-highlighting contributors | # -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- | ||||||
|  | # vim: ft=zsh sw=2 ts=2 et | ||||||
|  | 
 | ||||||
|  | # Copyleft 2011 zsh-syntax-highlighting contributors | ||||||
| # http://github.com/nicoulaj/zsh-syntax-highlighting | # http://github.com/nicoulaj/zsh-syntax-highlighting | ||||||
| # All wrongs reserved. | # All wrongs reserved. | ||||||
| # vim: ft=zsh sw=2 ts=2 et |  | ||||||
| 
 | 
 | ||||||
| # Token types styles. | # Token types styles. | ||||||
| typeset -gA ZSH_HIGHLIGHT_STYLES | typeset -gA ZSH_HIGHLIGHT_STYLES | ||||||
|  | @ -53,56 +55,219 @@ ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS=( | ||||||
| ZSH_HIGHLIGHT_ZLE_UPDATE_EVENTS=( | ZSH_HIGHLIGHT_ZLE_UPDATE_EVENTS=( | ||||||
|   accept-and-hold |   accept-and-hold | ||||||
|   accept-and-infer-next-history |   accept-and-infer-next-history | ||||||
|  | # accept-and-menu-complete | ||||||
|   accept-line |   accept-line | ||||||
|   accept-line-and-down-history |   accept-line-and-down-history | ||||||
|  |   argument-base | ||||||
|  |   auto-suffix-remove | ||||||
|  |   auto-suffix-retain | ||||||
|  |   backward-char | ||||||
|   backward-delete-char |   backward-delete-char | ||||||
|   backward-delete-word |   backward-delete-word | ||||||
|  |   backward-kill-line | ||||||
|   backward-kill-word |   backward-kill-word | ||||||
|  |   backward-kill-word-match | ||||||
|  |   backward-word | ||||||
|  |   backward-word-match | ||||||
|  |   beep | ||||||
|   beginning-of-buffer-or-history |   beginning-of-buffer-or-history | ||||||
|   beginning-of-history |   beginning-of-history | ||||||
|   beginning-of-history |   beginning-of-line | ||||||
|   beginning-of-line-hist |   beginning-of-line-hist | ||||||
|  |   capitalize-word | ||||||
|  |   capitalize-word-match | ||||||
|  |   clear-screen | ||||||
|   complete-word |   complete-word | ||||||
|  |   copy-earlier-word | ||||||
|  |   copy-prev-shell-word | ||||||
|  |   copy-prev-word | ||||||
|  |   copy-region-as-kill | ||||||
|  |   cycle-completion-positions | ||||||
|   delete-char |   delete-char | ||||||
|   delete-char-or-list |   delete-char-or-list | ||||||
|  |   delete-to-char | ||||||
|  |   delete-whole-word-match | ||||||
|  |   delete-word | ||||||
|  |   describe-key-briefly | ||||||
|  |   digit-argument | ||||||
|  |   down-case-word | ||||||
|  |   down-case-word-match | ||||||
|   down-history |   down-history | ||||||
|   down-line-or-history |   down-line-or-beginning-search | ||||||
|   down-line-or-history |   down-line-or-history | ||||||
|   down-line-or-search |   down-line-or-search | ||||||
|  |   edit-command-line | ||||||
|  |   emacs-backward-word | ||||||
|  |   emacs-forward-word | ||||||
|   end-of-buffer-or-history |   end-of-buffer-or-history | ||||||
|   end-of-history |   end-of-history | ||||||
|  |   end-of-line | ||||||
|   end-of-line-hist |   end-of-line-hist | ||||||
|  |   end-of-list | ||||||
|  |   exchange-point-and-mark | ||||||
|  |   execute-last-named-cmd | ||||||
|  |   execute-named-cmd | ||||||
|  |   expand-cmd-path | ||||||
|  |   expand-history | ||||||
|   expand-or-complete |   expand-or-complete | ||||||
|   expand-or-complete-prefix |   expand-or-complete-prefix | ||||||
|  |   expand-word | ||||||
|  |   forward-char | ||||||
|  |   forward-word | ||||||
|  |   forward-word-match | ||||||
|  |   get-line | ||||||
|  |   gosmacs-transpose-chars | ||||||
|   history-beginning-search-backward |   history-beginning-search-backward | ||||||
|  |   history-beginning-search-backward-end | ||||||
|   history-beginning-search-forward |   history-beginning-search-forward | ||||||
|  |   history-beginning-search-forward-end | ||||||
|  |   history-beginning-search-menu | ||||||
|  |   history-incremental-pattern-search-backward | ||||||
|  |   history-incremental-pattern-search-forward | ||||||
|   history-incremental-search-backward |   history-incremental-search-backward | ||||||
|   history-incremental-search-forward |   history-incremental-search-forward | ||||||
|  |   history-pattern-search | ||||||
|  |   history-pattern-search-backward | ||||||
|  |   history-pattern-search-forward | ||||||
|   history-search-backward |   history-search-backward | ||||||
|   history-search-forward |   history-search-forward | ||||||
|  |   incarg | ||||||
|  | # incremental-complete-word | ||||||
|   infer-next-history |   infer-next-history | ||||||
|  |   insert-composed-char | ||||||
|  |   insert-files | ||||||
|   insert-last-word |   insert-last-word | ||||||
|  |   insert-unicode-char | ||||||
|  |   kill-buffer | ||||||
|  |   kill-line | ||||||
|  |   kill-region | ||||||
|  |   kill-whole-line | ||||||
|   kill-word |   kill-word | ||||||
|  |   kill-word-match | ||||||
|  |   list-choices | ||||||
|  |   list-expand | ||||||
|   magic-space |   magic-space | ||||||
|  |   match-word-context | ||||||
|  |   match-words-by-style | ||||||
|  |   menu-complete | ||||||
|  |   menu-expand-or-complete | ||||||
|  |   menu-select | ||||||
|  |   modify-current-argument | ||||||
|  |   narrow-to-region | ||||||
|  |   narrow-to-region-invisible | ||||||
|  |   neg-argument | ||||||
|  |   overwrite-mode | ||||||
|  |   pound-insert | ||||||
|  |   predict-off | ||||||
|  |   predict-on | ||||||
|  |   push-input | ||||||
|  |   push-line | ||||||
|  |   push-line-or-edit | ||||||
|  |   quote-line | ||||||
|  |   quote-region | ||||||
|   quoted-insert |   quoted-insert | ||||||
|  |   read-command | ||||||
|  |   read-from-minibuffer | ||||||
|  |   recursive-edit | ||||||
|  |   redisplay | ||||||
|   redo |   redo | ||||||
|  |   replace-pattern | ||||||
|  |   replace-string | ||||||
|  |   replace-string-again | ||||||
|  |   reset-prompt | ||||||
|  |   reverse-menu-complete | ||||||
|  |   run-help | ||||||
|  |   select-word-style | ||||||
|   self-insert |   self-insert | ||||||
|  |   self-insert-unmeta | ||||||
|  |   send-break | ||||||
|  |   set-mark-command | ||||||
|  |   smart-insert-last-word | ||||||
|  |   spell-word | ||||||
|  |   split-shell-arguments | ||||||
|  |   transpose-chars | ||||||
|  |   transpose-words | ||||||
|  |   transpose-words-match | ||||||
|  |   undefined-key | ||||||
|   undo |   undo | ||||||
|  |   universal-argument | ||||||
|  |   up-case-word | ||||||
|  |   up-case-word-match | ||||||
|   up-history |   up-history | ||||||
|   up-line-or-history |   up-line-or-beginning-search | ||||||
|   up-line-or-history |   up-line-or-history | ||||||
|   up-line-or-search |   up-line-or-search | ||||||
|   up-line-or-search |   vi-add-eol | ||||||
|  |   vi-add-next | ||||||
|  |   vi-backward-blank-word | ||||||
|  |   vi-backward-char | ||||||
|  |   vi-backward-delete-char | ||||||
|   vi-backward-kill-word |   vi-backward-kill-word | ||||||
|  |   vi-backward-word | ||||||
|  |   vi-beginning-of-line | ||||||
|  |   vi-caps-lock-panic | ||||||
|  |   vi-change | ||||||
|  |   vi-change-eol | ||||||
|  |   vi-change-whole-line | ||||||
|  |   vi-cmd-mode | ||||||
|  |   vi-delete | ||||||
|  |   vi-delete-char | ||||||
|  |   vi-digit-or-beginning-of-line | ||||||
|   vi-down-line-or-history |   vi-down-line-or-history | ||||||
|  |   vi-end-of-line | ||||||
|   vi-fetch-history |   vi-fetch-history | ||||||
|  |   vi-find-next-char | ||||||
|  |   vi-find-next-char-skip | ||||||
|  |   vi-find-prev-char | ||||||
|  |   vi-find-prev-char-skip | ||||||
|  |   vi-first-non-blank | ||||||
|  |   vi-forward-blank-word | ||||||
|  |   vi-forward-blank-word-end | ||||||
|  |   vi-forward-char | ||||||
|  |   vi-forward-word | ||||||
|  |   vi-forward-word-end | ||||||
|  |   vi-goto-column | ||||||
|  |   vi-goto-mark | ||||||
|  |   vi-goto-mark-line | ||||||
|   vi-history-search-backward |   vi-history-search-backward | ||||||
|   vi-history-search-forward |   vi-history-search-forward | ||||||
|  |   vi-indent | ||||||
|  |   vi-insert | ||||||
|  |   vi-insert-bol | ||||||
|  |   vi-join | ||||||
|  |   vi-kill-eol | ||||||
|  |   vi-kill-line | ||||||
|  |   vi-match-bracket | ||||||
|  |   vi-open-line-above | ||||||
|  |   vi-open-line-below | ||||||
|  |   vi-oper-swap-case | ||||||
|  |   vi-pound-insert | ||||||
|  |   vi-put-after | ||||||
|  |   vi-put-before | ||||||
|   vi-quoted-insert |   vi-quoted-insert | ||||||
|  |   vi-repeat-change | ||||||
|  |   vi-repeat-find | ||||||
|   vi-repeat-search |   vi-repeat-search | ||||||
|  |   vi-replace | ||||||
|  |   vi-replace-chars | ||||||
|  |   vi-rev-repeat-find | ||||||
|   vi-rev-repeat-search |   vi-rev-repeat-search | ||||||
|  |   vi-set-buffer | ||||||
|  |   vi-set-mark | ||||||
|  |   vi-substitute | ||||||
|  |   vi-swap-case | ||||||
|  |   vi-undo-change | ||||||
|  |   vi-unindent | ||||||
|   vi-up-line-or-history |   vi-up-line-or-history | ||||||
|  |   vi-yank | ||||||
|  |   vi-yank-eol | ||||||
|  |   vi-yank-whole-line | ||||||
|  |   what-cursor-position | ||||||
|  |   where-is | ||||||
|  |   which-command | ||||||
|   yank |   yank | ||||||
|  |   yank-pop | ||||||
|  |   zap-to-char | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| # ZLE highlight types. | # ZLE highlight types. | ||||||
|  | @ -177,7 +342,8 @@ _zsh_highlight-zle-buffer() { | ||||||
|                           style=$ZSH_HIGHLIGHT_STYLES[history-expansion] |                           style=$ZSH_HIGHLIGHT_STYLES[history-expansion] | ||||||
|                         else |                         else | ||||||
|                           style=$ZSH_HIGHLIGHT_STYLES[unknown-token] |                           style=$ZSH_HIGHLIGHT_STYLES[unknown-token] | ||||||
|                         fi;; |                         fi | ||||||
|  |                         ;; | ||||||
|       esac |       esac | ||||||
|     else |     else | ||||||
|       case $arg in |       case $arg in | ||||||
|  | @ -197,7 +363,8 @@ _zsh_highlight-zle-buffer() { | ||||||
|                    style=$ZSH_HIGHLIGHT_STYLES[history-expansion] |                    style=$ZSH_HIGHLIGHT_STYLES[history-expansion] | ||||||
|                  else |                  else | ||||||
|                    style=$ZSH_HIGHLIGHT_STYLES[default] |                    style=$ZSH_HIGHLIGHT_STYLES[default] | ||||||
|                  fi;; |                  fi | ||||||
|  |                  ;; | ||||||
|       esac |       esac | ||||||
|     fi |     fi | ||||||
|     [[ $substr_color = 0 ]] && region_highlight+=("$start_pos $end_pos $style") |     [[ $substr_color = 0 ]] && region_highlight+=("$start_pos $end_pos $style") | ||||||
|  | @ -223,3 +390,5 @@ for f in $ZSH_HIGHLIGHT_ZLE_UPDATE_EVENTS; do | ||||||
|       ;; |       ;; | ||||||
|   esac |   esac | ||||||
| done | done | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue