-
-
Notifications
You must be signed in to change notification settings - Fork 447
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
Commenting a motion #260
Comments
I agree this would be a great thing to add. Basically it would just amount to a parallel set of functions that took a motion as a required argument and passed that range to the various comment functions rather than the current selection. You could then bind those functions however you liked. For many scenarios this would just be a reversal of the key sequence already available and one less character ( That being said the original author isn't actively developing this at all right now and I'm basically on the project as a community maintainer. Given my limited time, I'm unlikely to sit down and implement this feature anytime soon. If anybody want's to take a stab at it I will be happy to review and merge when it works. |
NERD Commenter has a few drawbacks when compared to tcomment: - Slower to start (2.8ms vs 1.8ms on my machine) - Lacks motion support (preservim/nerdcommenter#260) - Clunky key bindings compared to other comment vim plugins It does however seem to be richer with regards to settings such as comment alignment, custom language delimiters and otherwise toggle how comments should be done with the defaults maps. With tcomment this seems to be defined using all the different maps rather than tuning the "default" `gcc` or `gc` in visual mode. There's also the third alternative vim-commentary by tpope. It's much faster (0.193ms) while still supporting basic motions, sane toggles etc. It does however lack support for embedded syntax, inline comments and more that tcomment delivers. If you want to switch back to NERD Commenter or even vim-commentary disable this plugin and add whichever to your own config. – https://github.com/timss/vimconf#disabling-plugins
Generally speaking plugin X does Y is not a good argument for implementing a feature, I know, however: I very much miss the ability to comment a motion, from tpopes commentary. Prepending a count helps in a way, but still lacks the precision I am used to in vim. Things like:
Comment out 3 lines up:
gc3k
... outer paragraph:
gcap
... inner braces
gcib
etc.
A workaround would be to select first, and comment out second, but a motion would be preferable.
Combining motions with the multitude of your plugins features would be brilliant indeed. Hope I am not beating a dead horse here, I haven't found a mention of motions in either the docs nor the issues.
In either case, thanks for your great plugin, just found it and am very happy using it!
The text was updated successfully, but these errors were encountered: