Kimvais
Kimvais

Reputation: 39578

How do I run the file through a shell command in vim for a certain filtype

I now have a solution to this question, which leads me to the next question: how do I run "xmllint --noent" to all .xml files when opening them in vim.

I have an example to do --decrypt on load and --encrypt on save for .gpg in my .vimrc, but it is so complicated that I cannot really figure the relevant parts. My latest attempt is:

autocmd BufReadPost,FileReadPost *.xml %!xmllint --noent - 2> /dev/null

which gives me :

<N> lines filtered
Press ENTER or type command to continue

How do I get rid of this? (i.e. do it silently)

Upvotes: 2

Views: 284

Answers (1)

zmbush
zmbush

Reputation: 2810

I think this question might belong on superuser, but if you want to execute a command with no output, you can use silent

I.E.

:silent !echo Hello

see: Avoiding the "Hit ENTER to continue" prompts

Upvotes: 2

Related Questions