I'm trying to deploy some static content upon
writeing a buffer with an autocmd:
augroup dep autocmd! autocmd BufWritePost myProject/frontEnd/** :call s:deploy() augroup END
s:deploy function basically does the copy operation.
I've found that my autocmd works great when saving files after starting Vim like this:
The autocmd also works when saving files after starting Vim like this:
But, when the autocmd does not execute when I start out at the above
index.html and then use netrw to navigate to
file.js. It's like the navigating kills the autocmd.
Any ideas on what is happening here?
EDIT for future Googlers:
The solution I was looking for (that @user21497's answer helped me realize) was to use a pre-pending wildcard in my autocmd:
autocmd BufWritePost */myProject/frontEnd/** :call s:deploy()