I have been trying the https://github.com/ngemily/vim-vp4 plugin for integrating Perforce version control commands into Vim.
The Vp4Diff
command fails for me. I tracked it down to a step where a system(cmd)
function was being called when cmd = "p4 fstat-T headrev <filename>#have"
.
The problem is actually not caused by Perforce. I find that any cmd containing a #
character will fail.
:call system('touch #this')
...but I get an error:
E484: Can't open file /tmp/vx0yoZZ/1
I'm using Vim 8.2.1001. This happens for both tcsh shell and bash. It also happens when running vim --clean
.
I'm disapointed the error message wasn't "U Can't Touch #This"
#
indicates a comment in the shell (where that is running). You can quote it...system("touch '#this'")
...which will prevent its interpretation as a comment char.system('touch \#this')
.