I have loads of trouble with tabs and indentation in vim too.

I currently have:

set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4

In my .vimrc, which appears to work.

What I need to know is how to reformat a file to fix the indentation throughout the file.

Regards,

Rob…