Skip to content
Browse files

add install script, more init scripts, various changes...

  • Loading branch information...
1 parent ed5851f commit d76381430f251d614963ea65a03d27972f6be67b sshaw committed Sep 22, 2012
Showing with 70 additions and 15 deletions.
  1. +20 −7 bash_profile
  2. +7 −2 bashrc
  3. +1 −0 digrc
  4. +12 −0 install.sh
  5. +25 −6 irbrc
  6. +4 −0 mongorc.js
  7. +1 −0 rdebugrc
View
27 bash_profile
@@ -2,15 +2,28 @@
[ -s ~/.bashrc ] && source ~/.bashrc
export RI=-fansi
-# -F doesnt work on OS X..?
-export LESS=-FRi
export RUBYOPT=rubygems
-export EDITOR=emacs
+export EDITOR="emacs --no-init"
export ESHELL=bash
-export PATH=$PATH:/usr/sbin:$HOME/usr/bin
+export PAGER=less
+export PATH=$PATH:/usr/sbin:/usr/local/sbin:$HOME/usr/bin
export PERLDOC=-MPod::Text::Ansi
# Interpret ANSI codes and don't warn about a bin file
export PERLDOC_PAGER="less -fR"
-export FIGNORE=.svn:.git
-# erasedups needs >= 3
-export HISTCONTROL=ignoreboth:erasedups
+export GLOBIGNORE=*~:.#*:.git:.svn
+export HISTSIZE=5000
+export HISTFILESIZE=1000
+export HISTCONTROL=ignoreboth
+
+LESS=-FRi
+#JAVA_HOME=/usr/java/latest on Fed 10
+
+if [ $(uname -s) == "Darwin" ]
+then
+ # On OS X -F quits without displaying
+ LESS=-Ri
+ JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
+fi
+
+export LESS
+export JAVA_HOME
View
9 bashrc
@@ -12,10 +12,15 @@ alias build='make && { make test || make check; }'
alias pbuild='perl Makefile.PL && make && make test'
alias pinstall='pbuild && make install'
alias pb='perlbrew'
-alias lr='ls -lt | head'
+
+alias ll=' ls -l'
+alias lr=' ls -lt | head'
+
alias fxml='xmllint --format'
+alias vxsd='xmllint --noout --schema'
+alias vrng='xmllint --noout --relaxng' # Trang is much better for this...
-shopt -s cdspell cdable_vars extglob no_empty_cmd_completion histappend
+shopt -s cdspell cdable_vars cmdhist extglob histappend no_empty_cmd_completion
for f in ~/.rvm/scripts/rvm ~/perl5/perlbrew/etc/bashrc; do
[ -f "$f" ] && source $f
View
1 digrc
@@ -0,0 +1 @@
++nocomments
View
12 install.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+self=$(basename "$0")
+git ls-files | grep -v "$self" | while read f
+do
+ dest="$HOME/.$f"
+ if [ ! -f "$dest" ] || ! diff "$f" "$dest" > /dev/null
+ then
+ echo -e "Copying \0033[1m$f\0033[0m to \0033[1m$dest\0033[0m"
+ cp "$f" "$dest" || break
+ fi
+done
View
31 irbrc
@@ -1,20 +1,39 @@
require "irb/completion"
+require "irb/ext/save-history"
+require "pp"
require "rubygems"
-
-#IRB.conf[:USE_READLINE] = true
-
+IRB.conf[:USE_READLINE] = true
IRB.conf[:SAVE_HISTORY] = 10_000
+IRB.conf[:AUTO_INDENT] = true
IRB.conf[:PROMPT][:CUSTOM] = {
- :PROMPT_I => "#{"j" if RUBY_PLATFORM=="java"}irb (#{RUBY_VERSION})> ",
+ :PROMPT_I => "#{"j" if RUBY_PLATFORM=="java"}irb [#{RUBY_VERSION}]$ ",
:PROMPT_C => "%i* ",
:PROMPT_N => "%i{ ",
:PROMPT_S => "%i%l ",
:RETURN => "=> %s\n"
}
-if defined? Rails
- IRB.conf[:PROMPT][:CUSTOM][:PROMPT_I] = "rails (#{Rails.version})> "
+custom = IRB.conf[:PROMPT][:CUSTOM]
+if defined?(Rails)
+ custom[:PROMPT_I] = "rails [#{Rails.version}]$ "
+elsif defined?(Padrino)
+ custom[:PROMPT_I] = "padrino [#{Padrino.version}]$ "
end
IRB.conf[:PROMPT_MODE] = :CUSTOM
+
+if defined?(ActiveRecord)
+ require "logger"
+ ActiveRecord::Base.logger = Logger.new(STDERR)
+
+ if File.exists?("NUL") # Too lazy now...
+ if defined?(ActiveSupport::LogSubscriber)
+ ActiveSupport::LogSubscriber.colorize_logging = false
+ else
+ ActiveRecord::Base.colorize_logging = false
+ end
+ end
+end
+
+def q!; quit; end
View
4 mongorc.js
@@ -0,0 +1,4 @@
+DBQuery.prototype._prettyShell = true;
+prompt = function() {
+ return db + ' > ';
+}
View
1 rdebugrc
@@ -0,0 +1 @@
+set autoeval on

0 comments on commit d763814

Please sign in to comment.
Something went wrong with that request. Please try again.