On 12 December 2014, Joydeep Chakrabarty <chalao.a...@gmail.com> wrote:
> Thanks David,
> It finally worked. I used -
> 
> nmap <F2> :w<CR>:exec "!firefox " .  substitute(expand('%:p'),"\/home\/
> username\/public_html","http\:\/\/localhost","")<CR>
> 
> Thanks again.
> BTW, is there any way I can run this in background? Everytime I press
> F2, firefox opens and I cannot use vim until I close firefox. So I
> need to call this in background and I can edit in vim. Next time I
> press F2, another tab in firefox will be opened.

    Since you're on Linux: replace firefox above with a script that
looks like this:

        #! /bin/sh
        PATH=/usr/local/bin:/bin/usr/bin
        firefox -newtab "$@" || firefox "$@" &

    /lcd

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_use+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to