I found a command that would sort highlighted lines by their length and wanted to make a mapping for it so that I could avoid typing it every time.
vnoremap ,s :<C-U>'<,'> ! awk '{ print length(), $0 | "sort -n | cut -d\\ -f2-" }'<CR>
However, when I try to use the remapping, only the following is seen:
:'<,'> ! awk '{ print length(), $0
It abruptly stops at $0
and does not complete the rest of the command.
I don't know what I am doing wrong; any help would be appreciated.
<bar>
or\|
instead of|