I'm trying to run tags upon file save. But I can't get the current buffers name inside the function, I need this after the write, since I want ctags to process the new amendments. Ideally I want to pass the . argument into the function from the autocmd
23 function! UpdateTagsIfHasTags()
24 echom "adsfsdf"
25 return
26 let tagsPath = printf('%s/tags', expand("%:h"))
27 if !empty(glob(tagsPath))
28 system(printf('/usr/local/bin/phpctags %s', filepath))
29 endif
30 endfunction
31 augroup tags
32 autocmd!
33 autocmd BufEnter *.tex silent! !start /min ctags *.tex
34 autocmd BufEnter *.php :call UpdateTagsIfHasTags()
35 augroup END
How can I pass the current file path to the function?