Sudar
Sudar

Reputation: 20000

Unneeded space in the Doxygen comments for PHP files in Vim

I am using DoxygenToolkit Vim Script (source code) to auto generate Doxygen comments. It is working properly in cpp/h files. But the problem happens in PHP files.

The comments block look like

/**
    * 
    * @param pacm
    *
    * @return 
 */

instead of

/**
 * 
 *
 * @param pacm
 *
 * @return 
 */

This happens only for PHP files. I checked the different settings in the PHP and cpp file windows but couldn't figure out the reason.

The following are the different settings that I checked.

shiftwidth

php - 4, cpp 4

comments

cpp

comments=sO:* -,mO:* ,exO:*/,s1:/*,mb:*,ex:*/,:// Last set from ~/Dropbox/code/dotfiles/vim/vim/bundle/DoxygenToolkit.vim/plugin/DoxygenToolkit.vim

php

comments=s1:/*,mb:*,ex:*/,://,:# Last set from ~/Dropbox/code/dotfiles/vim/vim/bundle/DoxygenToolkit.vim/plugin/DoxygenToolkit.vim

I tried changing it to the options used by cpp, but that didn't change anything.

cindent

cpp - cindent php - nocindent - I modifyed it to cindent, but it didn't made any difference.

cinoptions

Empty for both php and cpp files. However the DoxygenToolkit script used the option c1C1

Any help would be appreciated.

Upvotes: 0

Views: 207

Answers (1)

湖吉晨
湖吉晨

Reputation: 11

try simply change

filetype plugin indent on

to

filetype plugin on

in ~/.vimrc. if it works, your indent options might be updated in $DIR_OF_VIM/vim/vim80/indent/php.vim.(vim80 indicates my vim version)。

:verbose set autoindent?

tells the last time autoindent is updated. If it is updated in $DIR_OF_VIM/vim/vim80/indent/php.vim indeed. you need to update it in ~/.vim/after/indent/php.vim.

setlocal indentexpr=
setlocal cindent

and keep

filetype plugin indent on

in your ~/.vimrc.

good luck.

Upvotes: 1

Related Questions