Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3b8323
commit bc14e3f
Showing
5 changed files
with
165 additions
and
10 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
h1. My DotFiles | ||
|
||
This project holds all my custom binnary files and also non-default OSX like a2ensite, ssh-copy-id and etc. I also store all my configurations for my bash (including aliases, PS1, colors, etc), ssh and ruby rvm. | ||
|
||
h3. Usage | ||
|
||
My organization is a litle bit diferent because how I don't use the default .bashrc and .bashprofile you should require correct files. | ||
|
||
In .bashrc place this: | ||
<pre> | ||
. ~/bin/dotfiles/bashrc | ||
</pre> | ||
|
||
In .bashprofile | ||
<pre> | ||
if [ -f ~/.bashrc ]; | ||
then | ||
source ~/.bashrc | ||
fi | ||
</pre> |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
require "irb/completion" # activate default completion | ||
require 'irb/ext/save-history' # activate default history | ||
require "tempfile" # used for Vim integration | ||
require 'pp' | ||
|
||
# save history using built-in options | ||
IRB.conf[:SAVE_HISTORY] = 10000 | ||
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | ||
|
||
# auto-indent | ||
IRB.conf[:AUTO_INDENT]=true | ||
|
||
# try to load rubygems | ||
begin | ||
require "rubygems" | ||
rescue LoadError => e | ||
puts "Seems you don't have Rubygems installed: #{e}" | ||
end | ||
|
||
# let there be colors | ||
# just use Wirble for colors, since some enviroments dont have | ||
# rubygems and wirble installed | ||
begin | ||
require "wirble" | ||
Wirble.init(:skip_prompt=>true,:skip_history=>true) | ||
Wirble.colorize | ||
rescue LoadError => e | ||
end | ||
|
||
# enabling Hirb | ||
begin | ||
require 'hirb' | ||
Hirb.enable | ||
rescue LoadError => e | ||
end | ||
|
||
# configure vim | ||
@irb_temp_code = nil | ||
|
||
def vim(file=nil) | ||
file = file || @irb_temp_code || Tempfile.new("irb_tempfile").path+".rb" | ||
system("vim #{file}") | ||
if(File.exists?(file) && File.size(file)>0) | ||
Object.class_eval(File.read(file)) | ||
@irb_temp_code = file | ||
else | ||
"No file loaded." | ||
end | ||
rescue => e | ||
puts "Error on vim: #{e}" | ||
end | ||
|
||
class Object | ||
# get all the methods for an object that aren't basic methods from Object | ||
def my_methods | ||
(methods - Object.instance_methods).sort | ||
end | ||
end | ||
|
||
# from http://themomorohoax.com/2009/03/27/irb-tip-load-files-faster | ||
def ls | ||
%x{ls}.split("\n") | ||
end | ||
|
||
def cd(dir) | ||
Dir.chdir(dir) | ||
Dir.pwd | ||
end | ||
|
||
def pwd | ||
Dir.pwd | ||
end | ||
|
||
# also from http://themomorohoax.com/2009/03/27/irb-tip-load-files-faster | ||
def rl(file_name = nil) | ||
if file_name.nil? | ||
if !@recent.nil? | ||
rl(@recent) | ||
else | ||
puts "No recent file to reload" | ||
end | ||
else | ||
file_name += '.rb' unless file_name =~ /\.rb/ | ||
@recent = file_name | ||
load "#{file_name}" | ||
end | ||
end | ||
|
||
alias p pp | ||
alias quit exit |