2010-01-13 47 views
2

我現在有一個解決方案this question,這引發了下一個問題:如何對所有.xml文件運行「xmllint --noent」當在vim中打開它們時。如何通過vim中的shell命令在某個特定類型的文件中運行該文件

我有一個例子 - 在加載時解密並在我的.vimrc保存.gpg文件時加密 - 但它太複雜了,我無法真正地確定相關部分。我的最新嘗試是:

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

這給了我:

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

如何擺脫呢? (即做默默)

回答

2

我認爲這個問題可能會在超級用戶屬於,但如果你想有沒有輸出執行命令,你可以使用silent

I.E.

:silent !echo Hello 

見:Avoiding the "Hit ENTER to continue" prompts

+1

'自動命令在BufReadPost,FileReadPost * .XML沉默%xmllint --noent - 2>的/ dev/null'的伎倆,感謝您! – Kimvais 2010-01-13 08:19:47

+0

很高興能幫到你! – zmbush 2010-01-13 08:21:03

相關問題