Created
July 29, 2013 17:48
-
-
Save manutter51/6106145 to your computer and use it in GitHub Desktop.
bash snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
alias reload="source ~/.bashrc" | |
# source the sublimerc file if it exists | |
if [ -f "${HOME}/.sublimerc" ] ; then | |
source "${HOME}/.sublimerc" | |
fi | |
src() | |
{ | |
SRCDIR=/cygdrive/c/Users/mnutter/src | |
if [ -d "$SRCDIR/$1" ] ; then | |
cd "$SRCDIR/$1" | |
else | |
ls $SRCDIR | |
echo "Property $1 not found in $SRCDIR." | |
fi | |
} | |
_src_dirs() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
SRCDIR=/cygdrive/c/Users/mnutter/src | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts=`ls -1 $SRCDIR` | |
# if [[ ${cur} == -* ]] ; then | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0 | |
# fi | |
} | |
complete -F _src_dirs src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment