StevieD
StevieD

Reputation: 7443

Can vim/neovim execute a command immediately after pasting text?

This probably isn't possible but figured I'd ask. I have a utility installed on my machine that lets me highlight text in one app and quickly paste it over into my terminal which has neovim open.

I'd like to automatically run some basic text commands after the paste operation to spare me the chore. Can this be done?

Upvotes: 1

Views: 292

Answers (1)

B.G.
B.G.

Reputation: 6026

sure if you use p for pasting, you can just remap it to p and then your function:

:nnoremap p p :echo "HELLO WORLD"<CR>

The same should also work with <S-Insert>

Upvotes: 2

Related Questions