]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - shell/setup.sh
lesskey: don't color indicator for overlong lines
[config/dotfiles.git] / shell / setup.sh
index 5e6866fea72bea1905843c02fea7ff095b0e4f58..e8cff62e78da7cfd79b6fc429779fd9ba12e9bd0 100755 (executable)
@@ -67,9 +67,14 @@ mkdir -p zsh/cache
 # file in this directory; this requires replacing the constant HISTORY_PATH in
 # lesskey.
 echo 'lesskey: generating .lesskey'
-simple_cpp <lesskey \
+cp lesskey lesskey.tmp
+if ! less --help | grep rscroll= > /dev/null; then
+    sed_i 's/--rscroll=[^ ]*//' lesskey.tmp
+fi
+simple_cpp < lesskey.tmp \
     HISTORY_PATH -- "`pwd`/lesshistory" \
     | lesskey -
+rm lesskey.tmp
 chmod 0600 ~/.less
 
 # Custom colors for GNU ls.
@@ -184,6 +189,14 @@ if ! test -d "$temperature"; then
 fi
 apply_optional_replacement screenrc \
     temperature TEMPERATURE "$temperature"
+# Settings for local hosts.
+if test -n "${SSH_CONNECTION:+set}"; then
+    echo 'screenrc: using dark blue for remote screens'
+    sed_i 's/sorendition = Bw/sorendition = bw/' screenrc
+else
+    echo 'screenrc: removing remote options'
+    grep_i -v '(REMOTE)' screenrc
+fi
 
 
 if installed tmux; then
@@ -226,6 +239,12 @@ if installed dig; then
     grep -v -E '^#' digrc.in >digrc
 fi
 
+_iptables='/usr/share/zsh/functions/Completion/Linux/_iptables'
+if test -f "$_iptables"; then
+    sed '/^#compdef/ s/iptables/& ip6tables/' \
+        < "$_iptables" \
+        > zsh/functions/_iptables
+fi
 
 # LINK SETUP