From db2424324b9012f25c622a5e18a43cf7160b93cf Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Wed, 14 Mar 2012 18:12:01 +0100 Subject: [Env] totem. --- net:foret/Environment.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net:foret/Environment.zsh b/net:foret/Environment.zsh index 21008d4..9066a83 100644 --- a/net:foret/Environment.zsh +++ b/net:foret/Environment.zsh @@ -1,4 +1,6 @@ +export MUSICPLAYER=totem + # ccache export CCACHE_DIR=/work/$USER/.ccache -- cgit v1.2.3 From 5b60455691922c0acf971557a138f3176cba0838 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 15 Mar 2012 16:05:46 +0100 Subject: [Keys] Binds ^K to redefine current prompt. :) --- 12_Prompts.zsh | 17 ++++++++++++----- user:hugues/KeyBindings.zsh | 4 ++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 61ca77a..afe2ede 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -77,6 +77,17 @@ __hbar() fi } +__get_prompt_lines() +{ + local lines + lines=$( (__expand_text "$PS1 $@" ) | sed "s/\\(.\{,$COLUMNS\}\\)/\\1\n/g" ) + lines=$( echo "$lines" | sed -n '/^$/n;p' | wc -l ) + # Got number of empty lines at end of command, because they are screwed up above... + lines=$(( $lines + $( echo -n "$@" | tr ';\n' '.;' | sed 's/^\(.*[^;]\)\(;*\)$/\2/' | wc -c ) )) + + echo $lines +} + preexec () { __term_title "$2" @@ -87,11 +98,7 @@ preexec () __hbar __redefine_prompt - local lines - lines=$( (__expand_text "$PS1 $1" ) | sed "s/\\(.\{,$COLUMNS\}\\)/\\1\n/g" ) - lines=$( echo "$lines" | sed -n '/^$/n;p' | wc -l ) - # Got number of empty lines at end of command, because they are screwed up above... - lines=$(( $lines + $( echo -n "$1" | tr ';\n' '.;' | sed 's/^\(.*[^;]\)\(;*\)$/\2/' | wc -c ) )) + local lines=$(__get_prompt_lines "$1") tput sc for i in {1..$lines} ; tput cuu1 diff --git a/user:hugues/KeyBindings.zsh b/user:hugues/KeyBindings.zsh index 02dd29a..ea844a9 100644 --- a/user:hugues/KeyBindings.zsh +++ b/user:hugues/KeyBindings.zsh @@ -237,8 +237,8 @@ do bindkey -M $keymap 'q' push-line bindkey -M $keymap 'Q' push-line - bindkey -M $keymap -s 'K' 'Q tput clear\n' - bindkey -M $keymap -s 'B' 'Q tput clear ; tput cup $(tput lines) 0\n' + bindkey -M $keymap -s 'K' 'Q for i in {1..$(__get_prompt_lines)} ; tput cuu1\n' + bindkey -M $keymap -s 'B' 'Q tput clear ; tput cup $(tput lines) 0\n' done # redefines push-line for vicmd -- cgit v1.2.3 From 60067df38b00e7b63b40c29209a9309d0d0e748d Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 15 Mar 2012 16:06:01 +0100 Subject: cleanup: corrects tabs. --- user:hugues/KeyBindings.zsh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/user:hugues/KeyBindings.zsh b/user:hugues/KeyBindings.zsh index ea844a9..6a50329 100644 --- a/user:hugues/KeyBindings.zsh +++ b/user:hugues/KeyBindings.zsh @@ -33,15 +33,15 @@ bindkey '[3~' kill-region # ESC del test $TERM = 'rxvt' -o $TERM = 'xterm' -o $TERM = 'aterm' && { - bindkey '[1~' beginning-of-line # home - bindkey '[4~' end-of-line # end-of-line - bindkey 'Oc' forward-word # CTRL right - bindkey 'Od' backward-word # CTRL left - bindkey '[3$' vi-set-buffer # SHIFT del - bindkey 'Oa' history-search-backward # CTRL UP - bindkey 'Ob' history-search-forward # CTRL DOWN - bindkey 'OH' beginning-of-line # home - bindkey 'OF' end-of-line # end-of-line + bindkey '[1~' beginning-of-line # home + bindkey '[4~' end-of-line # end-of-line + bindkey 'Oc' forward-word # CTRL right + bindkey 'Od' backward-word # CTRL left + bindkey '[3$' vi-set-buffer # SHIFT del + bindkey 'Oa' history-search-backward # CTRL UP + bindkey 'Ob' history-search-forward # CTRL DOWN + bindkey 'OH' beginning-of-line # home + bindkey 'OF' end-of-line # end-of-line } # -- cgit v1.2.3