3

Every time i use snippets in vim while coding in Python i get a problem which i desire to get rid off. Here is the sequence of steps which leads to my problem:

  1. type fun and hit Tab to trigger snippets of a new function enter image description here enter image description here
  2. start typing to define its name. enter image description here

On the last step i get all the body of my new function folded and i even don't see my cursor at the place i am currently typing.

Info:

  • I am using python-mode plugin which defines foldingmethod here
  • I am also using ultisnips and vim-snippets.
  • Here is my vimrc, which contains nothing criminal as seems to me.

How could i fix such an issue?

xolodec
  • 823
  • 1
  • 8
  • 17
  • after renaming, have your pressed `Enter`? or some key before the function was folded? – Kent Apr 13 '15 at 09:25
  • No, I have not pressed `Enter`. Every single keystroke collapses the body of a function when changing its name. – xolodec Apr 13 '15 at 09:57
  • there must be some strange mappings triggered something like `zc`. test with some plugins disabled, and try to find the plugin caused problem. you can do a "binary search" – Kent Apr 13 '15 at 10:33
  • That is great suggestion! You are extremely right. I tried to do so and figured out that YouCompleteMe plugin is the cause of such an auto folding. However i dont know know how to fix this and what next step to take for debugging such an issue. YCM brakes it even with default settings . – xolodec Apr 13 '15 at 13:22

1 Answers1

2

I had a similar issue with PHP code completion. It would automatically fold anything above a return statement as I typed.

I likewise narrowed the issue to the YCM plugin; I disabled all other plugins and set YCM options to defaults.

The issue went away when I set foldmethod to manual in my vimrc:

set foldmethod=manual

sealeg
  • 21
  • 4