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

Possible to comment without space? #145

Open
x3rAx opened this issue May 14, 2021 · 2 comments
Open

Possible to comment without space? #145

x3rAx opened this issue May 14, 2021 · 2 comments

Comments

@x3rAx
Copy link

x3rAx commented May 14, 2021

First, thank you for this plugin, it made my life so much easier ❤️

I have an issue though:

I like "real" comments (ie. text describing what the code does) to have a space between the comment symbol and the actual text:

# This is a comment describing what the highly optimized, but
# unreadable code below does.
this.is(() => some.magic(code)) && nobody += understands[it]

On the other hand, I want commented out code, that is temporarily disabled to not have a space between the comment symbol and the code:

#this.code = should[not].be(executed)

This second case is usually what I use this extension for, because when I write comments, I start by manually typing the comment symbol before typing the text.

Is there a setting that I can change to make this extension not insert a space after the comment symbol when toggling comments?


Edit

Seems like there have been similar threads like this one (#40, #3, #32, #33) and it sounds like there has been some changes regarding to a commentary_format variable but I was unable to find out what value it must be set to, to enable what I requested...

@xaizek
Copy link

xaizek commented May 14, 2021

I think you do it like this (better use after/ftplugin directory, this is just an example):

autocmd FileType c :let b:commentary_format = '/*%s*/'

Maybe even:

autocmd FileType * :let b:commentary_format = &commentstring

@x3rAx
Copy link
Author

x3rAx commented May 14, 2021

autocmd FileType * :let b:commentary_format = &commentstring

@xaizek thanks a lot, this is what I was looking for!

Also thanks for the hint about after/ftplugin, I didn't know about that 😅

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

2 participants