2014-03-13 67 views
2

我想寫一個漂亮的小GVIM腳本來完成Windows上的以下內容:縮進Vim腳本的XML文件

" get the contents from the Windows clipboard 
put * 
" set XML as the type of the current file 
set filetype=xml 
" put each XML tag on separate lines 
%s/>\s\+</>\r</g 
" Autoindent the file 
gg=G 

我卡在最後的命令:它不會從工作一個腳本。有沒有可以工作的等價物?

回答

3

:normal命令可以執行正常的命令:

:normal gg=G 

:h :norm以獲取更多信息

+0

它最好默認爲':!用'正常'變異',使這個獨立任何映射(除非需要)。 –