Possible Duplicate:
Autocomplete method structure in Vim
So I have smart autocomplete features on my vim, where it autocompletes ‘{‘ with ‘}’ on a new line and redirects control to next line just like eclipse. So typing ‘{‘ and pressing enter gives me
{
|
}
Where ‘|’ shows my cursor position. I want something eclipse style for ruby where as soon as write ‘def’ it should result in
def |
end
The problem is this should only take effect when ‘def’ is on the beginning of the line, and not otherwise.
there seems to be a plugin named endwise. I have never tried but it sound like what you need.