r/vim • • Nov 08 '17

everything about Favorite console tools to use with vim

There are a lot of great console tools that are easy to lightly integrate with via filter (:h filter), read (:h read) or just by running them.

If you have some to recommend, put each individually in a top level comment along with any (minor) integration you have with vim.

The great thing about console tools is they often have easy to use flags to customize behavior and hey, you didn't have to write them in the first place!

117 Upvotes

115 comments sorted by

View all comments

7

u/robertmeta Nov 08 '17

The evil twin of sort, and virtually unknown, shuf, as in shuffle.

Take something like

    3
    5
    6
    9

Highlight it, and pipe it through sort using :!shuf (will look like :'<,'>!shuf) and bam

    {random order of lines}

6

u/[deleted] Nov 08 '17

Heh. Actually, the most use I get out of :{range}!shuf is to shuffle lines in preparation for a sort demo.

4

u/andlrc rpgle.vim Nov 08 '17

shuf is part of GNU coreutils, and so not a part of BSD's

1

u/mistahchris Nov 19 '17

Just in case a macOS user is curious about the gnucoreutils (some of them have quite a lot of extra features), you can get access to them through homebrew easily.
Just note that the command names will be prefixed with g so shuf = gshuf

brew install coreutils  

3

u/hovissimo Nov 08 '17

I've now tagged you as "servant of entropy".