mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-28 17:10:59 +01:00
25276: use autoload -z for zsh-autoload functions
This commit is contained in:
parent
1b1712d065
commit
ffabab4e74
27 changed files with 50 additions and 28 deletions
|
|
@ -4,7 +4,7 @@
|
|||
# $HOME/.zsticky). The number of notes stored is STICKYSIZE (1000).
|
||||
#
|
||||
# Load this file as a function:
|
||||
# autoload -U sticky-note
|
||||
# autoload -Uz sticky-note
|
||||
#
|
||||
# It may then be bound as a widget:
|
||||
# zle -N sticky-note
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Someone once accused zsh of not being as complete as Emacs, because it
|
||||
# lacks Tetris and an adventure game.
|
||||
#
|
||||
# autoload -U tetris
|
||||
# autoload -Uz tetris
|
||||
# zle -N tetris
|
||||
# bindkey '...' tetris
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Put standard xterm/dtterm window control codes in shell parameters for
|
||||
# easy use. Note that some terminals do not support all combinations.
|
||||
|
||||
# autoload -U xtermctl ; xtermctl
|
||||
# autoload -Uz xtermctl ; xtermctl
|
||||
# xtermctl --explain
|
||||
|
||||
# Run once to set up; implements two functions:
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ if (( bind )) || ! bindkey -M zed >&/dev/null; then
|
|||
|
||||
# Make zed-set-file-name available.
|
||||
# Assume it's in fpath; there's no error at this point if it isn't
|
||||
autoload -U zed-set-file-name
|
||||
autoload -Uz zed-set-file-name
|
||||
zle -N zed-set-file-name
|
||||
fi
|
||||
if (( bind )) || ! bindkey -M zed-vicmd >&/dev/null; then
|
||||
|
|
@ -74,7 +74,7 @@ if ((fun)) then
|
|||
var="$(functions $1)"
|
||||
# If function is undefined but autoloadable, load it
|
||||
if [[ $var = *\#\ undefined* ]] then
|
||||
var="$(autoload +X $1; functions $1)"
|
||||
ar="$(autoload +X $1; functions $1)"
|
||||
elif [[ -z $var ]] then
|
||||
var="$1() {
|
||||
}"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ prompt_bigfade_setup () {
|
|||
local cwd=${4:-'yellow'}
|
||||
|
||||
local -A schars
|
||||
autoload -U prompt_special_chars
|
||||
autoload -Uz prompt_special_chars
|
||||
prompt_special_chars
|
||||
|
||||
PS1="%B%F{$fadebar}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$userhost}%K{$fadebar}%n@%m%b%k%f%F{$fadebar}%K{black}$schars[260]$schars[261]$schars[262]$schars[333]%b%f%k%F{$fadebar}%K{black}$schars[333]$schars[262]$schars[261]$schars[260]%B%F{$date}%K{black} %D{%a %b %d} %D{%I:%M:%S%P}$prompt_newline%B%F{$cwd}%K{black}$PWD>%b%f%k "
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ prompt_elite2_setup () {
|
|||
local parens_col=${2:-$text_col}
|
||||
|
||||
local -A schars
|
||||
autoload -U prompt_special_chars
|
||||
autoload -Uz prompt_special_chars
|
||||
prompt_special_chars
|
||||
|
||||
local text="%b%F{$text_col}"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ prompt_elite_setup () {
|
|||
local punctuation=${2:-'blue'}
|
||||
|
||||
local -A schars
|
||||
autoload -U prompt_special_chars
|
||||
autoload -Uz prompt_special_chars
|
||||
prompt_special_chars
|
||||
|
||||
PS1="%F{$text}$schars[332]$schars[304]%F{$punctuation}(%F{$text}%n%F{$punctuation}@%F{$text}%m%F{$punctuation})%F{$text}-%F{$punctuation}(%F{$text}%D{%I:%M%P}%F{$punctuation}-:-%F{$text}%D{%m}%F{$punctuation}%F{$text}/%D{%d}%F{$punctuation})%F{$text}$schars[304]-%F{$punctuation}$schars[371]%F{$text}-$schars[371]$schars[371]%F{$punctuation}$schars[372]$prompt_newline%F{$text}$schars[300]$schars[304]%F{$punctuation}(%F{$text}%1~%F{$punctuation})%F{$text}$schars[304]$schars[371]%F{$punctuation}$schars[372]%f"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ prompt_fade_setup () {
|
|||
local date=${3:-'white'}
|
||||
|
||||
local -A schars
|
||||
autoload -U prompt_special_chars
|
||||
autoload -Uz prompt_special_chars
|
||||
prompt_special_chars
|
||||
|
||||
PS1="%F{$fadebar_cwd}%B%K{$fadebar_cwd}$schars[333]$schars[262]$schars[261]$schars[260]%F{$userhost}%K{$fadebar_cwd}%B%n@%m%b%F{$fadebar_cwd}%K{black}$schars[333]$schars[262]$schars[261]$schars[260]%F{$date}%K{black}%B %D{%a %b %d} %D{%I:%M:%S%P} $prompt_newline%F{fadebar_cwd}%K{black}%B%~/%b%k%f "
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ prompt_fire_setup () {
|
|||
local cwd=${6:-'yellow'}
|
||||
|
||||
local -a schars
|
||||
autoload -U prompt_special_chars
|
||||
autoload -Uz prompt_special_chars
|
||||
prompt_special_chars
|
||||
|
||||
local GRAD1="%{$schars[333]$schars[262]$schars[261]$schars[260]%}"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
## zsh prompt themes extension
|
||||
## by Adam Spiers <adam@spiers.net>
|
||||
##
|
||||
## Load with `autoload -U promptinit; promptinit'.
|
||||
## Load with `autoload -Uz promptinit; promptinit'.
|
||||
## Type `prompt -h' for help.
|
||||
##
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Edit the command line using your usual editor.
|
||||
# Binding this to 'v' in the vi command mode map,
|
||||
# autoload edit-command-line
|
||||
# autoload -z edit-command-line
|
||||
# zle -N edit-command-line
|
||||
# bindkey -M vicmd v edit-command-line
|
||||
# will give ksh-like behaviour for that key,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# the entire history is searched.
|
||||
#
|
||||
# Configuration:
|
||||
# autoload -U history-beginning-search-menu
|
||||
# autoload -Uz history-beginning-search-menu
|
||||
# zle -N history-beginning-search-menu
|
||||
# bindkey '\eP' history-beginning-search-menu
|
||||
#
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# Shell function to increment an integer either under the cursor or just
|
||||
# to the left of it. Use
|
||||
# autoload -U incarg
|
||||
# autoload -Uz incarg
|
||||
# zle -N incarg
|
||||
# bindkey "..." incarg
|
||||
# to define it. For example,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ setopt localoptions noksharrays multibyte
|
|||
local -a reply
|
||||
integer REPLY REPLY2
|
||||
|
||||
autoload -U split-shell-arguments
|
||||
autoload -Uz split-shell-arguments
|
||||
split-shell-arguments
|
||||
|
||||
# Can't do this unless there's some text under or left of us.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# As narrow-to-region, but replaces the text outside the editable region
|
||||
# with `...' if it was non-empty. Can be used directly as a widget.
|
||||
|
||||
autoload -U narrow-to-region
|
||||
autoload -Uz narrow-to-region
|
||||
narrow-to-region -p '...' -P '...' -n
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
# with RETURN, without needing to move the cursor to the end first.
|
||||
#
|
||||
# To use it:
|
||||
# autoload -U predict-on
|
||||
# autoload -Uz predict-on
|
||||
# zle -N predict-on
|
||||
# zle -N predict-off
|
||||
# bindkey '...' predict-on
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# normal completion fails, the quotes are removed again.
|
||||
#
|
||||
# To use it:
|
||||
# autoload -U quote-and-complete-word
|
||||
# autoload -Uz quote-and-complete-word
|
||||
# zle -N quote-and-complete-word
|
||||
# bindkey '\t' quote-and-complete-word
|
||||
#
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
# on X would be turned into `barXfoo' with the cursor still on the X,
|
||||
# regardless of what the character X is.
|
||||
|
||||
autoload match-words-by-style
|
||||
autoload -z match-words-by-style
|
||||
|
||||
local curcontext=":zle:$WIDGET" skip
|
||||
local -a matched_words
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# the input character.
|
||||
|
||||
# Setup:
|
||||
# autoload -U url-quote-magic
|
||||
# autoload -Uz url-quote-magic
|
||||
# zle -N self-insert url-quote-magic
|
||||
|
||||
# A number of zstyles may be set to control the quoting behavior.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue