我正在尝试编写一个漂亮的小 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
了解更多信息
关于xml - 在 VIM 脚本中缩进 XML 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22386669/