I'm trying to make a mapping in vim to insert comments (for example, "# " - box with a space) while respecting the indenting. So, instead of commenting like this:
class MyFrame(wx.Frame):
def __init__(self, title, pos, size):
# wx.Frame.__init__(self, None, -1, title, pos, size)
# menuFile = wx.Menu()
I'd to insert the "# " in the code like this,
class MyFrame(wx.Frame):
def __init__(self, title, pos, size):
# wx.Frame.__init__(self, None, -1, title, pos, size)
# menuFile = wx.Menu()
therefore respecting the indent (which can be tabs or space).
I was trying to get it to work with vim's 0 (zero) command which gets you to the first character in the line, but have been unable. Please, help. I'd be grateful for all ideas and practical suggestions.
Try using the ^
command instead of 0
. Or, use the I
command to insert before the first nonspace character on the line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With