I\'m using Twitvim for the first time. Seeing all the URLs in there made me wonder, is there any way to open the URL under the cursor in your favorite browser or a specified one
As described above by @kev, modified for Linux environments.
Aside: when this function was executed (Vim 8.1) in my terminal, the Vim screen was obfuscated (mostly "blanked;" i.e., the text was there but not visible). The :redraw!
command (see https://stackoverflow.com/a/1117742/1904943) redraws the screen.
Add to ~/.vimrc
:
nmap g :call Google():redraw!
fun! Google()
let keyword = expand("")
let url = "http://www.google.com/search?q=" . keyword
let path = "/usr/bin/"
exec 'silent !"' . path . 'firefox" ' . url
endfun