Reputation: 2812
It is common to comment the block of python with with # following with space.
So using the v-block mode with ctrl+v
, how to delete the first 2 character? Using x
will leave a spacebar at the head of line, which messes up the indentation.
# class Memoize:
# def __init__(self, func):
# self.func = func
# self.cache = {}
# def __call__(self, arg):
# if arg not in self.cache:
# self.cache[arg] = self.func(arg)
# return self.cache[arg]
I know using substitute (s) can do the job, but I find that to be quite slow.
Many thanks.
Upvotes: 0
Views: 355
Reputation: 34046
You can do it like this:
Ctrl+v
. Enter the Visual block mode.right arrow key
once. This will select #
and space
.down arrow key
to select the multiple lines.x
to delete them all.Below are the images doing the same:
x
and save your file:Upvotes: 1
Reputation: 195029
#
of the class
line, press ctrl-v
jjjjj..l
till the suitable line or Gl
if the last commented line is the end of the file.x
v
or ctrl-v
) the lines :s/^# //
then enter.Upvotes: 2