2

I know that there can be a delay when inserting a new line with O after pressing Esc. However, I am experiencing that delay with o and i<CR> as well. This should not be related to vim 'waiting' as in the O case.

This occurs when inserting new lines towards the end of a 90-line Python file; it does not occur when editing other Python files.

I've isolated the problem to this line:

filetype indent on
SabreWolfy
  • 821
  • 1
  • 8
  • 14
  • 3
    Does this occurs when you start vim with vim -Nu NONE ? – nobe4 Jun 09 '16 at 12:11
  • No, then it is fine. However, with the problem presents, it only presents in that Python file. – SabreWolfy Jun 09 '16 at 12:14
  • 4
    then have a look at http://vi.stackexchange.com/a/2004/1821 and if you find the line that cause the problem you can update your question. – nobe4 Jun 09 '16 at 12:16
  • 2
    Nobe4's link is indeed a very good one, also check for lines involving ttimeout and ttimeoutlen they could be the culprits. – statox Jun 09 '16 at 12:19
  • I've updated my question. – SabreWolfy Jun 09 '16 at 12:24
  • 2
    See the doc: :h :filetype-indent-on. The line you're referring to makes Vim detect the filetype automatically and load the indent options for each filetype. Maybe an autocommand creates the problem on python buffers and is not loaded when you remove the filetype detection. – statox Jun 09 '16 at 12:39
  • 1
    Why would this problem only present on that Python file and not others? – SabreWolfy Jun 09 '16 at 12:40
  • 1
    You're saying that you've narrowed it down to filetype indent on. What's the output is when you run this: :verbose set indentexpr? Try :set noautoindent and see if the problem goes away. You might be using a slow indentexpr. – Tommy A Jun 09 '16 at 12:45
  • I don't know, I think that filetype indent on is not the actual cause of the problem and you only isolated a side effect. But I can be wrong... – statox Jun 09 '16 at 12:46
  • @TommyA: indentexpr=GetPythonIndent(v:lnum) and Last set from /usr/share/vim/vim74/indent/python.vim. noautoindent had no effect. – SabreWolfy Jun 09 '16 at 12:47
  • @statox: Quite possibly. – SabreWolfy Jun 09 '16 at 12:47
  • 2
    @SabreWolfy strange. You've tried :verbose nmap O to see if there aren't any maps prefixed with O? Since you're saying this conditionally happens, there shouldn't be any, but it wouldn't hurt to check. At this point, I'd start disabling plugins to see which one is causing it, if any. – Tommy A Jun 09 '16 at 13:48

0 Answers0