summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user:hugues/net:foret/KeyBindings.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/user:hugues/net:foret/KeyBindings.zsh b/user:hugues/net:foret/KeyBindings.zsh
index ad2d1a3..92824b0 100644
--- a/user:hugues/net:foret/KeyBindings.zsh
+++ b/user:hugues/net:foret/KeyBindings.zsh
@@ -8,9 +8,14 @@
## these files with or without this notice.
##
+__nproc ()
+{
+ echo $(( ${NPROC:-0} $@ > 0 ? ${NPROC:-0} $@ : 0 ))
+}
+
for keymap in viins vicmd emacs
do
- bindkey -M $keymap -s '+' 'Q for i in {1..$(__get_prompt_lines)} ; tput cuu1; export NPROC=$(($NPROC + 1))\n'
- bindkey -M $keymap -s '-' 'Q for i in {1..$(__get_prompt_lines)} ; tput cuu1; [ "$NPROC" -gt 0 ] && export NPROC=$(($NPROC - 1)) || unset NPROC\n'
+ bindkey -M $keymap -s '+' 'Q __up_up ; export NPROC=$(__nproc + 1)\n'
+ bindkey -M $keymap -s '-' 'Q __up_up ; export NPROC=$(__nproc - 1) ; [ "$NPROC" -gt 0 ] || unset NPROC\n'
done