diff --git a/rc/filetype/php.kak b/rc/filetype/php.kak index 8ee1d8ce..d25d22ab 100644 --- a/rc/filetype/php.kak +++ b/rc/filetype/php.kak @@ -83,14 +83,16 @@ define-command -hidden php-indent-on-char %< define-command -hidden php-indent-on-new-line %< evaluate-commands -draft -itersel %< - # copy // comments prefix and following white spaces - try %{ execute-keys -draft k s ^\h*\K#\h* y gh j P } + # copy // comments or docblock * prefix and following white spaces + try %{ execute-keys -draft s [^/] k s ^\h*\K(?://|[*][^/])\h* y gh j P } # preserve previous line indent try %{ execute-keys -draft \; K } # filter previous line try %{ execute-keys -draft k : php-trim-indent } # indent after lines beginning / ending with opener token try %_ execute-keys -draft k ^\h*[[{]|[[{]$ j _ + # append " * " on lines starting a multiline /** or /* comment + try %{ execute-keys -draft k s ^\h*/[*][* ]? j gi i * } > >