It seems you're using the backspace key in insert mode to delete the comments. As you found out, this will not really work at all in visual block mode.
Instead, you can simply use the x or d commands to delete a visual selection. See :help v_x.
If you want to delete multiple comment characters, you can make your visual block take up "n" columns to cover all the comment characters.
For example, if your comments are // and you have a blank space after the comments (so 3 characters total), then you can:
- Move to the
// on the first line where you want comments removed.
- Use Ctrl+V to enter Visual Block mode.
- Move to the
// on the last line where you want comments removed. You'll have a n x 1 block, with "n" lines and one column.
- Move to the blank right after the
//, with a command such as 2l or fSpace, now you'll have a n x 3 visual block.
- Use x or d. This will remove the contents of the visual block, with the comments.
You might also want to consider adopting a plug-in to help inserting, removing or toggling comments. I can recommend vim-commentary which does a great job. This (and similar plug-ins) are typically also able to figure out which style of comments you need for the language you're using, so they typically require zero configuration other than having your plug-in manager install and enable them.
Ctrl+Vto select the comment characters and then usexto delete that block? Also take a look at plug-ins such as vim-commentary which should make your life much easier! – filbranden Jun 02 '20 at 19:42sto substitute your selection, then type in what you need. But as for commenting, I'd advocate vim-commentary as well. – Biggybi Jun 03 '20 at 03:05IandAonly to insert new characters (and useBSduring your edit if you inserted a wrong character), otherwise to delete characters in visual block, select the characters you want to delete and usexordinstead. However I'm not 100% sure why the backspace deletion doesn't work on all lines so I'll let someone dig into that and post an answer :) – statox Jun 03 '20 at 08:30gvto easily select the same visual selection again, if that helps... – filbranden Jun 04 '20 at 13:59Ctrl+ `v'. Could you please add an answer bellow? – Luís de Sousa Jun 04 '20 at 17:45