tcomment_vim
tcomment_vim copied to clipboard
PHP comment characters don't work
I want you to comment out with #
, but it becomes <!-->
.
I set it as follows, but the result does not change. What should I do?
if !exists('g:tcomment_types')
let g:tcomment_types = {}
endif
let g:tcomment_types['php'] = '// %s'
<?php
class Test
{
public $aaa;
}
press gcc
<?php
class Test
{
<!-- public $aaa; -->
}
Please see :h tcomment-debug
and post the output here.
The problem seems to be that tcomment thinks this is HTML and not PHP. Do you use the default php plugin?
Debug output result
TCOMMENT: &ft = php => php
TCOMMENT: stx = =>
TCOMMENT: ct = {'_args': {'beg': 31, 'fallbackFiletype': '', 'end': 31, 'filetype': 'php', 'comment_mode': ''}, 'commentstring': '// %s', 'mode': '', 'filetype': 'php'}
The info was also copied to the clipboard @+
Please see also :help tcomment-debug
PHP related plugins include neoclide/coc.nvim and marlonfan/coc-phpls language servers.
However, once I tried removing the plugin, the comment didn't work
This is my plugin list https://github.com/yoshida-m-3/nvim/blob/main/dein.toml
I have the same issue.