I am using this mapping:
" Class: transform init arg to variable assignment " <Esc> is input as Ctrl + v <Esc> and shows as ^[ nnoremap » :norm 0wiself.<Esc>w"byiwEDa = <Esc>"bp
to be able to transform, in Python, a line taken from a Python Class init args to variable assignment.
1 def __init__(): 2 self, 3 arg_1: str, 4 arg_2: str = "default_value", 5 arg_3: str = "another_default_value", 6 ): 7 self.arg_1 = arg_1 8 self.arg_2 = arg_2 9 self.arg_3 = arg_3
I can yank the lines 3, 4 and 5, and paste them after line 6, and then use the custom mapping to transform each line into the variable assignment:
arg_1: str, becomes
self.arg_1 = arg_1
How can I adapt the mapping so that I could do
3» to transform all the lines at once instead of going over each line individually ?