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
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?