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 ENDThe s:deploy function basically does the copy operation.The frontEnd project has a bunch of directories with subdirectories for various JavaScript, CSS, and other files I want to be deployed.I've found that my autocmd works great when saving files after starting Vim like this:vim myProject/frontEnd/index.htmlThe autocmd also works when saving files after starting Vim like this:vim myProject/frontEnd/js/file.jsBut, 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()
BufWritePost not working after navigating using netrw
vimscript;autocmd;netrw
Your autocmd depends on vim being in the directory holding myProject; there are several options that could affect that. What does :echo g:netrw_keepdir show and what does :echo &acd show, for example. After navigating, what does :echo getcwd() show?