I searched SO extensively and I can't get to fix this: I'm trying to code a pathogen friendly python plugin in windows. The setup would be:
In \vimfiles\bundle\plugin I have a myscript.vim with:
let s:path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
function! Up()
pyfile my_script.py
endfunction
command Up :call Up()
then in the same directory I have my_script.py:
import vim
vim.current.buffer.append("here I am")
This setup only works when/if I load myscript.vim in Vim and run :so %. I get an error 'No such file or directory my_script.py', but from then on the the script runs fine.
What i gather here is that the s:path line, wich sets the path for the python script call, in myscript.vim doesnt get processed when I call the function, but once the script is run I have that path available.
What I'm doing wrong, and how do I fix this? Ty all