vim ctags goto definition and omni-complete August 16th, 2008


When you're reviewing or writing lots of code, it helps to have a sharp tool. I prefer to write ruby and just about everything else in vim since it's available on all platforms and I'm constantly switching from platform to platform (mostly Linux and OSX these days though).
Vim is a great, lightweight, powerful editor with all the features that any other editor can provide (yeah, even the famed textmate has nothing vim doesn't have). The steps below can get you going at a birds eye view.

1) compile vim with ruby support (if you don't already have it). To see if ruby support is enabled type 'vim --version' and look for "+ruby". If you see "-ruby" then ruby support is not enabled.

2) install ctags (via apt-get or ports). You can run it in your project's directory and jump-to-definition will start working:

ctags -R --exclude=*.js
3) install the rails-vim plugin into ~/.vim

4) cook up a great .vimrc
set smartindent
let g:rails_menu=2
set viminfo^=!
colorscheme desert
syntax on
set path=~/myproject/trunk/**
set tabstop=2
set expandtab
set shiftwidth=2
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
VIM commands
Jump to tag (ie: go to definition of the method under your cursor)
Control + ]

Bring up the OMNI complete window in insert mode
Control+X Control+O

DV video capture and edit in Ubuntu linux August 12th, 2008


Video editing capability is a necessity these days, when I finally found a good combination of software to use I was very happy. After-all, all you students and poor people out there, it's not like you want to have to go pirate Final Cut Pro or anything like that just to practice some skillz as an amateur film producer .. Video editing should be free! Content is King!!

Use DVgrab directly (no need for fancy UI here)

sudo apt-get install dvgrab
To capture (plug in your firewire DV cam or whatever):
sudo dvgrab -a outfile-
Then use Cinelerra to edit the raw DV output files.
When you are done editing, save back into format RAW dv

From there use a program such as DeVeDe ...
sudo apt-get install devede
devede


These are the basics that will get you going in a professional way! I am very happy to see that Cinelerra has matured so much and the Ubuntu packages are working flawlessly on my main workbeast that currently runs Ubuntu Gusty. Thanks a bunch!

Textmate style rails plugins for VIM. October 11th, 2007

"Textmate is cool, but VI is forever"
Here's how to get some textmate like potential out of VIM using plugins. I have the following plugins installed: project.vim, genutils.vim, rails.vim, multvals.vim, rubycomplete.vim and surround.vim.
non-insert mode

what to typewhat it does
:help surroundshows help for the surround plugin
yss=surrounds the current line with <%= %>
yss CTRL-Eturns the current line into a block <% -%>newline char<% end -%>
yss-surrounds the current line with <% -%>
CTRL-X CTRL-Obrings up the OMNI complete window for the current object/method
yssecreates an ending for the current block. ie: an 'end' or closing brace
CTRL-G ecreates an ending for the current block. use in insert mode
insert mode
what to typewhat it does
:help surroundshows help for the surround plugin
CTRL-G =surrounds the current line with <%= %>
CTRL-G CTRL-Eturns the current line into a block <% -%>newline char<% end -%>
CTRL-G -surrounds the current line with <% -%>
CTRL-X CTRL-Obrings up the OMNI complete window for the current object/method
CTRL-G eputs an 'end' on the next line