projects
/
grml-etc-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ba50de9
)
Make our C-z shortcut smarter
author
Frank Terbeck
<ft@bewatermyfriend.org>
Wed, 3 Mar 2010 12:58:48 +0000
(13:58 +0100)
committer
Frank Terbeck
<ft@bewatermyfriend.org>
Wed, 3 Mar 2010 12:58:48 +0000
(13:58 +0100)
etc/zsh/zshrc
patch
|
blob
|
history
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
f07fb67
..
4178304
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-912,8
+912,19
@@
zle -N insert-last-typed-word;
#k# Insert last typed word
bindkey "\em" insert-last-typed-word
#k# Insert last typed word
bindkey "\em" insert-last-typed-word
-#k# Shortcut for \kbd{fg<enter>}
-bindkey -s '^z' "fg\n"
+function grml-zsh-fg() {
+ if (( ${#jobstates} )); then
+ zle .push-input
+ [[ -o hist_ignore_space ]] && BUFFER=' ' || BUFFER=''
+ BUFFER="${BUFFER}fg"
+ zle .accept-line
+ else
+ zle -M 'No background jobs. Doing nothing.'
+ fi
+}
+zle -N grml-zsh-fg
+#k# A smart shortcut for \kbd{fg<enter>}
+bindkey '^z' grml-zsh-fg
# run command line as user root via sudo:
sudo-command-line() {
# run command line as user root via sudo:
sudo-command-line() {