Open alex-shamshurin opened 6 years ago
Same issue here, all installed with Plug
.
@herrbischoff Does caw.vim work for you, still? You added the suggestion in #93 so I thought you may know more about this :)
Same issue here but the comment are using //
instead < !-- -->
along the file in my case. All installed using Plug
.
That’s a common issue with caw regarding wrapping comment styles. Took me a while to figure it out a couple of days ago.
You’re probably using gcc
as the comment/uncomment toggle. When you’re using gcw
for commenting and gcuw
for uncommenting, it will work. This has apparently to do with the way caw does its magic. To have that behavior changed, feel free to open an issue at the caw repo. I will happily support it, as I have the same problem within JSP files right now.
@herrbischoff We hope you do it
In my config I tried https://github.com/tomtom/tcomment_vim and it works.
In my config I tried https://github.com/tomtom/tcomment_vim and it works.
So tcomment.vim
supports multiple languages in a single file now? Can you verify this?
From a quick test in a Single File Component, tcomment_vim
works. I swapped it out for vim-commentary
, which I'd switched back to since context_filetype.vim
and caw.vim
weren't working for SFCs anyway.
Thanks, I will check that out as well. However, caw.vim
does work properly, although only in the way I wrote up above. If you expect to toggle comments with the same command, it does not.
Just confirmed this myself. tcomment
works great with Vue SFCs.
I have opened a PR adding it to the README: https://github.com/posva/vim-vue/pull/134
@posva: I think this issue can be closed now.
It works nicely, though (slightly off-topic) as with caw.vim
it has some differences to other commenting plugins. For me the biggest one is https://github.com/tomtom/tcomment_vim/issues/179 which is making it hard to switch to just for Vue support.
Having gone back to https://github.com/tpope/vim-commentary for a while, but finally getting fed up with manually commenting in scripts/styles in Vue SFCs, I had another go with tcomment. I had missed that @mg979 had helpfully posed a mapping to fix tomtom/tcomment_vim#179 that I have adapted, so far this is working well, I'll post again if I come across any issues.
nmap <expr> gcc v:count? ":<c-u><cr>gc".(v:count1-1)."j" : "gcc"
Edit:
Having some trouble with single line comment toggles with the above (and separately, the plugin overwriting my mapping), so switched to:
autocmd VimEnter * nmap <expr> gcc v:count? ":<c-u>.,.+".(v:count-1)."TComment<CR>" : ":TComment<CR>"
In my vimrc.
Is there any way to make it work with https://github.com/tpope/vim-commentary ?
@mig-hub You're going to have to figure this out for yourself and/or ask Tim Pope.
I have used https://github.com/tomtom/tcomment_vim for a couple of years now and it has been working reliably for me in almost all circumstances, Vue SFC included.
I have the same html comments
< !-- -->
along the file, despite the file part - instyle
andscript
- the same.context_filetype.vim and caw.vim installed. I use vim-vue via polyglot.