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

Need to press ESCAPE twice #350

Closed
rkumar opened this issue Jan 10, 2013 · 24 comments
Closed

Need to press ESCAPE twice #350

rkumar opened this issue Jan 10, 2013 · 24 comments

Comments

@rkumar
Copy link

rkumar commented Jan 10, 2013

I recently installed spf13-vim which includes neocomplcache. I've noticed that when I am typing and a popup of completions comes up. Let;s say I ignore the completions popup and keep typing. Now I press ESCAPE once (which is how I've been working for over 20 years). However, now i see the status below saying "back to original" and then it again goes into "INSERT" mode.

This results in several keys or commands getting inserted into the text. Is there any way to avoid this? Or is there some new behavior to be learned. Surely everyone is not pressing ESCAPE two times to leave insert mode with this plugin.

I am trying to get used to the behavior of selection too. Very often if i type the full word and press escape, the word gets truncated to the point where the popup came up. Let's say i type "abc" and the popup comes. I then complete typing "def" and then press ESCAPE. I think in cases like this, it keeps reverting my text to "abc". So I need to press a SPACE and then delete the extra space. (Maybe this is true when i accept a completion from the popup.)

Are there settings to customize this, Or what is the usual correct keystrokes AFTER selecting a value, and also if you ignore the popup and keep typing.

@rkumar
Copy link
Author

rkumar commented Jan 11, 2013

I notice I also need to press ENTER twice. I am not clear on what customizations spf13 does to neocomplcache, just wondering if you all use this plugin in vanilla form, or with a lot of customizations ?

@Shougo
Copy link
Owner

Shougo commented Jan 12, 2013

You should use neocomplcache only and check if happend same problem(Possible less settings and non other plugins)
I don't like spf13-vim. Because it is too huge. I cannot support it.

In my case, neocomplcache works and I do not press ESCAPE twice.
I have not heared same behavior.

@rkumar
Copy link
Author

rkumar commented Jan 12, 2013

Thanks. I will remove the settings and try. I am closing this issue since it is not an issue with this plugin. Would appreciate if you could share your settings for neo from your .vimrc.

I don't like spf13 either, it somehow messed things ups, ... but my snippets have stopped working after I reverted to my old environment (pathogen based), so i came back to spf13 just for the snippets. Anyway, ...

@rkumar rkumar closed this as completed Jan 12, 2013
@Shougo
Copy link
Owner

Shougo commented Jan 12, 2013

I think you should install plugins manually. I recommend using neobundle(https://github.com/Shougo/neobundle.vim).

@rkumar
Copy link
Author

rkumar commented Jan 12, 2013

On Sat, Jan 12, 2013 at 11:59 AM, Shougo notifications@github.com wrote:

I think you should install plugins manually. I recommend using neobundle(
https://github.com/Shougo/neobundle.vim).


Reply to this email directly or view it on GitHubhttps://github.com//issues/350#issuecomment-12174451.

I have now installed neocomplcache outside of spf13 in my old vimrc and it
runs fine. I don't know what spf13 was doing with it.

Thanks.

btw, how is neobundle different from Vundle ?

@Shougo
Copy link
Owner

Shougo commented Jan 12, 2013

btw, how is neobundle different from Vundle ?

neobundle has many features.
For example, dependencies, other VCS support, unite.vim interface, asynchronous update, ...

@mightyguava
Copy link

For future reference, I narrowed this down to the following line in the Omnicomplete plugin settings in spf13.

inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"

@Shougo
Copy link
Owner

Shougo commented Jan 26, 2013

Oh... I think it is spf13 keymappings problem.

@mightyguava
Copy link

Yeah, it's a spf13 keymapping, but it's a binding added specifically for use with Omnicomplete, active even when you don't use Omnicomplete...

@rkumar
Copy link
Author

rkumar commented Jan 26, 2013

The keymappings added by spf13 to this plugin were making it very painful to use. I don't know how other users are managing esp the problem where it goes back to INSERT mode after one escape. Maybe you can send a mail to the maintainer of spf13 to fix the mappings (since spf13 got a lot of attention on Hacker News and his mappings reflect badly on this plugin.)

@yyk
Copy link

yyk commented Jan 31, 2013

I'm having the same problem too. And I'm not using the spf13 nor the mapping. The behaviour is just the same as described by @rkumar . I think there may be some conflict with other scripts? As you may concern, I use these submodules https://github.com/yyk/vimsettings-2013/blob/master/.gitmodules
I'm trying to solve the problem too.

@rkumar
Copy link
Author

rkumar commented Jan 31, 2013

On Thu, Jan 31, 2013 at 12:58 PM, Yu Yuankai notifications@github.comwrote:

I'm have the same problem too. And I'm not using the spf13 nor the
mapping. The behaviour is just the same as described by @rkumarhttps://github.com/rkumar. I think there may be some conflict with other scripts? As you may
concern, I use these submodules
https://github.com/yyk/vimsettings-2013/blob/master/.gitmodules
I'm trying to solve the problem too.


Reply to this email directly or view it on GitHubhttps://github.com//issues/350#issuecomment-12930922.

I find I still have to press Enter two times at times. Let us say I am
typing "fi" to close a block in shell script. neo will pop up various
completions, but i ignore the completions. Now I should only press ENTER
once to go to next line, but since neo did show me some options, i need to
press ENTER 2 times, Or I press a SPACE and then backspace to clear the
space.

However, it is still much better than SPF13 which was behaving very badly
with it's settings.

@Shougo
Copy link
Owner

Shougo commented Jan 31, 2013

Now I should only press ENTER once to go to next line, but since neo did show me some options, i need to press ENTER 2 times, Or I press a SPACE and then backspace to clear the space.

You should map <CR>.

example:

  inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
  function! s:my_cr_function()
    return neocomplcache#smart_close_popup() . "\<CR>"
  endfunction

@yyk
Copy link

yyk commented Feb 1, 2013

I finally found my problem is caused by the autoclose script. After removing it, everything works well. Just FYI.
https://github.com/Townk/vim-autoclose

@rkumar
Copy link
Author

rkumar commented Feb 1, 2013

On Fri, Feb 1, 2013 at 10:42 PM, Yu Yuankai notifications@github.comwrote:

I finally found my problem is caused by the autoclose script. After
removing it, everything works well. Just FYI.
https://github.com/Townk/vim-autoclose


Reply to this email directly or view it on GitHubhttps://github.com//issues/350#issuecomment-13003598.

Strange, I am not using vim-autoclose. In fact, when I tried spf13,
autoclose was the first thing i had to deactivate since it tried to close
strings (and brackets) when i tried to enclose an existing string.

@Shougo
Copy link
Owner

Shougo commented Feb 2, 2013

I think it is from below mappings in autoclose.vim

    if len(b:AutoCloseExpandEnterOn) > 0
        inoremap <buffer> <silent> <CR> <C-R>=<SID>Enter()<CR>
    endif

@waiting-for-dev
Copy link

Anyone has a workaround?

@dusans
Copy link

dusans commented Oct 14, 2013

Good to know. I always thought that is how neocomplete was suppose to work.
After deleting autoclose i only have to press Esc once.

Hope this get resolved.

For now i switched to: https://github.com/jiangmiao/auto-pairs

@waiting-for-dev
Copy link

Great! auto-pairs looks very well and I won't have this issue :) thank you!

@Shougo
Copy link
Owner

Shougo commented Oct 15, 2013

I added the problem in FAQ.

@cseelus
Copy link

cseelus commented Jan 25, 2014

Thanks @dusans for this hint. For me the problem was 'vim-autoclose' too.
And thanks of course to @Shougo for this great plugin.

@diraol
Copy link

diraol commented May 10, 2015

Friends, removing "vim-autoclose" has caused the problem, on spf13, related on spf13/spf13-vim#567 .
Does anyone knows how to fix it without the need to "re-enable" autoclose.

@cttttt
Copy link

cttttt commented May 27, 2015

@diraol what worked for me is to add:

iunmap <Esc>

...to my ~/.vimrc.local. AutoClose no longer required.

@dragongeek
Copy link

I know this thread is old, but I'm having this problem with plain vanilla 'vi' editor on Solaris, and I'm assuming it has to do with using the UTF-8 Locale. I thought I'd drop that in here and see if it rings any bells, and if someone has yet found a fix or workaround, beside hitting all the time?
Thanks,

belminf added a commit to belminf/dotvim that referenced this issue Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants