Rubuntu LiveCD I need vim/emacs configs!

Friends-

I am working on a linux distro liveCD called Rubuntu. Which is, you

guessed it, a ruby/raisl centric ubuntu livecd that has the option to
install to your HD if your so inclined. I hope to have my build
system for this set up this weekend so i can start pumping out a few
betas while I tweak it to perfection.

I need some help from the community.

What I really need some help with is killer ruby configs for vim,

emacs and jedit. And anything else you would like to see included,
please drop me a note and any pointers you have for configuration
that would be best suited for this.

I already have all the basics included as far as ruby/gems and a

bunch of database bindings and ruby configured mongrel, apache and
lighty. And I already have plenty of usefull ruby libs installed.
What I really need is the icing on the cake. I want thsi to come
setup with all the trimmings. So all you folks with killer vimrc’s
and emacs ruby configs please contact me.

Any little creature comforts you like or nice customization you rely

on to get through you ruby work on linux would be much appreciated.

Other thoughts or suggestions? I’m all ears at this point

Thanks-
-Ezra

On 2/16/06, Ezra Z. [email protected] wrote:

    What I really need some help with is killer ruby configs for vim,

Awesome!
I just use standard ruby-mode.el for emacs.

But I would like to suggest (if you dont alread have them)
irbsh
ruby-game
gdb

Ezra Z. wrote:

Friends-

I am working on a linux distro liveCD called Rubuntu. Which is, you
guessed it, a ruby/raisl centric ubuntu livecd that has the option to
install to your HD if your so inclined. I hope to have my build
system for this set up this weekend so i can start pumping out a few
betas while I tweak it to perfection.

I need some help from the community.

What I really need some help with is killer ruby configs for vim,
emacs and jedit. And anything else you would like to see included,
please drop me a note and any pointers you have for configuration
that would be best suited for this.

I already have all the basics included as far as ruby/gems and a
bunch of database bindings and ruby configured mongrel, apache and
lighty. And I already have plenty of usefull ruby libs installed.
What I really need is the icing on the cake. I want thsi to come
setup with all the trimmings. So all you folks with killer vimrc’s
and emacs ruby configs please contact me.

Any little creature comforts you like or nice customization you rely
on to get through you ruby work on linux would be much appreciated.

I run a really minimal config for vim. I really need a sensible
colour scheme, though, for my eyes. As a plus, it has mappings
for dvorak users. Here are my settings:

http://www.magical-cat.org/personal/settings/.vimrc
http://www.magical-cat.org/personal/settings/.gvimrc
http://www.magical-cat.org/personal/settings/.vim

The colours look like this:

http://www.magical-cat.org/personal/images/vim_zenbrue_colours.png

Other thoughts or suggestions? I’m all ears at this point

Thanks-
-Ezra

E

On 2/16/06, Ezra Z. [email protected] wrote:

    What I really need some help with is killer ruby configs for vim,

    Any little creature comforts you like or nice customization you rely

on to get through you ruby work on linux would be much appreciated.

Other thoughts or suggestions? I’m all ears at this point

I’m mostly a vim noob, so I’m looking forward to hearing other
suggestions from long-time users.
However, I’ve found these three mappings to be handy.

:imap %= %>
:imap % -%>
:imap odef end#A

Ctrl-e and Ctrl-x spit out <%= %> and <% -%> respectively, and
position the cursor in the appropriate spot.

Ctrl-d inserts:

def
end
…and then repositions the cursor after the ‘def’ in insert mode.

Friends-

Other thoughts or suggestions? I’m all ears at this point

I’m sorry I can’t offer my ruby vimrc file. I lost it some time ago and
instead of rewritting it I switched to scite. :frowning:

Although you’ve mostly likely considered it already a nice suite of ruby
aware
editors besides emacs, vim, and jedit would be nice. I am suggesting
including
gedit, scite, freeride, and kate (if you are going to include some kde
libraries). I would also recommend some pure ruby editors such as
diakonos.

One other must in my eyes would be to include every ruby app and game
that you
can find that is runnable. Also of interest would be to include the
ruSH (a
ruby shell) and possibly some ruby extensions to the shell.

You’ve most likely been here already, but in case you haven’t I
recommend
looking at: http://rubyforge.org/projects/vim-ruby/

Kind Regards,

On Fri, 2006-02-17 at 06:12 +0900, Ezra Z. wrote:

Other thoughts or suggestions? I’m all ears at this point

Awesome idea.

Make sure it has an .irbrc with require ‘irb/completion’ in it. Make
sure it includes Ruby-GNOME2. Ruby-Gecko[1] as the default browser would
be a nice touch, if not the most effective choice. =D

Also, ruby-electric[2] is a nice emacs mode. chris2 has some nifty ruby
stuff[3] that requires emacs22 if you are thinking of going that route.

I would advise against using MMM-mode for ERB by default since it seems
to usually be more trouble than it’s worth. CSS-mode is worth including.

You can see my .emacs[4], but it’s nothing special.

-Phil H.

1 - http://ruby-gnome2.sourceforge.jp/hiki.cgi?RubyGecko
2 - http://shylock.uw.hu/Emacs/ruby-electric.el
3 -
leah blogs: ETE - Errors To Emacs
4 - http://dev.technomancy.us/phil/browser/dotfiles

Cool, I have a killer .irbrc already with some really nice stuff in
it. I have made an entry on my blog and I would like to collect the
information from everyone there in the comments if possible please:

Ruby on Rails Blog / What is Ruby on Rails for?

There’s even a cool new logo for it there :wink:

Cheers-
-Ezra

Phil H. [email protected] writes:

stuff[3] that requires emacs22 if you are thinking of going that route.
Wow, I completely forgot I wrote that. :stuck_out_tongue:

I would advise against using MMM-mode for ERB by default since it seems
to usually be more trouble than it’s worth. CSS-mode is worth including.

I have no trouble with MMM-mode here, this is the relevant part of my
.emacs (stolen together from the web):

;; for Rails
;; 17jan2006 +chris+
(require 'mmm-mode)
(require 'mmm-auto)
(setq mmm-global-mode 'maybe)
(setq mmm-submode-decoration-level 2)
(set-face-background 'mmm-output-submode-face “Grey30”)
(set-face-background 'mmm-code-submode-face “Grey40”)
(set-face-background 'mmm-comment-submode-face “Grey50”)
(mmm-add-classes
'((erb-code
:submode ruby-mode
:match-face ((“<%#” . mmm-comment-submode-face)
(“<%=” . mmm-output-submode-face)
(“<%” . mmm-code-submode-face))
:front “<%[#=]?”
:back “%>”
:insert ((?% erb-code nil @ “<%” @ " " _ " " @ “%>” @)
(?# erb-comment nil @ “<%#” @ " " _ " " @ “%>” @)
(?= erb-expression nil @ “<%=” @ " " _ " " @ “%>” @))
)))
(add-hook 'html-mode-hook
(lambda ()
(setq mmm-classes '(erb-code))
(mmm-mode-on)))
(add-to-list 'auto-mode-alist '(“\.rhtml$” . html-mode))
(define-key mmm-mode-map (kbd “C-c C-c”) 'mmm-parse-buffer)

One thing possibly interesting is this:

;; for test/unit
;; 12nov2004 +chris+
(add-to-list 'compilation-error-regexp-alist
'(“test[a-zA-Z0-9_]([A-Z][a-zA-Z0-9_])
\[\(.*\):\([0-9]+\)\]:”
1 2))

But I’m not sure that regexp still works…

Phil H. wrote:

On Fri, 2006-02-17 at 06:12 +0900, Ezra Z. wrote:

Other thoughts or suggestions? I’m all ears at this point

Awesome idea.

Make sure it has an .irbrc with require ‘irb/completion’ in it.

Also, sticking this in ~/.irbrc helps:

Works both with constants and strings (ri Hash vs ri ‘Hash’)

def ri(obj)
puts ri #{obj}
end

                                                             Make

sure it includes Ruby-GNOME2. Ruby-Gecko[1] as the default browser would
be a nice touch, if not the most effective choice. =D

Also, ruby-electric[2] is a nice emacs mode. chris2 has some nifty ruby
stuff[3] that requires emacs22 if you are thinking of going that route.

I would advise against using MMM-mode for ERB by default since it seems
to usually be more trouble than it’s worth. CSS-mode is worth including.

You can see my .emacs[4], but it’s nothing special.

-Phil H.

1 - http://ruby-gnome2.sourceforge.jp/hiki.cgi?RubyGecko
2 - http://shylock.uw.hu/Emacs/ruby-electric.el
3 -
leah blogs: ETE - Errors To Emacs
4 - http://dev.technomancy.us/phil/browser/dotfiles

E

On 2/16/06, Ezra Z. [email protected] wrote:

    What I really need some help with is killer ruby configs for vim,

emacs and jedit. And anything else you would like to see included,
please drop me a note and any pointers you have for configuration
that would be best suited for this.

I am happy with my config:

set nobackup
set nocompatible
set backspace=indent,eol,start

set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching

map Q gq

set autoindent " always set autoindenting on
set shiftwidth=2
set tabstop=2
set expandtab
set tw=80
set nohlsearch
map :se invhlsearch

filetype on
filetype indent on
filetype plugin on
syntax on
if !exists( "EndToken" )
function EndToken()
let current_line = getline( ‘.’ )
let braces_at_end = '{\s
(|(,|\s|\w)|\s)?$’
if match( current_line, braces_at_end ) >= 0
return ‘}’
else
return ‘end’
endif
endfunction
endif

noremap :set invpaste paste?
imap
set pastetoggle=

map :!ruby %
map :!rake
map :!ri

imap :execute ‘normal o’ . EndToken()O
imap def test_
“{{{ Ruby block delimiter conversion: do end <=> { }
“Copyright (c) 2005 Mauricio F.
“Subject to same licensing terms as Ruby.
" requires matchit and friends
" since it uses the % and = bindings
function! s:String_Strip(str)
let s = substitute(a:str, ‘\v^\s*’, ‘’, ‘’)
return substitute(s, ‘\v\s*$’, ‘’, ‘’)
endfunction
function! s:RubyBlockBraceToDoEnd(lineno)
" { } => do end
let oldz = getreg(“z”)
call setreg(“z”, “”)
execute ‘normal ^f{%l"zd$’
let suffix = s:String_Strip(getreg(“z”))
call setreg(“z”, oldz)
let orig = getline(”.”)
let repl = substitute(orig, ‘\v\s*{\s*(|[^|]|)?.’, ’ do \1’, ‘’)
call setline(”.", repl)
let nextline = substitute(orig, ‘\v[^{]\v\s{\s*(|[^|]|)?', ‘’,
‘’)
let nextline = substitute(nextline, '}[^}]
$’, ‘’, ‘’)
let numlines = 0

" uncomment one of the following:

" (1) just insert the body without splitting the lines on ;
"call append(a:lineno, nextline)
"call append(a:lineno+1, ‘end’ . suffix)
"

" (2) try to split on ; …
call append(a:lineno, ‘end’ . suffix)
" this is what we would want to do:
"let nextline = substitute(nextline, ‘;’, “\n”, ‘g’)

while stridx(nextline, “;”) != -1
let eom = stridx(nextline, “;”)
let line = s:String_Strip(strpart(nextline, 0, eom))
call append(a:lineno + numlines, line)
let numlines = numlines + 1
let nextline = strpart(nextline, eom+1, strlen(nextline) - eom -
1)
endwhile
let nextline = s:String_Strip(nextline)
if strlen(nextline) > 0
call append(a:lineno + numlines, nextline)
let numlines = numlines + 1
endif

" this is what it all began with…
"execute 'normal :s/\v\s*{\s*(|.*|)?/ do \1\r/

"execute ‘normal g_cw
en
rmal V’ . (1 + numlines) . ‘j=’
"echo “{ } => do end”
endfunction

function! s:RubyBlockDoEndToBrace(_firstline, _lastline)
" do end => { }
let linenum = a:_firstline + 1
let orig = getline(“.”)
while linenum < a:_lastline - 1
let addline = getline(linenum)
if ‘\v^\s*$’ !~ addline
let addline = substitute(addline, ‘\v^\s*’, ‘’, ‘’)
let addline = substitute(addline, ‘\s*$’, '; ', ‘’)
let orig = orig . addline
endif
let linenum = linenum + 1
endwhile
let l = substitute(getline(a:_lastline-1), ‘\v^\s*’, ‘’, ‘’)
let l = substitute(l, ‘\s*$’, ‘’, ‘’)
let orig = orig . l
let l = substitute(getline(a:_lastline), ‘\v^\send(.|\s|$)@=‘, ’
}’, ‘’)
let l = substitute(l, '\s
$’, ‘’, ‘’)
let orig = orig . l

"echo orig
"input(orig)
let repl = substitute(orig, ‘\v\sdo\s(|[^|]*|)?’, '{\1 ', ‘’)
"execute ‘normal d’ . (a:_lastline - a:_firstline) . ‘j’
execute ‘:’ . a:_firstline . ‘,’ . a:_lastline . ‘d’
call append(a:_firstline - 1, repl)
execute ‘:’ . a:_firstline
"echo “do end => { }”
endfunction

map xx xx
let s:sid = maparg(“xx”)
unmap xx
let s:sid = substitute(s:sid, ‘xx’, ‘’, ‘’)

function! RubyBlockSwitchDelimiters() range
set nofoldenable
if a:firstline == a:lastline
let braceidx = match(getline(“.”), ‘{’)
let doidx = match(getline(“.”), ‘<do>’)
if braceidx != -1 && (doidx == -1 || braceidx < doidx)
call s:RubyBlockBraceToDoEnd(a:firstline)
elseif doidx != -1
execute ‘normal /<do>’ . “\n” . 'V%:call ’ .
\ s:sid . ‘RubyBlockSwitchDelimiters()’ . “\n”
else
echo “No block found”
end
else
call s:RubyBlockDoEndToBrace(a:firstline, a:lastline)
endif
"execute ‘normal V2k=’
"execute ‘normal v5j’
endfunction

command! -range B ,call RubyBlockSwitchDelimiters()
vmap B :call RubyBlockSwitchDelimiters()

On Feb 21, 2006, at 7:38 AM, Jon B. wrote:

Jon-

Yeah I have had multiple requests for RadRails so I will try to

include it as long as I am allowed to. And yes kirbybase/mysql/
postgresql will all be installed and configured. And I will make a
local repo of as many gems as space allows.

This project got a very large response with many requests. So it

will be a bit more work then I first thought. But I have a
preliminary build script done that buidl the livecd with ruby/rails
and the databases and a few gems. I will be adding packages and
requests to it. My plan is to get it through a few beta releases and
then have the real 1.0 release of it sometime in the next month or two.

Cheers-

-Ezra

PS. Here is a little wiki I set up for people to log there software
requests on. Please do add things you wold like to see included.

http://brainspl.at:8000/RubuntuRequestsList

Ive switched from emacs to the new RadRails IDE as it is pretty slick
although Im not sure if included a Java JVM will bloat your distro any
or if you are even allowed to include a VM (I think you are) …

http://www.radrails.org

Will the distro have mysql/postgres/kirbybase installed?

  • Jon

<posted & mailed>

Ezra Z. wrote:

Other thoughts or suggestions? I’m all ears at this point

Well, if we’re brainstorming…

The KDevelop packages come with modes and templates and example apps
for developing (KDE, or other) apps in Ruby, presumably largely
courtesy of Richard Dale.

KOffice 1.5 will also include some (rather experimental) support for
scripting Krita (images) and Kexi (databases) in Ruby. Only the beta
is out so far, but you can get the Debian and Kubuntu packages.

Martin

DÅ?a Utorok 21 Február 2006 16:38 Jon B. napísal:

Ive switched from emacs to the new RadRails IDE as it is pretty slick
although Im not sure if included a Java JVM will bloat your distro any
or if you are even allowed to include a VM (I think you are) …

sun-j2re from an unofficial Debian repository, 30 MB compressed, 90 MB
uncompressed. It doth hurt a bit, but I’d put it in for the heck of it
if
possible. I think Eclipse itself amounts to more, and even Postgres eats
20
megs in full.

The problem is, the Sun Java is classified as non-free, so I don’t think
you
can bundle that in an “official” Debian-based distribution - don’t know
if
Ubuntu loosened their licencing restrictions on the issue.

You might want to try the GCJ compiled Eclipse, but that one’s huge too.

David V.

Ezra Z. wrote:

Any little creature comforts you like or nice customization you rely
on to get through you ruby work on linux would be much appreciated.

Other thoughts or suggestions? I’m all ears at this point

Well, I was about to toot my own horn, but it looks as though someone
already mentioned it: I would be quite appreciative if you included
Diakonos. :slight_smile:

Pistos

Pistos wrote:

Ezra Z. wrote:

Any little creature comforts you like or nice customization you rely
on to get through you ruby work on linux would be much appreciated.

Other thoughts or suggestions? I’m all ears at this point

Well, I was about to toot my own horn, but it looks as though someone
already mentioned it: I would be quite appreciative if you included
Diakonos. :slight_smile:

Pistos

Sorry for the double post, but, for reference:
http://purepistos.net/diakonos .

On 2/21/06, David V. [email protected] wrote:

The problem is, the Sun Java is classified as non-free, so I don’t think you
can bundle that in an “official” Debian-based distribution - don’t know if
Ubuntu loosened their licencing restrictions on the issue.

why not just use ubuntu’s free-java-sdk which wraps around the GNU
tools and acts as a replacement for sun’s SDK.

it’s in universe on breezy

The only must have change I always make is to include some commands at
the bottom of the ruby.vim script in the indent directory that sets
tabstop softtabstop and shiftwidth to 2 and turns on expandtab. This is
nice because it only affects the .rb files, other files have the tab
settings set to 4 which is usually what I use for non ruby stuff. I’m
sortof surprised that these changes aren’t in that file by default.

Good luck on this project. It sounds very cool.
Gary

Just a thought - what about creating a VMware player appliance with all
the tools installed? I have an Ubuntu image with Rails/LightTPD/MySQL,
and it works really well for use as a pre-production/stage environment.
It acts like a separate physical machine, so you can even install SSH
server and try out Switchtower for deployment. Plus, you don’t have to
install all these services in your host OS, which can really slow it
down. Of course, this won’t work for Mac users. But who knows what
VMware will do.
Joe

This topic has been dead for a few days…how’s the project coming?