Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Autoclosing ruby blocks #280

Open
Flink opened this Issue · 8 comments

5 participants

@Flink

Hi!

I don’t know if this is really an issue, but still it is one for me. I’m currently using Janus and I’m thinking to switch to spf13.
When editing a ruby source file, I tried to create a new method. When hitting enter after def method_name I was expecting to have the block automatically completed (with end) as Janus does.
So far I only found documentation of vim-ruby saying that Shift+Enter should do the trick, but here it gives me an error (related to completion it seems).

Anyone knows how to enable this behavior?

@spf13
Owner
@Flink

Thank you! :)

@hsingh23

You are looking for Bundle 'tpope/vim-endwise'

Make your Ruby bundle look like this
" Ruby
if count(g:harsh_bundle_groups, 'ruby')
Bundle 'tpope/vim-rails'
Bundle 'gmarik/vundle'
Bundle 'tpope/vim-cucumber'
Bundle 'tpope/vim-endwise'
Bundle 'vim-ruby/vim-ruby'
let g:rubycomplete_buffer_loading = 1
"let g:rubycomplete_classes_in_global = 1
"let g:rubycomplete_rails = 1
endif

@chrisnicola

The OmniComplete settings creats some havoc with this. You end up inserting pubvisible()... after hitting enter unless you change the mapping for it. Which is fine but you do have to comment out this line in .vimrc to make this work:

"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"

@spf13
Owner
@chrisnicola

Yeah I'll put something together. Do you want to remove the mapping altogether (I'm not certain what it actually does since tab is what completes things for me, the mapping's behaviour is awkward). The alternative is I can add a variable for not mapping CR for OmniComplete that can be used instead.

@spf13
Owner
@chrisnicola chrisnicola referenced this issue from a commit in chrisnicola/spf13-vim
@chrisnicola chrisnicola Don't remap <CR> for omnicomplete it causes issues
fixes issue #280
412556c
@bronzehedwick

@Flink, have the fixes here resolved the issue? If so please close :)

@zhangyuheng zhangyuheng referenced this issue from a commit in zhangyuheng/vimrc
@chrisnicola chrisnicola Don't remap <CR> for omnicomplete it causes issues
fixes issue #280
8fd44d0
@dukex dukex referenced this issue from a commit in dukex/spf13-vim
@chrisnicola chrisnicola Don't remap <CR> for omnicomplete it causes issues
fixes issue #280
60b1b5a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.