]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - zsh/rc
zsh/rc: Don't start screen on the Linux console.
[config/dotfiles.git] / zsh / rc
diff --git a/zsh/rc b/zsh/rc
index da5edc4a98197024afc0b77a4d3df831e75166f1..2a3ff4c34622a7840a5a070e165a475f7cae77e6 100644 (file)
--- a/zsh/rc
+++ b/zsh/rc
@@ -319,7 +319,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
     # precmd() call.
     window_reset=yes
     # Is set to a non empty value when the shell is running as root.
-    if [[ $(id -u) -eq 0 ]]; then
+    if [[ $UID -eq 0 ]]; then
         window_root=yes
     fi
 
@@ -372,10 +372,10 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then
             # If screen is running in SSH then display "@:hostname" as title
             # in the term/outer screen.
             if [[ $program_name == @screen ]]; then
-                program_name="@:${$(hostname)//.*/}"
+                program_name="@:${HOST//.*/}"
             # Use "@:!hostname" for root screens.
             elif [[ $program_name == @!screen ]]; then
-                program_name="@:!${$(hostname)//.*/}"
+                program_name="@:!${HOST//.*/}"
             fi
         fi
 
@@ -492,6 +492,11 @@ zstyle ':completion:*:(mv|cp):*' ignore-line no
 # simpler. Thanks to Nomexous in #zsh on Freenode (2010-03-16 01:54)
 zstyle ':completion:*:*:-command-:*' ignored-patterns './config.*'
 
+# Don't complete unwanted files with Vim. Thanks to Nomexous in #zsh on
+# Freenode (2010-06-06 04:54 CEST). See below to complete them.
+zstyle ':completion:*:*:vim:*:all-files' ignored-patterns '*.aux' '*.log' \
+                                                          '*.pdf' '*.class'
+
 # Provide a fallback completer which always completes files. Useful when Zsh's
 # completion is too "smart". Thanks to Frank Terbeck <ft@bewatermyfriend.org>
 # (http://www.zsh.org/mla/users/2009/msg01038.html).
@@ -580,12 +585,21 @@ tig() {
         $@
 }
 
+# Pipe output through less.
+tree() {
+    command tree -C "$@" | less
+}
+
+# Automatically disown.
+xpdf() {
+    command xpdf "$@" &
+    disown %command
+}
 
-# OS SPECIFIC SETTINGS
 
-local uname=$(uname)
+# OS SPECIFIC SETTINGS
 
-if [[ $uname == Linux ]]; then
+if [[ $OSTYPE == linux* ]]; then
     # Settings when creating Debian packages.
     DEBEMAIL=simon@ruderich.org
     export DEBEMAIL
@@ -603,7 +617,7 @@ source_config ~/.zsh/rc.local
 
 # If not already in screen reattach to a running session or create a new one.
 # This also starts screen one a remote server when connecting through ssh.
-if [[ $TERM != dumb && -z $STY ]]; then
+if [[ $TERM != dumb && $TERM != linux && -z $STY ]]; then
     # Get running detached sessions.
     session=$(screen -list | grep 'Detached' | awk '{ print $1; exit }')