[PATCH] Suggestion for updated ftplugin/ruby.vim
dougkearns at gmail.com
Mon Aug 29 02:01:05 EDT 2005
On Sun, Aug 28, 2005 at 06:39:43PM +0200, Nikolai Weibull wrote:
> Doug Kearns wrote:
> > Because I'm lazy can you point me to Ned's script?
Sorry I didn't notice it was included in the header of our ftplugin -
see laziness above. ;-)
> 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
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.
Other than that, it looks good to me. Thanks.
> 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
> call append(line('.'), ind . 'end')
> 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?
> Totally off-topic:
> By the way, do you know why pasting text selected in conkeror is so
No, sorry. I haven't experienced any slowness. How are you selecting it?
More information about the vim-ruby-devel