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

gc does not uncomment if only one line is selected and the comment symbol is at the begining of a line #260

Open
albertas opened this issue Jan 10, 2020 · 4 comments

Comments

@albertas
Copy link

albertas commented Jan 10, 2020

When I block select only one line and try to uncomment it by using gc in .py files, it gets commented again, instead of uncommented if comment symbol is at the begining of a line. This behaviour also applies for other file types too.

@albertas albertas changed the title gc does not uncomment if only one line is selected gc does not uncomment if only one line is selected and the comment symbol is at the begining of a line Jan 23, 2020
@haze
Copy link

haze commented Sep 12, 2021

Also experiencing this.

@albertas
Copy link
Author

I would love to see this fixed. Would do myself, if I knew vimscript.

@tomtom
Copy link
Owner

tomtom commented Sep 13, 2021

Could you please be more specific and provide an example?

With "block select" you mean $. This could cause some confusion.

Why would you want to "block select" a single line?

@albertas
Copy link
Author

albertas commented Sep 13, 2021

My use case is in Python, I have several imports:

import time
import os

I visually select first import line by clicking shift+v and comment it with gc.

# import time
import os

Some time passes and I want to uncomment that line, so go on it, click shift+v and gc and the result is another comment instead of uncommented line:

# # import time
import os

Why do I use this combination? I got used to using gc for toggling comments disregarding the size of code block. The same applies for .vimrc edits - sometimes I want to toggle commenting for a single 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

3 participants