I am using a plugin that expands the word template by a template but only if the word template is followed by a tab. I am trying to write the word new then in insert mode jump to the end of the line then insert the tab, I am on mac too. When I try this command from command mode in vim, it works but when I try it in a vim script it doesn't work. What am I doing wrong?
let longstring = substitute('template','','\r','i') call writefile(['template'], l:new, '')
augroup templates execute "split" execute ":normal! A^I;" execute ":e!" . l:new augroup END
EDIT: This is the command that works: > execute ":normal! A^I;" I am using the UltiSnips, the word needs to be followed by the tab character to kick off the template.