Error detected on BufWritePost Autocommands for "*.vim" : drive not recognized with expand('%:p')

64 views
Skip to first unread message

Ni Va

unread,
Feb 21, 2020, 3:46:47 AM2/21/20
to vim_use
Hi,

Using gvim 8.2.292 on windows, following error appears while I am saving a vim file.
It seems to mistake good drive. C: out of  D:

expand('%:p') returns bad drive.

Error detected while processing BufWritePost Autocommands for "*.vim":
E484: Can't open file c:\logiciels\Vim\vimfiles\plugged\foo-bar\autoload\foobar.vim


 autocmd! BufWritePost  *.vim    exe 'source '.expand('%:p')





Ni Va

unread,
Feb 21, 2020, 4:00:39 AM2/21/20
to vim_use
A change dir command has been made before BufWritePost..

How to make expand('%:p') of a file not impacted by a :cd change dir command ?
Reply all
Reply to author
Forward
0 new messages