vim-pug icon indicating copy to clipboard operation
vim-pug copied to clipboard

Support for block comments with '//-' (Pug's block comments)

Open gyermolenko opened this issue 8 years ago • 4 comments

Hi.

I want to use Pug's block comments (start with //-)

I use vim-commentary plugin for commenting stuff out. It relies on 'commentstring' option first. And your plugin currently sets it as //\ %s . I tried to overwrite it with " autocmd FileType pug setlocal commentstring=//-\ %s - no luck. Could you please advise some solution? thanks.

gyermolenko avatar Mar 31 '17 11:03 gyermolenko

@gyermolenko can you please url which vim-commentary plugin you use? i found several

acidjazz avatar Mar 31 '17 20:03 acidjazz

@acidjazz tpope's

gyermolenko avatar Mar 31 '17 20:03 gyermolenko

@gyermolenko have you tried

setlocal comments=://-,:// commentstring=//-\ %s

acidjazz avatar Apr 01 '17 02:04 acidjazz

@acidjazz

setlocal comments=://-,:// commentstring=//-\ %s works by itself if i set it from pug file (comments then start with //-) BUT if i set it from 'vimrc' with autocmd like this autocmd FileType pug setlocal comments=://-,:// commentstring=//-\ %s :

  1. autocmd fires up when i load pug file
  2. vim-pug overwrites changes with its settings. At least that is what it looks like. Because :verbose set commentstring returns
  commentstring=// %s                                                                                                                                                                                                                          
        Last set from ~/<my.vim-path>/vim-pug/ftplugin/pug.vim

gyermolenko avatar Apr 01 '17 08:04 gyermolenko