projects
/
grml-etc-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check4progs: Change testing from ‘which’ to iterating over $PATH [Closes: issue1284]
[grml-etc-core.git]
/
etc
/
zsh
/
zshrc
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
0494979
..
1d0f357
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-992,11
+992,10
@@
zle -N accept-line
zle -N Accept-Line
zle -N Accept-Line-HandleContext
zle -N Accept-Line
zle -N Accept-Line-HandleContext
-# power completion - abbreviation expansion
# power completion / abbreviation expansion / buffer expansion
# see http://zshwiki.org/home/examples/zleiab for details
# less risky than the global aliases but powerful as well
# power completion / abbreviation expansion / buffer expansion
# see http://zshwiki.org/home/examples/zleiab for details
# less risky than the global aliases but powerful as well
-# just type the abbreviation key and afterwards '
,
.' to expand it
+# just type the abbreviation key and afterwards '
ctrl-x
.' to expand it
declare -A abk
setopt extendedglob
setopt interactivecomments
declare -A abk
setopt extendedglob
setopt interactivecomments
@@
-1274,7
+1273,6
@@
if check_com -c screen || check_com -c tmux; then
compadd -a _screen_display_wordlist
}
#m# k CTRL-x\,\,\,S Complete word from GNU screen buffer
compadd -a _screen_display_wordlist
}
#m# k CTRL-x\,\,\,S Complete word from GNU screen buffer
- #k# Complete word from GNU screen buffer
bindkey -r "^xS"
compdef -k _complete_screen_display complete-word '^xS'
fi
bindkey -r "^xS"
compdef -k _complete_screen_display complete-word '^xS'
fi
@@
-1409,7
+1407,7
@@
bind2maps emacs -- Right forward-char
bind2maps viins vicmd -- Right vi-forward-char
bind2maps viins vicmd -- Right vi-forward-char
#k# Display list of abbreviations that expand when followed by ,.
bind2maps viins vicmd -- Right vi-forward-char
bind2maps viins vicmd -- Right vi-forward-char
#k# Display list of abbreviations that expand when followed by ,.
-bind2maps emacs viins -- -s '
,
.' zleiab
+bind2maps emacs viins -- -s '
^x
.' zleiab
bind2maps emacs viins -- -s '^xb' help-show-abk
bind2maps emacs viins -- -s '^xM' inplaceMkDirs
#k# display help for keybindings and ZLE
bind2maps emacs viins -- -s '^xb' help-show-abk
bind2maps emacs viins -- -s '^xM' inplaceMkDirs
#k# display help for keybindings and ZLE
@@
-1907,6
+1905,14
@@
grml_prompt_token_default=(
vcs '0'
)
vcs '0'
)
+function grml_theme_has_token () {
+ if (( ARGC != 1 )); then
+ printf 'usage: grml_theme_has_token <name>\n'
+ return 1
+ fi
+ (( ${+grml_prompt_token_default[$1]} ))
+}
+
function GRML_theme_add_token_usage () {
cat <<__EOF__
Usage: grml_theme_add_token <name> [-f|-i] <token/function> [<pre> <post>]
function GRML_theme_add_token_usage () {
cat <<__EOF__
Usage: grml_theme_add_token <name> [-f|-i] <token/function> [<pre> <post>]
@@
-1928,6
+1934,11
@@
function GRML_theme_add_token_usage () {
return value is expected in the \$REPLY parameter. The use of these
options is mutually exclusive.
return value is expected in the \$REPLY parameter. The use of these
options is mutually exclusive.
+ There is a utility function \`grml_theme_has_token', which you can use
+ to test if a token exists before trying to add it. This can be a guard
+ for situations in which a \`grml_theme_add_token' call may happen more
+ than once.
+
Example:
To add a new token \`day' that expands to the current weekday in the
Example:
To add a new token \`day' that expands to the current weekday in the
@@
-1991,7
+2002,7
@@
grml_theme_add_token: <pre> and <post> need to by specified _both_!\n\n'
shift 2
fi
shift 2
fi
- if
(( ${+grml_prompt_token_default[$name]} ))
; then
+ if
grml_theme_has_token $name
; then
printf '
grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name
GRML_theme_add_token_usage
printf '
grml_theme_add_token: Token `%s'\'' exists! Giving up!\n\n' $name
GRML_theme_add_token_usage
@@
-2036,7
+2047,7
@@
function grml_prompt_addto () {
for it in "${items[@]}"; do
zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" pre apre \
|| apre=${grml_prompt_pre_default[$it]}
for it in "${items[@]}"; do
zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" pre apre \
|| apre=${grml_prompt_pre_default[$it]}
- zstyle -s ":prompt:
grml:${grmltheme}:${lr}
:$it" post apost \
+ zstyle -s ":prompt:
${grmltheme}:${lr}:items
:$it" post apost \
|| apost=${grml_prompt_post_default[$it]}
zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" token new \
|| new=${grml_prompt_token_default[$it]}
|| apost=${grml_prompt_post_default[$it]}
zstyle -s ":prompt:${grmltheme}:${lr}:items:$it" token new \
|| new=${grml_prompt_token_default[$it]}