Comments (7)
+1
from vim-commentary.
+1
Should it be optional based on commentstring
? Such that with commentstring=//%s
you get:
//var example = "hi";
//var anotherExample = "hello";
But with commentstring=//\ %s
you get
// var example = "hi";
// var anotherExample = "hello";
from vim-commentary.
And then what? Users can go and override every ftplugin's commentstring one by one in order to micromanage it?
from vim-commentary.
I was under the impression that commentstring was supposed to be how to format a comment in a given language and the plugin does not follow the format since it adds spaces around the given format. It stands to reason that if people want a different format for their comments then they would need to alter commentstring per file type they care.
I believe the current setting is inconsistent with vim's usage of commentstring since when you create a fold (with foldmethod=marker
) the comment that vim introduces does not add spaces around the %s.
I don't know how else you would do that without introducing a global configuration variable which seems very ugly.
Or am I missing something?
from vim-commentary.
It's a practical consideration. About 2/3rds of Vim's default comment strings have spaces and about a 1/3rd don't. This has little to do with language consideration and everything to do with the whims of maintainers. I chose to add the space on those in the 1/3rd rather than subject the user to an arbitrary mess.
You're correct about foldmethod
, but since foldmarkers count as "useful comments", your solution is now directly opposed to the original request.
One compromise might be to exempt b:commentary_format
from the whitespace normalization, since that's free of defaults.
from vim-commentary.
I see. If we remove comentary_format from the normalization then users could have an autocmd/ftplugin to set commentary_format to whatever they please. Your compromise would be acceptable to me.
from vim-commentary.
Thank you!
from vim-commentary.
Related Issues (20)
- Python comment, good on windows, but with C style on Mac M1. HOT 2
- Support for files with mixed languages HOT 2
- How to comment empty lines? HOT 2
- vim-commentary set wrong comment when edit user's crontab file HOT 1
- Installation described in Readme does not work HOT 2
- How to set the comment prefix HOT 1
- Auto-comment the duplicated lines HOT 6
- Different custom keybinding HOT 1
- How to remapping this HOT 1
- Should something like ``gc3w`` work? HOT 1
- how install vim-commentary with bundle ?
- commentary does not properly detect (or use) known filetype HOT 1
- Apply comments to text objects HOT 1
- Vim commentary doesn't work on svelte. HOT 5
- Does not work HOT 1
- Is it possible to replace dosbatch's REM comment prefix with :: (double colon)? HOT 9
- How to install in nvchad?
- Important part of programs functionarlity not mentioned in README.md
- gcc does not work in neovim on files that require sudo permissions, when run as user
- Support for vim9script HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-commentary.