[PATCH] Suggestion for updated ftplugin/ruby.vim
Nikolai Weibull
mailing-lists.vim-ruby-development at rawuncut.elitemail.org
Mon Aug 29 05:20:25 EDT 2005
Doug Kearns wrote:
> > http://bike-nomad.com/vim/ruby.vim
>
> Sorry I didn't notice it was included in the header of our ftplugin -
> see laziness above. ;-)
No problem :-).
> > I am, however, doubtful about setting iskeyword to include ':'. The
> > reason for doing so is that we have stuff like ConstantA::ConstantB
> > kind of stuff and that we want to be able to treat that as one thing
> > on occasion. I think, however, that this causes too many issues
> > with other stuff to be reasonable.
> I agree. I don't actually think I'd want to match that rather than the
> individual constant names very often. Then you need to ask whether
> '@', and '$' etc should be included as well? I'm happy with the
> default for now.
Mm.
> We should probably include the browsefilter setting and I'm not sure
> that your redefinition of 'define' to search for method definitions
> makes sense... That seems like a job for ctags.
Yeah, browsefilter would be nice I suppose. 'define' may not so much.
> > Here's another thing I've been playing with, but I have the feeling
> > that electricity isn't something that most Vim-users
> > appreciate...What do you think? (Btw, that regex isn't quite
> > right...I'll have to fix that.)
> > inoremap <buffer> <CR> <C-O>:call <SID>CompleteStatement()<CR><CR>
> >
> > function! s:CompleteStatement()
> > " TODO: we can check contents of ". register to make sure that they were
> > " inserted while typing here...
> > if getline('.') =~ '^\s*\%(begin\|case\|class\|def\|for\|if\|module\|unless\|until\|while\)\>\|do\%(\s*|[^|]*|\s*\)\=$'
> > let n = indent('.')
> > let ind = ''
> > let i = 0
> > while i < n
> > let ind .= ' '
> > let i += 1
> > endwhile
> > call append(line('.'), ind . 'end')
> > endif
> > endfunction
> > It automatically inserts a matching 'end' when necessary.
> I like it. Pit Capitain has submitted a similar patch to the tracker and
> I've been thinking about a good way to include some of these 'extras'.
> Do you have any more?
No, that's about it. His version is in a sense better, as it works fine
while pasting code. Mine will add extra ends when pasting. I guess one
could hide it behind some variable, like b:ruby_electric_enter or
something similar.
> > By the way, do you know why pasting text selected in conkeror is so
> > slow?,
> No, sorry. I haven't experienced any slowness. How are you selecting it?
Well, either with the mouse (yuck), or manually with keys (which is
rather difficult). Then, when I try to paste in Vim, it takes like 3
seconds for Vim to grab the selection and actually insert it. Very
weird. No such problem with plain Firefox,
nikolai
--
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
More information about the vim-ruby-devel
mailing list