Vim syntax based folding with php -


I downloaded the php.vim file, which contains PHP-based syntax information. It should be able to provide syntax-based folds, but I can not work it for some reason

I have set up: j: php_folding 2 and : set foldmethod = syntax but for no benefit, I'm pretty sure that the file is the right place And it is read by VIM because I can do : g: php_sql_query = 1 which works.

php .vim file ~ / .vim / syntax / php.vim

: Syntax enabled (or: syntax on) because both of these options also start file type detection. The file type must be known before folding or highlighting before working.

If you are developing in PHP then you might want to add these three rows to your .vimrc

  set faculty "because the file type address is well in the corresponding mode File type does not work On gine indent "Finding file type, starting file type plugins, and filetype is pointing at all, which adds good additional features for the syntax that you are using" is not already active, And then applies to file type-specific highlighting.  

Then you can enter your ~ / .vim in your : php_folding = 2 and Set foldmethod = syntax can be /after/ftplugin/php.vim fi .

This will keep your .vimrc file clean, will help you organize all your settings, and foldmethod = syntax will only affect php files (if you want all the filestypes to be your default multiplication method To set syntax, leave that line in that .vimrc file)

Read these help files for more detailed information:

: Help Filetype
: Help usr_05.txt:: help usr_43.txt


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -