howto: vimrc change part of file path and execute script
        Posted  
        
            by 
                posop
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by posop
        
        
        
        Published on 2012-10-10T19:18:03Z
        Indexed on 
            2012/10/11
            21:37 UTC
        
        
        Read the original article
        Hit count: 293
        
I would like to set up a command to execute launch the php script i am editing.
:echo expand('%:p:h')  yields:  C:\xampp\htdocs\my
my localhost path is C:\xampp\htdocs
i would like to cut the contents of local host off my current directory and append a file separator so i would have:
g:var = \my\
so the end goal would be to have something like this in my .vimrc (need help with the concatenate)
map <F5> :w<CR>:silent execute '!"c:\Program Files (x86)\Mozilla Firefox\firefox.exe"' "localhost . $var . %"<CR>
is this possible? or is there another way to do this?
© Stack Overflow or respective owner