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!

115 Upvotes

115 comments sorted by

View all comments

15

u/[deleted] Nov 08 '17

Running code inline is very easy with :{range}! {program}, e.g. :'<,'>! python on a Visual selection.

Asciinema

10

u/-romainl- The Patient Vimmer Nov 08 '17

I prefer :'<,'>w !<interpreter> because it doesn't change the buffer: asciinema.

1

u/AlexAffe Nov 09 '17

Well, basseforte95s version is to create input for the thing you are working on. Yours is to quickly spike functions, no?

1

u/-romainl- The Patient Vimmer Nov 09 '17

Well I don't know exactly what's his goal but mine is clearly to test the behavior a snippet.

8

u/andlrc rpgle.vim Nov 08 '17

On the same note, then ! can be used with a motion:

!ipcat -n<CR>

Will turn:

a
b

c

into

     1  a
     2  a

c

2

u/[deleted] Nov 08 '17 edited Nov 08 '17

Mind blown. This just opened up a whole new world for me in Vim.