I maintain accounts on lots of machines, and not all of them mount the same home directories. Keeping my profile files in a repository like this helps me maintain profiles across all the machines I need to do work on. Since I don't want bin, sbin, lib, man, and share directories directly in my home directory, I gather them all under a ~/my directory. This just helps me to keep my home directory a little neater. So I have ~/my/bin, ~/my/sbin, etc.
Zshell sources this file first for all instances (in the absence of -f). This is where I set up the environment I want everything to run in. Particularly, this is where the architechure-specific logic is.
The architecture awareness is based on information from uname and culminates in the value of the ARCHOS environment varaible. I use it to hold the name of the directory for architecture-specific files, which comes in handy when sharing filespace among disparate hosts and building architecture dependent projects. Under the $ARCHOS directory are the usual bin, sbin, lib, man, and share direcories. On my Mac, ARCHOS=/Users/jclough/my/archos/Darwin_14.3_x86_64.
| I called it ARCHOS because it combines architecture and OS information. Happy accident: It's also Latin for ruler (noun a person exercising government or dominion). |
|---|
fg_black=30fg_red=31fg_green=32fg_yellow=33fg_blue=34fg_magenta=35fg_cyan=36fg_white=37bg_black=40bg_red=41bg_green=42bg_yellow=43bg_blue=44bg_magenta=45bg_cyan=46bg_white=47colorNorm="0"colorDebug="$bg_blue;$fb_white"colorInfo="1;$bg_black;$fg_green"colorNotice="1;$bg_black;$fg_cyan"colorWarning="1;$bg_black;$fg_yellow"- `colorError="1;$bg_black;$fg_red
ARCHOSEDITORLD_LIBRARY_PATHMANPATHPAGERPATHPYTHONPATHRSYNC_RSHarchitectureoskernelosnamert_env_type
archos [-hnrka]Outputs the OS name (-n), OS release (-r), kernel version (-k), and/or architecture (-a) we're running under.date [ARGS]Output the current date formatted as "+%Y-%m-%d %H:%M:%S" UNLESS there are any command line argumnents, in which case this is just like the regulardatecommand.debug TEXT ...Outputs a timestamp and message in the colorDebug color if SCRIPT_DEBUG is not empty.echo_tc COLOR_CODE TEXT ...Outputs text in using the ANSI color code. Seeerror,warning, andinfofor examples.error TEXT ...Outputs a timestamp and message in the colorError color if SCRIPT_ERROR is not empty.info TEXT ...Outputs a timestamp and message in the colorInfo color if SCRIPT_INFO is not empty.notice TEXT ...Outputs a timestamp and message in the colorNotice color if SCRIPT_NOTICE is not empty.prepend_pathprepend_pathsrealpathwarning TEXT ...Outputs a timestamp and message in the colorWarning color if SCRIPT_WARNING is not empty.
Zshell sources .zprofile after .zshenv and before .zshrc. Other than that, it's just like .zlogin (which I don't actually use). At the moment, I'm only using .zprofile to correct an svn-related command completion bug in the stock distributeion of Zshell.
_pip_completion
Zshell sources .zshrc in interactive shells. I set up things like LSCOLORS, command history options, command aliases, and window title management here.
HISTFILEHISTSIZESAVEHISTCLICOLORLSCOLORSLS_COLORS
anagram TEXTOutput all anagrams of the given word.tabtitle TEXTSet the title of the current session tab. (Requires iTerm2 integration)windowtitle TEXTSet the title of the current terminal window. (Requires iTerm2 integration)precmdManages the shell prompt, and if iTerm2 integration is enabled, set the terminal tab text and window title.ML [RE_to_grep_for] FILEColors (and optionally filters) log output from the given file.
R='sudo /bin/zsh -c "source ~jclough/z"'(available under RHEL7)less='less -R 'ls='ls -F'la='ls -a'll='ls -l'lla='ll -a'lld='ll -d'lrt='ll -rt'lrtail='lrt|tail 'MD='mark -Idiff'vi='/usr/bin/vim 'view='/usr/bin/vim -R 'R='sudo /bin/zsh -c "source ~$USER/z"'pt='ps -H'
The *-prolog and *-epilog files are sourced, if they exist, from the start and end, respectively, of the corresponding profile files. This supports machine-specific behavior without having a lot of conditional logic for that purpose in the "standard" profile files.
There are also .inputrc (to turn on vi editing for readline-based input) and .vimrc (to bend vim to my capricious will) files in this project. They're handy to take with me and troublesome to recreate from scratch.
This project supports iTerm2's shell integration. If needed, those scripts can be installed with the following command:
curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash
Or if your system is sadly without curl, you can try wget like this:
wget --no-check-certificate -qO- https://iterm2.com/misc/install_shell_integration_and_utilities.sh |\
sed 's/curl -SsL/wget --no-check-certificate -qO-/' | bash
IN EITHER CASE, be SURE to remove the line that's added to the end of .zshenv that sources ~/.iterm2_shell_integration.$SHELL. We do this semi-intelligently in .zshrc (or .bashrc) instead so that we can keep the .bash and .zsh versions from being sourced from the wrong shell. FAILURE TO REMEMBER THIS AFTER UPDATING THE SHELL INTEGRATION SCRIPTS CAN SERIOUSLY MESS UP YOUR ABILITY TO LOG IN.