I have a c project with multiple files (more than 100), the codes are written in Whitesmiths style, but I want to change them into K&R style indentation. Is it possible to do using vim in an automated way ?
For example I have a emacs-lisp script to achieve this --
(progn
(find-file "{}")
(mark-whole-buffer)
(setq indent-tabs-mode nil)
(untabify (point-min) (point-max))
(indent-region (point-min) (point-max) nil)
(save-buffer))
I was wondering if there is a similar trick that could be done with vim.
Update: I have found another nice tool called astyle, which supports auto-indentation for different languages (with a wide range of styles) as well.