Add shell samples

This commit is contained in:
Joshua Peek
2012-12-10 09:45:54 -06:00
parent d00dfd82c1
commit 7c170972a0
21 changed files with 730 additions and 86 deletions

View File

@@ -1162,16 +1162,6 @@ Shell:
- bash
- zsh
primary_extension: .sh
filenames:
- .zsh
- bash_logout
- bash_profile
- bashrc
- zlogin
- zlogout
- zshenv
- zprofile
- zshrc
Smalltalk:
type: programming

View File

@@ -261,12 +261,29 @@
"Rakefile"
],
"Shell": [
".bash_logout",
".bash_profile",
".bashrc",
".cshrc",
".login",
".profile",
".zlogin",
".zlogout",
".zprofile",
".zshenv",
".zshrc",
"PKGBUILD"
"PKGBUILD",
"bash_logout",
"bash_profile",
"bashrc",
"cshrc",
"login",
"profile",
"zlogin",
"zlogout",
"zprofile",
"zshenv",
"zshrc"
],
"VimL": [
".gvimrc",
@@ -276,8 +293,8 @@
".gemrc"
]
},
"tokens_total": 273523,
"languages_total": 287,
"tokens_total": 274995,
"languages_total": 304,
"tokens": {
"ApacheConf": {
"ServerSignature": 1,
@@ -25923,21 +25940,327 @@
},
"Shell": {
"SHEBANG#!bash": 6,
"echo": 53,
"export": 6,
"PATH": 5,
"echo": 63,
"/usr/bin/clear": 2,
"##": 28,
"if": 39,
"[": 82,
"-": 362,
"z": 12,
"]": 82,
";": 131,
"then": 41,
"n": 17,
"export": 25,
"SCREENDIR": 2,
"fi": 34,
"PATH": 12,
"/usr/local/bin": 4,
"/usr/local/sbin": 4,
"/usr/xpg4/bin": 4,
"/usr/sbin": 4,
"/usr/bin": 6,
"/usr/sfw/bin": 4,
"/usr/ccs/bin": 4,
"/usr/openwin/bin": 4,
"/opt/mysql/current/bin": 4,
"MANPATH": 2,
"/usr/local/man": 2,
"/usr/share/man": 2,
"Random": 2,
"ENV...": 2,
"{": 59,
"TERM": 4,
"}": 57,
"COLORTERM": 2,
"CLICOLOR": 2,
"#": 53,
"can": 3,
"be": 3,
"set": 21,
"to": 33,
"anything": 2,
"actually": 2,
"DISPLAY": 2,
"r": 17,
"&&": 56,
".": 4,
"function": 6,
"ls": 6,
"command": 5,
"Fh": 2,
"l": 8,
"list": 3,
"in": 24,
"long": 2,
"format...": 2,
"ll": 2,
"|": 16,
"less": 2,
"XF": 2,
"pipe": 2,
"into": 3,
"#CDPATH": 2,
"HISTIGNORE": 2,
"HISTCONTROL": 2,
"ignoreboth": 2,
"shopt": 13,
"s": 10,
"cdspell": 2,
"extglob": 2,
"progcomp": 2,
"complete": 82,
"f": 65,
"X": 54,
"bunzip2": 2,
"bzcat": 2,
"bzcmp": 2,
"bzdiff": 2,
"bzegrep": 2,
"bzfgrep": 2,
"bzgrep": 2,
"unzip": 2,
"zipinfo": 2,
"compress": 2,
"znew": 2,
"gunzip": 2,
"zcmp": 2,
"zdiff": 2,
"zcat": 2,
"zegrep": 2,
"zfgrep": 2,
"zgrep": 2,
"zless": 2,
"zmore": 2,
"uncompress": 2,
"ee": 2,
"display": 2,
"xv": 2,
"qiv": 2,
"gv": 2,
"ggv": 2,
"xdvi": 2,
"dvips": 2,
"dviselect": 2,
"dvitype": 2,
"acroread": 2,
"xpdf": 2,
"makeinfo": 2,
"texi2html": 2,
"tex": 2,
"latex": 2,
"slitex": 2,
"jadetex": 2,
"pdfjadetex": 2,
"pdftex": 2,
"pdflatex": 2,
"texi2dvi": 2,
"mpg123": 2,
"mpg321": 2,
"xine": 2,
"aviplay": 2,
"realplay": 2,
"xanim": 2,
"ogg123": 2,
"gqmpeg": 2,
"freeamp": 2,
"xmms": 2,
"xfig": 2,
"timidity": 2,
"playmidi": 2,
"vi": 2,
"vim": 2,
"gvim": 2,
"rvim": 2,
"view": 2,
"rview": 2,
"rgvim": 2,
"rgview": 2,
"gview": 2,
"emacs": 2,
"wine": 2,
"bzme": 2,
"netscape": 2,
"mozilla": 2,
"lynx": 2,
"opera": 2,
"w3m": 2,
"galeon": 2,
"curl": 6,
"dillo": 2,
"elinks": 2,
"links": 2,
"u": 2,
"su": 2,
"passwd": 2,
"groups": 2,
"user": 2,
"commands": 8,
"see": 4,
"only": 6,
"users": 2,
"A": 10,
"stopped": 4,
"P": 4,
"bg": 4,
"completes": 10,
"with": 12,
"jobs": 4,
"j": 2,
"fg": 2,
"disown": 2,
"other": 2,
"job": 3,
"v": 9,
"readonly": 4,
"unset": 10,
"and": 5,
"shell": 4,
"variables": 2,
"setopt": 8,
"options": 8,
"helptopic": 2,
"help": 5,
"helptopics": 2,
"a": 11,
"unalias": 4,
"aliases": 2,
"binding": 2,
"bind": 4,
"readline": 2,
"bindings": 2,
"(": 107,
"make": 6,
"this": 6,
"more": 3,
"intelligent": 2,
")": 152,
"c": 2,
"type": 5,
"which": 10,
"man": 6,
"#sudo": 2,
"on": 4,
"d": 9,
"pushd": 2,
"cd": 6,
"rmdir": 2,
"Make": 2,
"directory": 5,
"directories": 2,
"W": 2,
"alias": 42,
"no": 13,
"filenames": 2,
"for": 7,
"PS1": 2,
"..": 2,
"cd..": 2,
"t": 3,
"csh": 2,
"is": 11,
"same": 2,
"as": 2,
"bash...": 2,
"quit": 2,
"q": 6,
"even": 3,
"shorter": 2,
"D": 2,
"rehash": 2,
"source": 7,
"/.bashrc": 3,
"after": 2,
"I": 2,
"edit": 2,
"it": 2,
"pg": 2,
"patch": 2,
"sed": 2,
"awk": 2,
"diff": 2,
"grep": 8,
"find": 2,
"ps": 2,
"whoami": 2,
"ping": 2,
"histappend": 2,
"PROMPT_COMMAND": 2,
"umask": 2,
"path": 13,
"/opt/local/bin": 2,
"/opt/local/sbin": 2,
"/bin": 2,
"prompt": 2,
"history": 18,
"endif": 2,
"stty": 2,
"istrip": 2,
"dirpersiststore": 2,
"##############################################################################": 16,
"#Import": 2,
"the": 17,
"agnostic": 2,
"Bash": 3,
"or": 3,
"Zsh": 2,
"environment": 2,
"config": 4,
"/.profile": 2,
"HISTSIZE": 2,
"#How": 2,
"many": 2,
"lines": 2,
"of": 6,
"keep": 3,
"memory": 3,
"HISTFILE": 2,
"/.zsh_history": 2,
"#Where": 2,
"save": 4,
"disk": 5,
"SAVEHIST": 2,
"#Number": 2,
"entries": 2,
"HISTDUP": 2,
"erase": 2,
"#Erase": 2,
"duplicates": 2,
"file": 9,
"appendhistory": 2,
"#Append": 2,
"overwriting": 2,
"sharehistory": 2,
"#Share": 2,
"across": 2,
"terminals": 2,
"incappendhistory": 2,
"#Immediately": 2,
"append": 2,
"not": 2,
"just": 2,
"when": 2,
"term": 2,
"killed": 2,
"#.": 2,
"/.dotfiles/z": 4,
"zsh/z.sh": 2,
"#function": 2,
"precmd": 2,
"rupa/z.sh": 2,
"fpath": 6,
"HOME/.zsh/func": 2,
"typeset": 2,
"U": 2,
"pkgname": 1,
"stud": 4,
"-": 182,
"git": 9,
"pkgver": 1,
"pkgrel": 1,
"pkgdesc": 1,
"arch": 1,
"(": 89,
"i686": 1,
"x86_64": 1,
")": 134,
"url": 4,
"license": 1,
"depends": 1,
@@ -25951,25 +26274,13 @@
"//github.com/bumptech/stud.git": 1,
"_gitname": 1,
"build": 2,
"{": 49,
"cd": 4,
"msg": 4,
"if": 27,
"[": 70,
"d": 7,
"]": 70,
";": 115,
"then": 29,
"&&": 54,
"pull": 3,
"origin": 1,
"else": 10,
"clone": 2,
"fi": 24,
"rm": 2,
"rf": 1,
"make": 2,
"}": 47,
"package": 1,
"PREFIX": 1,
"/usr": 1,
@@ -25979,17 +26290,11 @@
"init.stud": 1,
"mkdir": 2,
"p": 2,
"#": 11,
"Bash": 1,
"script": 1,
"to": 15,
"the": 9,
"dotfile": 1,
"repository": 3,
"does": 1,
"a": 7,
"lot": 1,
"of": 2,
"fun": 2,
"stuff": 3,
"like": 1,
@@ -25998,9 +26303,7 @@
"dotfiles": 1,
"eg": 1,
".bashrc": 1,
"into": 1,
"symlinks": 1,
"this": 4,
"away": 1,
"optionally": 1,
"moving": 1,
@@ -26009,21 +26312,14 @@
"so": 1,
"that": 1,
"they": 1,
"can": 1,
"be": 1,
"preserved": 1,
"setting": 2,
"up": 1,
"cron": 1,
"job": 1,
"automate": 1,
"aforementioned": 1,
"and": 1,
"maybe": 1,
"some": 1,
"more": 1,
"shopt": 1,
"s": 6,
"nocasematch": 1,
"This": 1,
"makes": 1,
@@ -26039,44 +26335,31 @@
"print_help": 2,
"e": 4,
"exit": 9,
"for": 5,
"opt": 3,
"in": 14,
"@": 3,
"do": 7,
"k": 1,
"|": 14,
"keep": 1,
"local": 22,
"false": 2,
"h": 3,
"help": 3,
"esac": 6,
"done": 7,
"f": 11,
".*": 2,
"o": 3,
"continue": 1,
"mv": 1,
"ln": 1,
"config": 2,
"remote.origin.url": 1,
"remote.origin.pushurl": 1,
"crontab": 1,
".jobs.cron": 1,
"source": 3,
"/.bashrc": 1,
"set": 9,
"n": 7,
"x": 1,
"unset": 6,
"system": 1,
"exec": 3,
"rbenv": 2,
"versions": 1,
"bare": 1,
"version": 11,
"z": 4,
"&": 5,
"prefix": 1,
"/dev/null": 6,
@@ -26087,7 +26370,6 @@
"ef": 1,
"+": 1,
"GREP_OPTIONS": 1,
"grep": 6,
"printf": 4,
"rvm_path": 4,
"UID": 1,
@@ -26095,7 +26377,6 @@
"rvm_is_not_a_shell_function": 2,
"rvm_path/scripts": 1,
"rvm": 1,
"r": 15,
"sbt_release_version": 2,
"sbt_snapshot_version": 2,
"SNAPSHOT": 3,
@@ -26121,20 +26402,16 @@
"return": 3,
"perl": 3,
"pi": 1,
"q": 4,
"||": 12,
"Updated": 1,
"file": 3,
"Previous": 1,
"value": 1,
"was": 1,
"sbt_version": 8,
"v": 5,
"echoerr": 3,
"vlog": 1,
"dlog": 8,
"get_script_path": 2,
"path": 11,
"L": 1,
"target": 1,
"readlink": 1,
@@ -26180,9 +26457,6 @@
"sbt": 18,
"sbt_artifactory_list": 2,
"version0": 2,
"curl": 4,
"list": 1,
"only": 2,
"F": 1,
"pe": 1,
"make_release_url": 2,
@@ -26195,7 +26469,6 @@
"download_url": 2,
"jar": 3,
"dirname": 1,
"which": 4,
"fail": 1,
"silent": 1,
"output": 1,
@@ -26208,17 +26481,14 @@
"<<": 2,
"EOM": 3,
"Usage": 1,
"options": 4,
"print": 1,
"message": 1,
"runner": 1,
"is": 5,
"chattier": 1,
"log": 2,
"level": 2,
"Debug": 1,
"Error": 1,
"no": 9,
"colors": 2,
"disable": 1,
"ANSI": 1,
@@ -26226,9 +26496,7 @@
"codes": 1,
"create": 2,
"start": 1,
"even": 1,
"current": 1,
"directory": 3,
"contains": 2,
"project": 1,
"dir": 3,
@@ -26246,7 +26514,6 @@
"Ivy": 1,
"/.ivy2": 1,
"<integer>": 1,
"memory": 1,
"share": 2,
"use": 1,
"all": 1,
@@ -26258,7 +26525,6 @@
"jvm": 2,
"<port>": 1,
"Turn": 1,
"on": 2,
"JVM": 1,
"debugging": 1,
"open": 1,
@@ -26284,7 +26550,6 @@
"stripped": 1,
"In": 1,
"duplicated": 1,
"or": 1,
"conflicting": 1,
"order": 1,
"above": 1,
@@ -26292,7 +26557,6 @@
"precedence": 1,
"JAVA_OPTS": 1,
"lowest": 1,
"command": 1,
"line": 1,
"highest.": 1,
"addJava": 9,
@@ -26304,7 +26568,6 @@
"get_jvm_opts": 2,
"process_args": 2,
"require_arg": 12,
"type": 1,
"while": 2,
"gt": 1,
"shift": 28,
@@ -26337,7 +26600,6 @@
"ThisBuild": 1,
"Update": 1,
"properties": 1,
"disk": 1,
"explicit": 1,
"gives": 1,
"us": 1,
@@ -26352,7 +26614,6 @@
"./project": 1,
"pwd": 1,
"doesn": 1,
"t": 1,
"understand": 1,
"iflast": 1,
"#residual_args": 1,
@@ -28470,7 +28731,7 @@
"Scheme": 3478,
"Scilab": 69,
"SCSS": 39,
"Shell": 2009,
"Shell": 3481,
"Standard ML": 243,
"SuperCollider": 135,
"Tea": 3,
@@ -28545,7 +28806,7 @@
"Scheme": 1,
"Scilab": 3,
"SCSS": 1,
"Shell": 17,
"Shell": 34,
"Standard ML": 2,
"SuperCollider": 1,
"Tea": 1,
@@ -28560,5 +28821,5 @@
"XSLT": 1,
"YAML": 1
},
"md5": "abe754c33b0b8bd82a2b60ecc08d00a4"
"md5": "85a9c056dba62cfff4c4c87a29c9547a"
}

View File

@@ -0,0 +1 @@
/usr/bin/clear

View File

@@ -1 +1,36 @@
export PATH="/usr/local/bin:/usr/bin:/bin"
##
# Environment...
##
# Set up some variables for 'screen'
if [ -z "${SCREENDIR}" ];then echo -n
export SCREENDIR="${HOME}/.screen"
# Save my screen sockets within my $HOME dir
fi
## PATH
export PATH=/usr/local/bin:/usr/local/sbin:/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/openwin/bin:/opt/mysql/current/bin
export MANPATH=/usr/local/man:/usr/share/man
## Random ENV...
# Set $TERM to 'vt100' (a safe default) if, for some
# reason, it is set to 'network' (which is not valid!)
if [ ${TERM} == 'network' ];then echo -n
export TERM='vt100'
# not 'nsterm' because if its 'network' we're
# probly not in Terminal.app
fi
# Set $COLORTERM, all this does is trick *some* apps into
# using color in the terminal, which should happen anyway.
if [ -z "${COLORTERM}" ];then echo -n
export COLORTERM="${TERM}"
fi
# another color option, this one for BSD's ls
if [ -z "${CLICOLOR}" ];then echo -n
export CLICOLOR='1' # can be set to anything, actually
fi
# If $DISPLAY is not already set, set it!
if [ -z "${DISPLAY}" ];then echo -n
export DISPLAY=':0'
fi
##
# Source the bash rc file
[ -r "${HOME}/.bashrc" ] && . "${HOME}/.bashrc"

View File

@@ -1 +1,119 @@
export PATH="/usr/local/bin:/usr/bin:/bin"
##
# Functions... *MUCH* better than aliases, and they do more too!
# but they clutter the environment... (try typing just 'set' at the prompt)
##
# The reason that some of these are... odd... is because
# I had to convert them early because bash can't do positional
# arguments in aliases! functionName () { do something $@<-arguments ; }
function ls { command ls -Fh "$@"; }
# 'command ls' to prevent loop; -A for .file, -F for dir/ link@,
# -h for 5k 3m 1g, -o for printing flags (uchg)...
function l { ls -l "$@"; } # -l to list in long format...
function ll { l "$@" | less -XF ; } # pipe into 'more'
##
# Tips and Ticks... from http://www.caliban.org/bash/index.shtml
##
# The $CDPATH variable is so that you can be in /path/to/something and 'cd'
# to 'somethingElse' and end up in /not/the/same/path/to/somethingElse.
# iWould use it if it didn't ALWAYS echo the directory it changes to!
#CDPATH='.:~'
#
# HISTIGNORE="&:l:ls:ls *:l *:cd:cd *:[bf]g:exit:quit:q:sleep *"
# History ignores commands that include any l/ls/cd etc
# This kicks-ass! It drops repeats and other useless
# things from the command history!
HISTIGNORE="[bf]g:exit:quit:q:sleep *"
# I want to see l/ls/cd in my history
HISTCONTROL=ignoreboth
# ignores both commands that start with a space or a tab, and duplicates
# other options are as follows:
# `ignorespace' means to not enter lines which begin with a space or tab into the history list.
# `ignoredups' means to not enter lines which match the last entered line.
# `ignoreboth' combines the two options.
shopt -s cdspell extglob progcomp
# Spell check for 'cd', extended globbing, programmable completion
##
# Bash Completion... Cannibalised from bash_completion 20030929
# Completion defaults... Yes, its long...
# Basically this sets up many useful defaults for command completion, these
# should probly be built into bash. Use bash_completions itself if you want
# more functionality and don't mind the hacks it uses.
complete -f -X '!*.?(t)bz2' bunzip2 bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep
complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi)' unzip zipinfo
complete -f -X '*.Z' compress znew
complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcmp zdiff zcat zegrep zfgrep zgrep zless zmore
complete -f -X '!*.Z' uncompress
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|GIF|JP?(E)G|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA)' ee display
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.Z))' gv ggv
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi
complete -f -X '!*.@(dvi|DVI)' dvips dviselect dvitype
complete -f -X '!*.@(pdf|PDF)' acroread xpdf
complete -f -X '!*.texi*' makeinfo texi2html
complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
complete -f -X '!*.@(mp3|MP3|m3u)' mpg123 mpg321
complete -f -X '!*.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|bin|dat|vcd|ps|pes|fli|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp3|MP3|ogg|OGG|ogm|OGM|mp4|MP4|wav|WAV)' xine
complete -f -X '!*.@(avi|asf|wmv)' aviplay
complete -f -X '!*.@(rm|ram|smi?(l))' realplay
complete -f -X '!*.@(mp?(e)g|avi|mov|qt)' xanim
complete -f -X '!*.@(ogg|OGG|m3u)' ogg123
complete -f -X '!*.@(mp3|MP3|ogg|OGG|pls|m3u)' gqmpeg freeamp
complete -f -X '!*.@(mp[23]|MP[23]|ogg|OGG|wav|WAV|pls|m3u|xm|mod|s[3t]m|it|mtm|ult|flac)' xmms
complete -f -X '!*.fig' xfig
complete -f -X '!*.@(mid?(i))' timidity playmidi
complete -f -X '.*|*.@(o|so|so.!(conf)|a|tar?(.@(gz|bz2))|tgz|tbz2|rpm|zip|ZIP|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview emacs
complete -f -X '!*.@(exe|EXE|com|COM|scr|SCR)' wine
complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme
complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera w3m galeon curl dillo elinks links
#
complete -u su passwd groups # user commands see only users
complete -A stopped -P '%' bg # bg completes with stopped jobs
complete -j -P '%' fg jobs disown # other job commands
complete -v readonly unset export # readonly and unset complete with shell variables
complete -A setopt set # set completes with set options
complete -A shopt shopt # shopt completes with shopt options
complete -A helptopic help # helptopics
complete -a unalias # unalias completes with aliases
complete -A binding bind # bind completes with readline bindings (make this more intelligent)
complete -c command type which man #sudo # type, which, man complete on commands
complete -d pushd cd rmdir # Make directory commands see only directories
complete -W ' ' alias # no filenames for alias,
##
# Set the prompt
##
PS1="[\h:\w] \[\033[1;34m\]\u\[\033[0m\]\\$ "
# My prompt line: "[gaelicWizard:~/Documents] user$ " user is in blue
# Or: "[gaelicWizard:~/Documents] root# " root is in blue
##
# Aliases:
##
# Aliases frequently used...
alias ..='cd ..;l'
alias cd..='cd ..'
alias which='type' # 'which' in (t)csh is same(?) as 'type' in bash...
alias quit='exit'
alias q='quit' # and 'q' is even shorter! :-D
alias v='vim'
alias rehash='. ~/.bashrc;' # source ~/.bashrc after I edit it
alias pg='ps -afe|grep -v grep|grep'
alias make='gmake'
alias patch='gpatch'
alias sed='gsed'
alias awk='nawk'
alias diff='gdiff'
alias grep='ggrep'
alias find='gfind'
alias ps='/usr/ucb/ps'
alias whoami='/usr/ucb/whoami'
alias ping='ping -s'
alias man='GROFF_NO_SGR= TCAT="less -s" TROFF="groff -Tascii" man -t'
# The rest are uncategorised and fairly random... :-)
shopt -s histappend
PROMPT_COMMAND='echo -ne "\033]0;${USER} on ${HOSTNAME} at ${PWD}\007" && history -a'
export PATH=/usr/local/bin:/usr/local/sbin:/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/openwin/bin:/opt/mysql/current/bin

View File

@@ -0,0 +1,5 @@
umask 022
set path=(/opt/local/bin /opt/local/sbin /bin /usr/bin)
if ( $?prompt ) then
set history=32
endif

View File

@@ -0,0 +1,2 @@
stty -istrip
# setenv TERM `tset -Q -`

View File

@@ -0,0 +1,3 @@
# Store dirs stack
# See ~/.dotfiles/oh-my-zsh/plugins/dirspersist.plugin.zsh
dirpersiststore

View File

@@ -0,0 +1,28 @@
##############################################################################
#Import the shell-agnostic (Bash or Zsh) environment config
##############################################################################
source ~/.profile
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
##############################################################################
# sjl/z-zsh setup
##############################################################################
#. ~/.dotfiles/z-zsh/z.sh
#function precmd () {
# z --add "$(pwd -P)"
#}
##############################################################################
# rupa/z setup
##############################################################################
. ~/.dotfiles/z-rupa/z.sh

View File

@@ -0,0 +1,2 @@
fpath=($fpath $HOME/.zsh/func)
typeset -U fpath

View File

@@ -0,0 +1 @@
/usr/bin/clear

View File

@@ -0,0 +1,36 @@
##
# Environment...
##
# Set up some variables for 'screen'
if [ -z "${SCREENDIR}" ];then echo -n
export SCREENDIR="${HOME}/.screen"
# Save my screen sockets within my $HOME dir
fi
## PATH
export PATH=/usr/local/bin:/usr/local/sbin:/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/openwin/bin:/opt/mysql/current/bin
export MANPATH=/usr/local/man:/usr/share/man
## Random ENV...
# Set $TERM to 'vt100' (a safe default) if, for some
# reason, it is set to 'network' (which is not valid!)
if [ ${TERM} == 'network' ];then echo -n
export TERM='vt100'
# not 'nsterm' because if its 'network' we're
# probly not in Terminal.app
fi
# Set $COLORTERM, all this does is trick *some* apps into
# using color in the terminal, which should happen anyway.
if [ -z "${COLORTERM}" ];then echo -n
export COLORTERM="${TERM}"
fi
# another color option, this one for BSD's ls
if [ -z "${CLICOLOR}" ];then echo -n
export CLICOLOR='1' # can be set to anything, actually
fi
# If $DISPLAY is not already set, set it!
if [ -z "${DISPLAY}" ];then echo -n
export DISPLAY=':0'
fi
##
# Source the bash rc file
[ -r "${HOME}/.bashrc" ] && . "${HOME}/.bashrc"

View File

@@ -0,0 +1,119 @@
##
# Functions... *MUCH* better than aliases, and they do more too!
# but they clutter the environment... (try typing just 'set' at the prompt)
##
# The reason that some of these are... odd... is because
# I had to convert them early because bash can't do positional
# arguments in aliases! functionName () { do something $@<-arguments ; }
function ls { command ls -Fh "$@"; }
# 'command ls' to prevent loop; -A for .file, -F for dir/ link@,
# -h for 5k 3m 1g, -o for printing flags (uchg)...
function l { ls -l "$@"; } # -l to list in long format...
function ll { l "$@" | less -XF ; } # pipe into 'more'
##
# Tips and Ticks... from http://www.caliban.org/bash/index.shtml
##
# The $CDPATH variable is so that you can be in /path/to/something and 'cd'
# to 'somethingElse' and end up in /not/the/same/path/to/somethingElse.
# iWould use it if it didn't ALWAYS echo the directory it changes to!
#CDPATH='.:~'
#
# HISTIGNORE="&:l:ls:ls *:l *:cd:cd *:[bf]g:exit:quit:q:sleep *"
# History ignores commands that include any l/ls/cd etc
# This kicks-ass! It drops repeats and other useless
# things from the command history!
HISTIGNORE="[bf]g:exit:quit:q:sleep *"
# I want to see l/ls/cd in my history
HISTCONTROL=ignoreboth
# ignores both commands that start with a space or a tab, and duplicates
# other options are as follows:
# `ignorespace' means to not enter lines which begin with a space or tab into the history list.
# `ignoredups' means to not enter lines which match the last entered line.
# `ignoreboth' combines the two options.
shopt -s cdspell extglob progcomp
# Spell check for 'cd', extended globbing, programmable completion
##
# Bash Completion... Cannibalised from bash_completion 20030929
# Completion defaults... Yes, its long...
# Basically this sets up many useful defaults for command completion, these
# should probly be built into bash. Use bash_completions itself if you want
# more functionality and don't mind the hacks it uses.
complete -f -X '!*.?(t)bz2' bunzip2 bzcat bzcmp bzdiff bzegrep bzfgrep bzgrep
complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi)' unzip zipinfo
complete -f -X '*.Z' compress znew
complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcmp zdiff zcat zegrep zfgrep zgrep zless zmore
complete -f -X '!*.Z' uncompress
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|GIF|JP?(E)G|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA)' ee display
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.Z))' gv ggv
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi
complete -f -X '!*.@(dvi|DVI)' dvips dviselect dvitype
complete -f -X '!*.@(pdf|PDF)' acroread xpdf
complete -f -X '!*.texi*' makeinfo texi2html
complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
complete -f -X '!*.@(mp3|MP3|m3u)' mpg123 mpg321
complete -f -X '!*.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|bin|dat|vcd|ps|pes|fli|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp3|MP3|ogg|OGG|ogm|OGM|mp4|MP4|wav|WAV)' xine
complete -f -X '!*.@(avi|asf|wmv)' aviplay
complete -f -X '!*.@(rm|ram|smi?(l))' realplay
complete -f -X '!*.@(mp?(e)g|avi|mov|qt)' xanim
complete -f -X '!*.@(ogg|OGG|m3u)' ogg123
complete -f -X '!*.@(mp3|MP3|ogg|OGG|pls|m3u)' gqmpeg freeamp
complete -f -X '!*.@(mp[23]|MP[23]|ogg|OGG|wav|WAV|pls|m3u|xm|mod|s[3t]m|it|mtm|ult|flac)' xmms
complete -f -X '!*.fig' xfig
complete -f -X '!*.@(mid?(i))' timidity playmidi
complete -f -X '.*|*.@(o|so|so.!(conf)|a|tar?(.@(gz|bz2))|tgz|tbz2|rpm|zip|ZIP|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview emacs
complete -f -X '!*.@(exe|EXE|com|COM|scr|SCR)' wine
complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme
complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera w3m galeon curl dillo elinks links
#
complete -u su passwd groups # user commands see only users
complete -A stopped -P '%' bg # bg completes with stopped jobs
complete -j -P '%' fg jobs disown # other job commands
complete -v readonly unset export # readonly and unset complete with shell variables
complete -A setopt set # set completes with set options
complete -A shopt shopt # shopt completes with shopt options
complete -A helptopic help # helptopics
complete -a unalias # unalias completes with aliases
complete -A binding bind # bind completes with readline bindings (make this more intelligent)
complete -c command type which man #sudo # type, which, man complete on commands
complete -d pushd cd rmdir # Make directory commands see only directories
complete -W ' ' alias # no filenames for alias,
##
# Set the prompt
##
PS1="[\h:\w] \[\033[1;34m\]\u\[\033[0m\]\\$ "
# My prompt line: "[gaelicWizard:~/Documents] user$ " user is in blue
# Or: "[gaelicWizard:~/Documents] root# " root is in blue
##
# Aliases:
##
# Aliases frequently used...
alias ..='cd ..;l'
alias cd..='cd ..'
alias which='type' # 'which' in (t)csh is same(?) as 'type' in bash...
alias quit='exit'
alias q='quit' # and 'q' is even shorter! :-D
alias v='vim'
alias rehash='. ~/.bashrc;' # source ~/.bashrc after I edit it
alias pg='ps -afe|grep -v grep|grep'
alias make='gmake'
alias patch='gpatch'
alias sed='gsed'
alias awk='nawk'
alias diff='gdiff'
alias grep='ggrep'
alias find='gfind'
alias ps='/usr/ucb/ps'
alias whoami='/usr/ucb/whoami'
alias ping='ping -s'
alias man='GROFF_NO_SGR= TCAT="less -s" TROFF="groff -Tascii" man -t'
# The rest are uncategorised and fairly random... :-)
shopt -s histappend
PROMPT_COMMAND='echo -ne "\033]0;${USER} on ${HOSTNAME} at ${PWD}\007" && history -a'
export PATH=/usr/local/bin:/usr/local/sbin:/usr/xpg4/bin:/usr/sbin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/openwin/bin:/opt/mysql/current/bin

View File

@@ -0,0 +1,5 @@
umask 022
set path=(/opt/local/bin /opt/local/sbin /bin /usr/bin)
if ( $?prompt ) then
set history=32
endif

View File

@@ -0,0 +1,2 @@
stty -istrip
# setenv TERM `tset -Q -`

View File

@@ -0,0 +1 @@
export PATH="/usr/local/bin:/usr/bin:/bin"

View File

@@ -0,0 +1 @@
export PATH="/usr/local/bin:/usr/bin:/bin"

View File

@@ -0,0 +1,3 @@
# Store dirs stack
# See ~/.dotfiles/oh-my-zsh/plugins/dirspersist.plugin.zsh
dirpersiststore

View File

@@ -0,0 +1,28 @@
##############################################################################
#Import the shell-agnostic (Bash or Zsh) environment config
##############################################################################
source ~/.profile
##############################################################################
# History Configuration
##############################################################################
HISTSIZE=5000 #How many lines of history to keep in memory
HISTFILE=~/.zsh_history #Where to save history to disk
SAVEHIST=5000 #Number of history entries to save to disk
HISTDUP=erase #Erase duplicates in the history file
setopt appendhistory #Append history to the history file (no overwriting)
setopt sharehistory #Share history across terminals
setopt incappendhistory #Immediately append to the history file, not just when a term is killed
##############################################################################
# sjl/z-zsh setup
##############################################################################
#. ~/.dotfiles/z-zsh/z.sh
#function precmd () {
# z --add "$(pwd -P)"
#}
##############################################################################
# rupa/z setup
##############################################################################
. ~/.dotfiles/z-rupa/z.sh

View File

@@ -0,0 +1,2 @@
fpath=($fpath $HOME/.zsh/func)
typeset -U fpath

View File

@@ -0,0 +1 @@
export PATH="/usr/local/bin:/usr/bin:/bin"