This file contains 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
" Comment / Uncomment line in vim w/ctrl+c / ctrl + u | |
nmap <C-c> V: s/\v^(\s*)/\1# /g<CR>:nohls<CR> | |
vmap <C-c> : s/\v^(\s*)/\1# /g<CR>:nohls<CR> |
This file contains 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
" If you use settitle, vim will set the window title to the file you have open, but when you exit, it sets the window title to | |
" Thanks for Flying Vim. | |
" In order to set it to the hostname of the machine you're on when exiting, use this: | |
execute "set titleold=".hostname() |
This file contains 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
function gs() { | |
if [ -z $1 ]; then | |
git status | |
else | |
git show $1 | |
fi | |
} |
This file contains 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
function wipe_ve() { | |
if [ "$VIRTUAL_ENV" ] && [[ $(pwd) != *`basename $VIRTUAL_ENV`* ]]; then | |
deactivate | |
fi | |
} | |
PROMPT_COMMAND="wipe_ve;$PROMPT_COMMAND" |
This file contains 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
NONE="\e[0m" | |
RED="\e[0;31m" | |
GREEN="\e[0;32m" | |
function last_exit_prompt() { | |
if [[ $? -eq 0 ]]; then | |
PS1="${PS1}\n\[${GREEN}\]>> \[${NONE}\]" | |
else | |
PS1="${PS1}\n\[${RED}\]>> \[${NONE}\]" | |
fi |
This file contains 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
function hl() { egrep --color -ie $@ -e '$'; } | |
# example: `cat some_file | hl what_i_want_highlighted` |
This file contains 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
function finf() { | |
find `pwd` \( \( -name .git -o -name '*.pyc' \) -prune \) \ | |
-o \( -type f -print0 \) \ | |
| xargs -0 grep -in --color "$@" 2>/dev/null; | |
} |
This file contains 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
# mimic osx pbcopy/pbpaste | |
alias pbcopy="xclip -selection clipboard -i" | |
alias pbpaste="xclip -selection clipboard -o" |
This file contains 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
alias engage='play -q -c2 -n synth whitenoise band -n 100 24 band -n 300 100 gain +20 &' |
This file contains 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
#!/usr/bin/perl | |
use strict; | |
use URI::Escape; | |
print uri_unescape($ARGV[0]) . "\n"; | |
exit; |
NewerOlder