Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I enter the command :fold inside my python code in .py files, Vim inserts the /*{{{*/ and /*}}}*/ tags. They, of course, cannot be parsed by python interpreter.

When I'm in python I would like something like #{{{

Do you know how I could do that ? Of course, keeping the /*{{{*/ for my C/C++ files.

share|improve this question
2  
What is commentstring set to? For Python :set commentstring=#%s is reasonable, I guess. –  Marco Mar 27 '13 at 16:50
    
how do I reset it for python only ? –  Stephane Rolland Mar 27 '13 at 17:18
add comment

1 Answer

up vote 2 down vote accepted

The string used is determined by the variable commentstring. To set it to a different value you can use an autocommand:

augroup ft_python
  au!
  au FileType python setlocal commentstring=#%s
augroup END
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.