extending vim with shell commands | 10

format some code

Format this one python statement.

print('here')

press !!genericformat --formatter black

print("here")

Now try a multiline statement.

def func(arg_one, arg_two, arg_three, kwarg='one',):
   ...

press Vj!genericformat --formatter black

def func(
    arg_one,
    arg_two,
    arg_three,
    kwarg="one",
):
    ...

Want Docstrings???

press V6j!doq

def func(
    arg_one,
    arg_two,
    arg_three,
    kwarg="one",
):
    """func.

    :param arg_one:
    :param arg_two:
    :param arg_three:
    :param kwarg:
    """
    ...