I'm trying to work out how to get Vim to follow a slightly more complex indentation scheme than most editors allow by default. Essentially I want to use tabs for indentation, but spaces to align statements that span more than one line. For example:
private static $_columns = array('id' => 'id',
'email' => 'email',
'passwordHash' => 'password_hash',
'salt' => 'salt');
^ tabs up to here
^ spaces up to here
The idea here is that indentation follows the tab-width preferences of whoever is editing the file, while multi-line statements still align correctly.
I guess the simple way to implement this would be to have Vim just copy the indentation pattern used on the previous line (i.e. the leading white space) whenever a new line is entered. Is there any way to do this in Vim? Would I need to write a plugin?
vim:ts=4
works nicely. – sidyll