I am attempting to create a vimrc function that will be used in an autocmd. The function must simply call a python script and pass the file name as an argument.
.vimrc
fu! Test(filename)
let filename = expand("%:t")
"echom filename
!test.py filename
example.py
#!usr/bin/python
import sys
print sys.argv[1]
If I uncomment the echo line, example.py is echo'd correctly. If I try to execute as it is displayed above, however, the string filename is passed literally.
Is there any way around this?