--- /dev/null
+# $Id$
+#
+# Path information is stored on separate lines in XXXdirs.
+# We extract each directory exists and add it to the appropriate PATH.
+#
+
+# Location of the XXXdirs files.
+DIR=$HOME/.profile.d
+
+# Set one path to be the same as another.
+function copypath() {
+ newpath="$1"; shift
+ oldpath="$1"; shift
+
+ # Sanitise and export.
+ path="$(eval echo \$$oldpath)"
+ [ -z "$path" ] || eval export $newpath="$path"
+
+ unset path newpath oldpath
+}
+
+# Set a path from directories.
+function makepath() {
+ newpath="$1"; shift
+ dirs="$1"; shift
+
+ # Check the file exists.
+ [ -e "$DIR/$dirs" ] || return
+
+ # Read them.
+ path=
+ for dir in $(cat "$DIR/$dirs"); do
+ [ -d "$dir" ] || continue
+
+ path="$path:$dir"
+ done
+
+ # Sanitise path.
+ path=${path#:}
+ [ -z "$path" ] && return
+
+ # Export.
+ eval export $newpath="$path"
+
+ unset path newpath dirs
+}
+
+makepath PATH bindirs
+makepath C_INCLUDE_PATH incdirs
+copypath CPLUS_INCLUDE_PATH C_INCLUDE_PATH
+makepath LD_LIBRARY_PATH libdirs
+copypath LD_RUN_PATH LD_LIBRARY_PATH
+makepath MANPATH mandirs
+makepath PKG_CONFIG_PATH pkgdirs
+
+unset sedscr makepath copypath
--- /dev/null
+# $Id$
+#
+# Try to find a valid TERM entry.
+#
+
+for term in linux dtterm xterm vt100; do
+ if has_term $term; then
+ export TERM=$term
+ break
+ fi
+done
+
+unset term
se smartcase
se shm=aot
se laststatus=2
+se t_WS=\e[8;%p1%d;%p2%dt
syn enable
if has("gui_running")
se guifont=Bitstream\ Vera\ Sans\ Mono\ 12
exec "set statusline=" . sl1 . hexformat . sl2
endfun
+fun! Cycle_Number()
+ if &number
+ " Restore width.
+ if &t_WS =~ '^\e.'
+ let &columns=g:numbercols
+ endif
+ set nonumber
+ else
+ " Save width between number toggling.
+ if &t_WS =~ '^\e'
+ let g:numbercols=&columns
+ let &columns=&columns+5
+ endif
+ set number
+ endif
+endfun
+
" Save the current window width so if we change it we can restore it
" when we quit.
let andyoldcols=&columns
map Qc :call Invert_Case()<CR>:<CR>
" Cycle list styles with Ql.
map Ql :call Cycle_List()<CR>:<CR>
+" Change number mode with Qn.
+map Qn :call Cycle_Number()<CR>:<CR>
" Change to ts=2 with Q2.
map Q2 :se ts=2<CR>:<CR>
" Change to ts=4 with Q4.
map Q3 :se ts=32<CR>:<CR>
" Change foldmethod with Qf.
map Qf :se foldenable!<CR>:<CR>
-" Change number mode with Qn.
-map Qn :se number!<CR>:<CR>
" Toggle paste mode with Qp.
map Qp :se paste!<CR>:<CR>
" Toggle tags with Qt.
--- /dev/null
+#!/usr/bin/perl
+#
+# $Id$
+#
+# has_term: Check for a valid TERM value.
+# Usage: has_term [<term>]
+# Exits: 0 if the TERM setting is valid.
+# 1 otherwise.
+# Example: has_term dtterm
+#
+
+use Term::Cap;
+
+# Quit.
+close STDERR;
+
+Tgetent Term::Cap { TERM => $ARGV[0], OSPEED => 9600 } and exit 0;
+exit 100;