Permalink
Browse files

got prompt working finally

  • Loading branch information...
forest committed Jul 26, 2012
1 parent 03e20af commit 313c16af90a29b194d751ed4512f84003989c54e
View
106 irbrc
@@ -1,54 +1,54 @@
#!/usr/bin/ruby
require 'irb/completion'
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
%w[rubygems looksee/shortcuts wirble].each do |gem|
begin
require gem
rescue LoadError
end
end
class Object
# list methods which aren't in superclass
def local_methods(obj = self)
(obj.methods - obj.class.superclass.instance_methods).sort
end
# print documentation
#
# ri 'Array#pop'
# Array.ri
# Array.ri :pop
# arr.ri :pop
def ri(method = nil)
unless method && method =~ /^[A-Z]/ # if class isn't specified
klass = self.kind_of?(Class) ? name : self.class.name
method = [klass, method].compact.join('#')
end
system 'ri', method.to_s
end
end
def copy(str)
IO.popen('pbcopy', 'w') { |f| f << str.to_s }
end
def copy_history
history = Readline::HISTORY.entries
index = history.rindex("exit") || -1
content = history[(index+1)..-2].join("\n")
puts content
copy content
end
def paste
`pbpaste`
end
load File.dirname(__FILE__) + '/.railsrc' if ($0 == 'irb' && ENV['RAILS_ENV']) || ($0 == 'script/rails' && Rails.env)
# require 'irb/completion'
# require 'irb/ext/save-history'
# IRB.conf[:SAVE_HISTORY] = 1000
# IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
# IRB.conf[:PROMPT_MODE] = :SIMPLE
# %w[rubygems looksee/shortcuts wirble].each do |gem|
# begin
# require gem
# rescue LoadError
# end
# end
# class Object
# # list methods which aren't in superclass
# def local_methods(obj = self)
# (obj.methods - obj.class.superclass.instance_methods).sort
# end
# # print documentation
# #
# # ri 'Array#pop'
# # Array.ri
# # Array.ri :pop
# # arr.ri :pop
# def ri(method = nil)
# unless method && method =~ /^[A-Z]/ # if class isn't specified
# klass = self.kind_of?(Class) ? name : self.class.name
# method = [klass, method].compact.join('#')
# end
# system 'ri', method.to_s
# end
# end
# def copy(str)
# IO.popen('pbcopy', 'w') { |f| f << str.to_s }
# end
# def copy_history
# history = Readline::HISTORY.entries
# index = history.rindex("exit") || -1
# content = history[(index+1)..-2].join("\n")
# puts content
# copy content
# end
# def paste
# `pbpaste`
# end
# load File.dirname(__FILE__) + '/.railsrc' if ($0 == 'irb' && ENV['RAILS_ENV']) || ($0 == 'script/rails' && Rails.env)
View
20 railsrc
@@ -6,15 +6,15 @@
#rescue LoadError
#end
def change_log(stream)
ActiveRecord::Base.logger = Logger.new(stream)
ActiveRecord::Base.clear_active_connections!
end
# def change_log(stream)
# ActiveRecord::Base.logger = Logger.new(stream)
# ActiveRecord::Base.clear_active_connections!
# end
def show_log
change_log(STDOUT)
end
# def show_log
# change_log(STDOUT)
# end
def hide_log
change_log(nil)
end
# def hide_log
# change_log(nil)
# end
@@ -4,7 +4,7 @@ alias ae='vi $yadr/custom/zsh/after/after.aliases.zsh' #alias edit
alias ar='source $yadr/custom/zsh/after/after.aliases.zsh' #alias reload
# ls
alias ls='ls -lAhFG'
# alias ls='ls -lAhFG'
# shell
alias reload='exec $SHELL'
@@ -15,6 +15,7 @@ alias hosts='sudo vim /private/etc/hosts'
# git (not in oh-my-zsh or yard)
alias g='git'
alias gs='git status -sb'
alias gcd='git checkout development'
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
alias gch='git cherry -v origin/master'
@@ -1,5 +1,11 @@
# set or override options. two of my favorite are below.
#
# set the prompt
autoload -Uz promptinit
promptinit
prompt steeef
# Automatically cd to frequently used directories http://robots.thoughtbot.com/post/10849086566/cding-to-frequently-used-directories-in-zsh
setopt auto_cd
cdpath=($HOME/code)
@@ -0,0 +1,10 @@
# ignore plugins defined by YADR and use your own list. Notice there is no
# $plugins at the end.
plugins=(vi-mode rvm ruby bundler git osx rails terminal completion history utility syntax-highlighting history-substring-search prompt)
# set your theme.
export ZSH_THEME="steeef"
zstyle ':omz:module:prompt' theme 'steeef'
# kennethreitz
# steeef

This file was deleted.

Oops, something went wrong.

0 comments on commit 313c16a

Please sign in to comment.