3 ms·
Something I recently learned that is really cool: :<area>!<command> will export the <area> to <comand> and then replace <area> with the output of the <command
by Dobbs 17y ago
Something I recently learned that is really cool:
:<area>!<command>
will export the <area> to <comand> and then replace <area> with the output of the <command>. So you can do:
:%!sort # Sort the entire file.
:.!awk '{ print $1 }' # Replace the current line with the
first word/column.
So much power with this really simple set of commands. You can also highlight the an area using visual mode, and then just type ':!<command>' and it will autofill in the area for you.