Is it possible to get the line numbers of selected text to pass to an external command?
Context: I'd like to integrate pyfmt
into vim. Ideally, I'd like to be able to select some text and type some shortcut to have the selected text reformatted by pyfmt
.
So far I've found that running !pyfmt -i %
will format the whole file. pyfmt
also supports a --lines START-END
option. I'd like to be able to pass the line numbers of the beginning and end of the selected text to pyfmt
so that only what I want to reformat gets reformatted. Is this possible?
pyfmt
are you using? pypi.python.org/pypi/pyfmt doesn't seem to support a--lines
option.