I'm trying to pass a command to 'vim-tmux-runner' on each file save with
autocmd FileWritePost,BufWritePost *.py :VtrSendCommandToRunner python manage.py test <afile>:p:h:t
:VtrSendCommandToRunnersends a command to shell in another tmux pane
python manage.py testis the actual command being sent to shell
<afile>:p:h:tand at the end of the command I add a variable that should be expanded to the name of the folder that my file was just saved in.
On each save my shell command tells me that there is no such file as
<afile>:p:h:t so as I understand vim did not expand those variables.
Before I added
:VtrSendCommandToRunner (originally my Ex command started with
:!) my Ex command was expanded correctly.
I tried to rewrite that Ex command in couple other ways but I can't get anything to work.
Some versions of Ex command that I tried(all failed me):
<afile>:p:h:t %:p:h:t expand(%:p:h:t)
How can I get vim to expand
% to a file name then?