zshrc: add wrapper for vim
[grml-etc-core.git] / etc / zsh / zshrc
index 5b09f25..80d9255 100644 (file)
@@ -453,9 +453,7 @@ zrclocal() {
 #}}}
 
 # locale setup {{{
-if [[ -z "$LANG" ]] ; then
-   xsource "/etc/default/locale"
-fi
+xsource "/etc/default/locale"
 
 export LANG=${LANG:-en_US.iso885915}
 for var in LC_ALL LC_MESSAGES ; do
@@ -1032,7 +1030,7 @@ fi
 
 battery() {
 if [[ $BATTERY -gt 0 ]] ; then
-    PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]##Battery <->: [^0-9]##, (<->)%*/${match[1]}}"
+    PERCENT="${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]#Battery <->: [^0-9]##, (<->)%*/${match[1]}}"
     if [[ -z "$PERCENT" ]] ; then
         PERCENT='acpi not present'
     else
@@ -2846,6 +2844,17 @@ minimal-shell() {
     exec env -i ENV="/etc/minimal-shellrc" HOME="$HOME" TERM="$TERM" ksh
 }
 
+# a wrapper for vim, that deals with title setting
+#   VIM_OPTIONS
+#       set this array to a set of options to vim you always want
+#       to have set when calling vim (in .zshrc.local), like:
+#           VIM_OPTIONS=( -p )
+#       This will cause vim to send every file given on the
+#       commandline to be send to it's own tab (needs vim7).
+vim() {
+    VIM_PLEASE_SET_TITLE='yes' command vim ${VIM_OPTIONS} "$@"
+}
+
 # make a backup of a file
 bk() {
     cp -a "$1" "${1}_$(date --iso-8601=seconds)"