I've been using Linux for over 10 years, however it wasn't until I started getting paid to use Linux on a daily basis that I saw the value in keeping "dot files".
What I want is not a fancy prompt or tweaks to make a self-consistent system. I want to customize my environment so I can do more with less.
I'm still in the idealized design phase of this
(
Read more... )
There's a lot going on in my zsh config, but here are some bits i really like:
has almost nothing in it.
has three directories: functions, packages, rc.d.
This part's still in progress, but parts will eventually load conditionally
on hostname, like here
mike@hyperion:~> which package
package () {
# undefined
builtin autoload -XUz
}
mike@hyperion:~> package
Couldn't find /home/mike/.zsh/packages/hyperion-
mike@hyperion:~> which package
package () {
export PACKAGEDIR="$HOME/.zsh/packages"
local package system fn
package="$1"
system="$(hostname --fqdn)"
fn="${PACKAGEDIR}/${system}-${package}"
if [[ -r $fn ]]; then
echo "Loading ${system}-${package}"
. $fn
else
echo "Couldn't find $fn"
fi
}
Reply
Resumed since lj limits post sizes. Lame.
Here's a pretty good example of my intended use (from .zsh/packages/hyperion-ace):
path=(/opt/ace/bin $path)
ldpath=(/opt/ace/lib64 $ldpath)
pidof Naming_Service &>/dev/null
if [[ $? -eq 0 ]]; then
echo "Reusing existing Naming_Service"
else
Naming_Service -ORBEndpoint iiop://`hostname`:4900 &
fi
export HOSTNAME=`hostname`
export NameServiceIOR=corbaloc:iiop:1.2@`hostname`:4900/NameService
Reply
Oh, and one more bit. Since my home dir is in git, I spend pretty much all my time in a git repo. This makes it very useful to know what repo I'm in. I put that info in my zsh RPROMPT:
mike@hyperion:~> cd Personal/mine/phwar (master:mike)
mike@hyperion:~/Personal/mine/phwar> cd VisionWorkbench (master:phwar)
~/Work/projects/VisionWorkbench
mike@hyperion:~/Work/projects/VisionWorkbench> git checkout 2.0_alpha5 (master:VisionWorkbench)
Switched to branch "2.0_alpha5"
mike@hyperion:~/Work/projects/VisionWorkbench> cd (2.0_alpha5:VisionWorkbench)
mike@hyperion:~> (master:mike)
And just to answer the obvious question- yes, zsh's RPROMPT does the right thing:
Reply
Leave a comment