我熟悉 = 过滤器。== 键序列缩进当前行,而 gg=G 缩进整个文件。我正在尝试创建一个命令:FixIndentation 以获得类似的效果,以修复整个文件中的缩进。
# vim documentation provides example to map to key
map <F7> gg=G<C-o><C-o>
# my attempt to map to a command fails
command ReIndent execute "gg=G"
:ReIndent
E492: Not an editor command: gg=G