Make template work with ido-mode