Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoclosing ruby blocks #280

Open
Flink opened this issue Jan 28, 2013 · 8 comments
Open

Autoclosing ruby blocks #280

Flink opened this issue Jan 28, 2013 · 8 comments

Comments

@Flink
Copy link

Flink commented Jan 28, 2013

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
Copy link
Owner

spf13 commented Jan 29, 2013

I'll look into it.

Steve Francia
http://stevefrancia.com
http://spf13.com
http://twitter.com/spf13

On Mon, Jan 28, 2013 at 6:16 PM, Loïc Guitaut notifications@git.luolix.topwrote:

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?


Reply to this email directly or view it on GitHubhttps://github.com//issues/280.

@Flink
Copy link
Author

Flink commented Jan 29, 2013

Thank you! :)

@hsingh23
Copy link

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
Copy link
Contributor

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
Copy link
Owner

spf13 commented Jun 18, 2014

Does someone want to send me a PR for these changes?

Best,
Steve

-- 
Steve Francia
http://stevefrancia.com
http://spf13.com
http://twitter.com/spf13

From: Chris Nicola notifications@github.com
Reply: spf13/spf13-vim reply@reply.github.com
Date: June 17, 2014 at 6:31:29 PM
To: spf13/spf13-vim spf13-vim@noreply.github.com
Cc: Steve Francia steve.francia@gmail.com
Subject:  Re: [spf13-vim] Autoclosing ruby blocks (#280)

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 pumvisible() ? "" : ""


Reply to this email directly or view it on GitHub.

@chrisnicola
Copy link
Contributor

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
Copy link
Owner

spf13 commented Jun 18, 2014

Let's add a variable, but have the default set to false ( not include it ).

On Wednesday, June 18, 2014, Chris Nicola notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHub
#280 (comment).

Steve Francia
http://stevefrancia.com
http://spf13.com
http://twitter.com/spf13

@bronzehedwick
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants