Open MuschPusch opened 9 years ago
I don't know if the problem is related, but the same thing happens with YouCompleteMe. I have to double escape when the completion is showing in order to be able to leave insert mode. Removing the new plugin auto-pairs and switching again to vim-autoclose solved the problem if someone is in the same situation.
Removing auto-pairs didn't worked for me but i didn't switched to vim-autoclose
same error here, back to autoclose work well https://github.com/spf13/spf13-vim/issues/769
+1, this is very annoying :( Removing the line solved the issue for me. thanks
auto-pairs will also make go editing a real pain
return SomeStruct{|
}
if the cursor is |
and I type }
, the cursor will just go to the closing }
on the line bellow...
+1, this is really annoying
+1 Very annoying
+1 @MuschPusch 's fix (at least temporarily fixed it), but this is a very annoying usability problem
Any news on this?
I correct myself in the previous message, this @MuschPusch's fix is not working for me.
What happens is: When inserting, if Neocomplete hasn't been triggered (inserting at the end of any line, for example), esc key instantly quits exit mode, that works fine. However, when Neocomplete is triggered, and esc is pressed, there's a 1 second delay, then autocomplete closes, but instantly it goes back into insert mode and autocomplete opens again. The only way to avoid this is to press many times the esc key until neocomplete doesn't show up anymore, which is a really big problem for us programmers.
Well, this is weird... correcting myself, again. But this time I solved it, and I got my vim to run really well. What I did was implement @MuschPusch's fix, which does work for me, and also added this, which removed that 1 second lag I was experiencing:
set timeoutlen=10 ttimeoutlen=0
:+1:
Doesn't work for me :(
i just use this to select my choice
inoremap <cr> <esc>a
@rafadev does NERDCommenter still works for you? With set timeoutlen=10 ttimeoutlen=0
it doesn't here :(
hi @gravis i do not use any plugin but just add some func: here is my config for ( ,[ ,{ ,},],)
inoremap ( ()<Esc>i
inoremap [ []<Esc>i
inoremap { {}<Esc>i
autocmd Syntax java inoremap { {<CR>}<Esc>O
autocmd Syntax html,vim inoremap < <lt>><Esc>i| inoremap > <c-r>=ClosePair('>')<CR> |inoremap " "
inoremap ) <c-r>=ClosePair(')')<CR>
inoremap ] <c-r>=ClosePair(']')<CR>
inoremap } <c-r>=ClosePair('}')<CR>
autocmd Syntax java inoremap } <c-r>=CloseBracket()<CR>
inoremap " <c-r>=QuoteDelim('"')<CR>
inoremap ' <c-r>=QuoteDelim("'")<CR>
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\<Right>"
else
return a:char
endif
endf
function CloseBracket()
if match(getline(line('.') + 1), '\s*}') < 0
return "\<CR>}"
else
return "\<Esc>j0f}a"
endif
endf
function QuoteDelim(char)
let line = getline('.')
let col = col('.')
if line[col - 2] == "\\"
"Inserting a quoted quotation mark into the string
return a:char
elseif line[col - 1] == a:char
"Escaping out of the string
return "\<Right>"
else
"Starting a string
return a:char.a:char."\<Esc>i"
endif
endf
au filetype java inoremap <silent> <buffer> } <C-r>=JavaCloseBracket()<cr>
function JavaCloseBracket()
let line = getline('.')
let col = col('.')
if line[col - 2] == "\\"
"Inserting a quoted quotation mark into the string
return "}"
elseif line[col - 1] == "}"
"Escaping out of the string
return "\<Right>"
elseif match(getline(line('.') + 1), '\s*}') < 0
return "\<CR>}"
else
return "\<Esc>j0f}a"
endif
endf
@gravis Hey! Sorry for the delay... No, it doesn't work any more, I didn't notice cause I wasn't using it... I think my setting just kills the timeout after pressing leader... any clues?
nope, I'm stil fighting with this, it's very annoying. I ended up with hitting esc 3-4 times, but it's a waste of time.
hi @gravis what func do you want ,i think i can help you
I gave up spf13, moved to a simple installation with a few bundles, including YouCompleteMe, everything back to work now...
I think I'll do the same this week-end :(
9af9ba73cfca2d586ae6436208581379bffc22de seems to fix this!
See this thread in neocomplcache: https://github.com/Shougo/neocomplcache.vim/issues/350#issuecomment-12708564
Even though it's neocomplcache the issue is the same and removing this line would fix it:
https://github.com/spf13/spf13-vim/blob/aaefac8f98e0f4e247836c7f295d3deecd28f88b/.vimrc#L489