From 198ecccabcdd0d9fbb5379015b2db9c84f6209dc Mon Sep 17 00:00:00 2001 From: Jan Mollowitz Date: Wed, 14 Jun 2017 09:56:57 +0200 Subject: [PATCH 1/2] Added option to disable the function name in phpDoc --- plugin/php-doc.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugin/php-doc.vim b/plugin/php-doc.vim index d72bf1d..ba9ccc2 100644 --- a/plugin/php-doc.vim +++ b/plugin/php-doc.vim @@ -89,6 +89,7 @@ if !exists('g:pdv_cfg_Commentn') | let g:pdv_cfg_Commentn = " * " | endif if !exists('g:pdv_cfg_CommentBlank') | let g:pdv_cfg_CommentBlank = " *" | endif if !exists('g:pdv_cfg_CommentTail') | let g:pdv_cfg_CommentTail = " */" | endif if !exists('g:pdv_cfg_CommentSingle') | let g:pdv_cfg_CommentSingle = "//" | endif +if !exists('g:pdv_cfg_InsertFuncName') | let g:pdv_cfg_InsertFuncName = 1 | endif if !exists('g:pdv_cfg_FuncCommentEnd') | let g:pdv_cfg_FuncCommentEnd = " // End function" | endif if !exists('g:pdv_cfg_ClassCommentEnd') | let g:pdv_cfg_ClassCommentEnd = " // End" | endif if !exists('g:pdv_cfg_VariableTypeTag') | let g:pdv_cfg_VariableTypeTag = "@var" | endif @@ -373,8 +374,10 @@ func! PhpDocFunc(end_line) exe l:txtBOL . g:pdv_cfg_CommentHead . g:pdv_cfg_EOL " added folding - exe l:txtBOL . g:pdv_cfg_Comment1 . funcname . g:pdv_cfg_EOL - exe l:txtBOL . g:pdv_cfg_CommentBlank . g:pdv_cfg_EOL + if g:pdv_cfg_InsertFuncName == 1 + exe l:txtBOL . g:pdv_cfg_Comment1 . funcname . g:pdv_cfg_EOL + exe l:txtBOL . g:pdv_cfg_CommentBlank . g:pdv_cfg_EOL + endif while (l:parameters != ",") && (l:parameters != "") " Save 1st parameter From f16ef666596b8b4ca55006d30d30e6f04f645ac6 Mon Sep 17 00:00:00 2001 From: Jan Mollowitz Date: Fri, 16 Jun 2017 09:10:17 +0200 Subject: [PATCH 2/2] Optional variable names --- plugin/php-doc.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/php-doc.vim b/plugin/php-doc.vim index ba9ccc2..8e2ef1b 100644 --- a/plugin/php-doc.vim +++ b/plugin/php-doc.vim @@ -90,6 +90,7 @@ if !exists('g:pdv_cfg_CommentBlank') | let g:pdv_cfg_CommentBlank = " *" | endif if !exists('g:pdv_cfg_CommentTail') | let g:pdv_cfg_CommentTail = " */" | endif if !exists('g:pdv_cfg_CommentSingle') | let g:pdv_cfg_CommentSingle = "//" | endif if !exists('g:pdv_cfg_InsertFuncName') | let g:pdv_cfg_InsertFuncName = 1 | endif +if !exists('g:pdv_cfg_InsertVarName') | let g:pdv_cfg_InsertVarName = 1 | endif if !exists('g:pdv_cfg_FuncCommentEnd') | let g:pdv_cfg_FuncCommentEnd = " // End function" | endif if !exists('g:pdv_cfg_ClassCommentEnd') | let g:pdv_cfg_ClassCommentEnd = " // End" | endif if !exists('g:pdv_cfg_VariableTypeTag') | let g:pdv_cfg_VariableTypeTag = "@var" | endif @@ -458,8 +459,11 @@ func! PhpDocVar() let l:txtBOL = g:pdv_cfg_BOL . l:indent exe l:txtBOL . g:pdv_cfg_CommentHead . g:pdv_cfg_EOL - exe l:txtBOL . g:pdv_cfg_Comment1 . l:varname . " " . g:pdv_cfg_EOL - exe l:txtBOL . g:pdv_cfg_CommentBlank . g:pdv_cfg_EOL + + if g:pdv_cfg_InsertVarName == 1 + exe l:txtBOL . g:pdv_cfg_Comment1 . l:varname . " " . g:pdv_cfg_EOL + exe l:txtBOL . g:pdv_cfg_CommentBlank . g:pdv_cfg_EOL + endif if l:static != "" exe l:txtBOL . g:pdv_cfg_Commentn . "@static" . g:pdv_cfg_EOL endif