I'm writing a vim function to set hard tabs and refactor indents in a whole file. This is the function:
function RefInd()
:set tabstop=4 softtabstop=0 noexpandtab shiftwidth=4
gg=G
endfunction
And this is the error:
Error executing the function RefInd:
Line 2:
E492: Not an editor command: ^Igg=G
Press ENTER or type command to continue
Any help?
gg=G
is a normal mode command. Usenormal gg=G
.normal!
to make sure you're not running user-defined mappings.:retab
and:retab!
.