I want to execute a bash script whenever I save a file in Vim. The problem is I don't how can I, or if it's possible to pass the full path to the file, rather than just the file name, or relative path that was opened.
This is the code I'm using, it works, however only relative paths, which is useless to me.
autocmd BufWritePost * !~/.config/nvim/scripts/on_save.sh <afile>
Is there any way to pass the full file path to the bash script?
I found it:
autocmd BufWritePost * !~/.config/nvim/scripts/on_save.sh %:p
The %:p does it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With