Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent vim from autofolding when typing

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?

like image 371
xolodec Avatar asked Mar 20 '26 09:03

xolodec


1 Answers

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

like image 67
sealeg Avatar answered Mar 22 '26 05:03

sealeg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!