Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Created July 1, 2010 22:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszkorecki/460659 to your computer and use it in GitHub Desktop.
Save lukaszkorecki/460659 to your computer and use it in GitHub Desktop.
" Stick it somewhere (.vimrc?)
" Works with Gvim and Macvim
" Windows users should go back to their IE6
" Usage:
" :Maps Birmingham,UK
function! s:Maps(search)
let search = a:search
let p1 = "http://maps.google.com/maps/api/staticmap?center="
let p2 = "&zoom=13&size=400x400&maptype=roadmap&sensor=true&format=png"
let url = p1.search.p2
if has('gui')
if has('gui_gnome')
let cmd = "xdg-open"
elseif has('gui_macvim')
let cmd = "qlmanage -p"
elseif has('gui_win32')
" WTF?
endif
endif
execute ' ! curl -L "'.url.'" > map | '.cmd.' map'
endfunction
command! -bar -nargs=* Maps call s:Maps("<args>")
@ravicious
Copy link

"Windows users should go back to their IE6"

ballmer

@lukaszkorecki
Copy link
Author

"exactly!"

Bram Moolenaar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment