Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this still needed with Neovim 0.10? #453

Open
flexagoon opened this issue Apr 10, 2024 · 10 comments
Open

Is this still needed with Neovim 0.10? #453

flexagoon opened this issue Apr 10, 2024 · 10 comments

Comments

@flexagoon
Copy link

Neovim 0.10 introduced built-in commenting support:

neovim/neovim#28176

Does it make this plugin redundant? If not, the differences should be mentioned in the readme.

@ouuan
Copy link

ouuan commented May 7, 2024

A notable difference is that the built-in comment does not force the single-space inner padding. This means that comments would be //comment instead of // comment, and uncommenting // comment may result in comment with a leading space. This might be fixed in the future. Now you can use this workaround.

@LukasPietzschmann
Copy link

Additionally, NeoVim cannot distinguish between block and line comments. In C, e.g., it will always insert block comments.

@madjxatw
Copy link

As I know the built-in commenting support in Neovim 0.10 actually comes from mini.comment that lacks block commenting support and some other features.

@emileferreira
Copy link

emileferreira commented May 20, 2024

The limitation voiced by @ouuan does apply to C and Java, but not to Lua or Python. I think that, for now, this plugin provides a more consistent and featureful commenting interface, and agree that a comparison should be provided in the README.

@aimestereo
Copy link

aimestereo commented May 20, 2024

UPDATE: I can't say anything about C, but default behavior miss space for *.ts and completely missing/broken for *.sql


@flexagoon If you don't need block comments, then you are good with the default Neovim behavior, at least try it and decide for yourself.

@ouuan

notable difference is that the built-in comment does not force the single-space inner padding. This means that comments would be //comment instead of // comment, and uncommenting // comment may result in comment with a leading space. This might be fixed in the future.

I don't see that, standard gc works correctly in .lua, .py, .go, .ts (with leading space). Text objects are also supported (.i.e. gci{ or gc}).
There' no block comments, but I don't use them anyway.

❯ nvim --version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

@ouuan
Copy link

ouuan commented May 20, 2024

I don't see that, standard gc works correctly in .lua, .py, .go, .ts (with leading space).

What's your commentstring for ts? If it is // %s, where is it set (nvim -V1 and :verb set cms)?

@polyzen
Copy link

polyzen commented May 20, 2024

JoosepAlviste/nvim-ts-context-commentstring#109

@aimestereo
Copy link

@ouuan interesting for *.ts files it's commentstring=//%s and yeah, it's wrong now. Maybe I fucked up in my initial check

I came back to this, to update my original comment: default comment doesn't work for sql, like at all.

@VladimirMarkelov
Copy link

Can NeoVim 0.10 comment/uncomment a part of a line using the block comment?

With this plugin I press gc and if anything is selected inside a line, the plugin uses block comment to comment a part of the text. But in NeoVim pressing gc always comment/uncomment the entire line even if it is in Visual mode and a part of a line is selected. From this point of view, the plugin seems much more convenient for me than the built-in NeoVim feature.

@aimestereo
Copy link

@VladimirMarkelov no, it can't. It can only comment whole line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants