Add all zle hookable functions

This commit is contained in:
Mounier Florian 2011-01-05 10:54:25 +01:00
parent 0c138706a7
commit 5afa8fcb32

View file

@ -1,8 +1,10 @@
#!/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
# All wrongs reserved.
# vim: ft=zsh sw=2 ts=2 et
# Token types styles.
typeset -gA ZSH_HIGHLIGHT_STYLES
@ -53,56 +55,219 @@ ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS=(
ZSH_HIGHLIGHT_ZLE_UPDATE_EVENTS=(
accept-and-hold
accept-and-infer-next-history
# accept-and-menu-complete
accept-line
accept-line-and-down-history
argument-base
auto-suffix-remove
auto-suffix-retain
backward-char
backward-delete-char
backward-delete-word
backward-kill-line
backward-kill-word
backward-kill-word-match
backward-word
backward-word-match
beep
beginning-of-buffer-or-history
beginning-of-history
beginning-of-history
beginning-of-line
beginning-of-line-hist
capitalize-word
capitalize-word-match
clear-screen
complete-word
copy-earlier-word
copy-prev-shell-word
copy-prev-word
copy-region-as-kill
cycle-completion-positions
delete-char
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-line-or-history
down-line-or-beginning-search
down-line-or-history
down-line-or-search
edit-command-line
emacs-backward-word
emacs-forward-word
end-of-buffer-or-history
end-of-history
end-of-line
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-prefix
expand-word
forward-char
forward-word
forward-word-match
get-line
gosmacs-transpose-chars
history-beginning-search-backward
history-beginning-search-backward-end
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-forward
history-pattern-search
history-pattern-search-backward
history-pattern-search-forward
history-search-backward
history-search-forward
incarg
# incremental-complete-word
infer-next-history
insert-composed-char
insert-files
insert-last-word
insert-unicode-char
kill-buffer
kill-line
kill-region
kill-whole-line
kill-word
kill-word-match
list-choices
list-expand
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
read-command
read-from-minibuffer
recursive-edit
redisplay
redo
replace-pattern
replace-string
replace-string-again
reset-prompt
reverse-menu-complete
run-help
select-word-style
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
universal-argument
up-case-word
up-case-word-match
up-history
up-line-or-history
up-line-or-beginning-search
up-line-or-history
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-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-end-of-line
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-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-repeat-change
vi-repeat-find
vi-repeat-search
vi-replace
vi-replace-chars
vi-rev-repeat-find
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-yank
vi-yank-eol
vi-yank-whole-line
what-cursor-position
where-is
which-command
yank
yank-pop
zap-to-char
)
# ZLE highlight types.
@ -177,7 +342,8 @@ _zsh_highlight-zle-buffer() {
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]
else
style=$ZSH_HIGHLIGHT_STYLES[unknown-token]
fi;;
fi
;;
esac
else
case $arg in
@ -197,7 +363,8 @@ _zsh_highlight-zle-buffer() {
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]
else
style=$ZSH_HIGHLIGHT_STYLES[default]
fi;;
fi
;;
esac
fi
[[ $substr_color = 0 ]] && region_highlight+=("$start_pos $end_pos $style")
@ -223,3 +390,5 @@ for f in $ZSH_HIGHLIGHT_ZLE_UPDATE_EVENTS; do
;;
esac
done