开发者

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: ho开发者_开发知识库w 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)


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜