I want to select some lines in visual mode, and enter a custom command :Ex<CR> so that:'<,'>!expand -t4is run to expand all tabs in selected range. How to define  the Ex command?I have tried things like:command! -range Ex !expand -t4but that command just hangs, it seems that the range was not forwarded.
How to define a custom user defined command to filter a range?
external command;user commands