[英]Indent an XML file in a VIM script
我試圖編寫一個漂亮的小GVIM腳本在Windows上執行以下操作:
" 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
我被最后一個命令困住了:它不能通過腳本運行。 有沒有一個等效的作品?
:normal
命令允許您執行常規命令:
:normal gg=G
有關更多信息,請參見:h :norm
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.