branquito
branquito

Reputation: 4034

run external command from within vim

When I run fc -l -20 in my zsh, I get the expected output.

However when running the same from within vim like so:

:r! fc -l -20 I get error saying: zsh:fc:1: no such event: 0

Why is that, and how to get my previous 20 history list entries into vim?

Upvotes: 0

Views: 114

Answers (1)

a3f
a3f

Reputation: 8657

fc is a shell builtin and as such would have to be called from within your shell. Alternatives are fc -l -20 | vim - or maybe <c-Z> fc -l -20 | pbcopy % "*p.

Upvotes: 3

Related Questions