Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, September 27, 2010

Ruby IRB Auto Completion and Highlight - Linux

Install wirble

laptop:~$ sudo gem install wirble
Successfully installed wirble-0.1.3
1 gem installed
Installing ri documentation for wirble-0.1.3...
Installing RDoc documentation for wirble-0.1.3...

vim ~/.irbrc
Put the following in this file:

require "rubygems"
require "wirble"
Wirble.init
Wirble.colorize

IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:LOAD_MODULES] = [] unless IRB.conf.key?(:LOAD_MODULES)
unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
IRB.conf[:LOAD_MODULES] << 'irb/completion'
end


type
:wq

Thats it on irb prompt use tab for auto completion

Example:

Install random_data

laptop:~$ sudo gem install random_data
Successfully installed random_data-1.5.1
1 gem installed
Installing ri documentation for random_data-1.5.1...
Installing RDoc documentation for random_data-1.5.1...

-laptop:~$ irb
>> require 'rubygems'
=> false
>> require 'random_data'
=> true
>> Random.al
Random.allocate Random.alphanumeric
>> Random.alphanumeric 11
=> "w1KbPVLzE2l"

Saturday, May 3, 2008

GotConnected Compiz fusion no my 6720s

I have just got a 512 kbs DSL connection thanks to my elder brother Muddassir, I was anxiously waiting for this and Ubuntu 8.04 LTS HardyHeron.
I have just isntalled it on my HP 6720s notebook with compiz-fusion and AWN. Its SWeeeet, I am so very happy with all of this.
Have a look.

Thursday, January 10, 2008

Changing the Default editor for your terminal

You can change the default editor by setting the EDITOR environment variable. In BASH. This default editor is most of the time invoked by -e switch.
To see what is the current EDITOR.
# set | grep EDITOR EDITOR=/bin/nano # which vi (shows the full path of (shell) command vi ) /usr/bin/vi # export EDITOR=/usr/bin/vi verify the current EDITOR # set | grep EDITOR EDITOR=/usr/bin/vi  
--  Regards,  Mubbashir