Permalink
Browse files

create ri function, poor man's pgrep

  • Loading branch information...
1 parent 5996929 commit eda3baf2631771b8d0291a03ca4bb9e2609c9ae3 sshaw committed Apr 1, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 bashrc
View
18 bashrc
@@ -15,6 +15,7 @@ alias pinstall='pbuild && make install'
alias pb='perlbrew'
alias pd='perldoc'
+type -t pgrep > /dev/null || alias pgrep='ps ax | grep -v grep | egrep'
alias ll=' ls -lh'
alias fxml='xmllint --format'
alias vxsd='xmllint --noout --schema'
@@ -140,6 +141,23 @@ rake()
fi
}
+# Use RDoc server over `ri`
+ri()
+{
+ if [ -z "$1" ]; then
+ command ri
+ return
+ fi
+
+ # TODO: try to use whatever browser is currently open
+ url="http://localhost:8808/rdoc?q=$*"
+ if [ $(uname -s) == "Darwin" ]; then
+ open -a Opera "$url"
+ else
+ opera "$url" &
+ fi
+}
+
# rm empty directories
# usage: rmedir DIR [OPTIONS]
rmedir()

0 comments on commit eda3baf

Please sign in to comment.