1. Move the conditional :finish line later in the file. 2. Follow vim coding standards better: 2a. Set and restore the 'cpo' option. 2b. Define b:undo_ftplugin.