Source

p9p / rc

#!/bin/bash

[ -d /usr/local/plan9 ] && export PLAN9=${PLAN9:-/usr/local/plan9}
export PATH=$PATH:$PLAN9/bin:$HOME/.p9p/bin
export MANPATH=$MANPATH:$PLAN9/man
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PLAN9/lib

# Plumb files instead of starting new editor.
export EDITOR=E
unset FCEDIT VISUAL

# Let gs find the plan9port document fonts.
export GS_FONTPATH=$PLAN9/postscript/font
# Make sure mpage prints in letter mode.
export MPAGE="-t -bLetter"

# Get rid of backspace characters in Unix man output.
export PAGER=nobs
if [ $(uname -s) = Darwin ]; then
	export BROWSER=Google\ Chrome
else
	export BROWSER=chromium-browser
fi
export NAMESPACE=/tmp/ns.$(hostname -s)
# Prompt (is almost a no-op in bash)
export H=`hostname | sed 's/\..*//'`

# Equivalent variables for rc(1).
export home=$HOME
export prompt="$H=; 	"
export user=$USER
# Set geometry per host
if [ $H = quorra ]; then
	export GEOMETRY='1440x900@1,86'
elif [ $H = moon ]; then
	export GEOMETRY='1661x1109@1,86'
else
	export GEOMETRY='1280x800@1,86'
fi
# Set default font.
font=/lib/font/bit/lucsans/unicode.8.font

# if $NAMESPACE doesn't exist, we need to create it.
[ -d $NAMESPACE ] ||  mkdir $NAMESPACE 

if [ $TERM = 9term ]; then
	_cd(){
		\cd "$@" &&
		case "TERM!$-" in
		linux!*)
			;;
		*!*i*)
			awd
		esac
	}
	alias cd=_cd
	set +o emacs
	set +o vi
	set -a # autoexport
	exec $PLAN9/bin/9 rc -il
fi

calendar()
{
	$PLAN9/bin/9 calendar
}

p9up()
{
	WD=$(pwd)
	cd $PLAN9 || return 1;
	hg pull -u
	cd $WD
	unset WD
}

# start your engines.
[ -x $HOME/.p9p/bin/p9plumb ] && $HOME/.p9p/bin/p9plumb start
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.