sponsor Vim development Vim logo Vim Book Ad

open-browser.vim : Open URI with your favorite browser from your favorite editor

 script karma  Rating 22/7, Downloaded by 1181    Comments, bugs, improvements  Vim wiki

created by
tyru
 
script type
utility
 
description

SYNOPSIS

" This is my setting.
let g:netrw_nogx = 1 " disable netrw's gx mapping.
nmap gx <Plug>(openbrowser-smart-search)
vmap gx <Plug>(openbrowser-smart-search)


" Open URI under cursor.
nmap map-you-like <Plug>(openbrowser-open)
" Open selected URI.
vmap map-you-like <Plug>(openbrowser-open)

" Search word under cursor.
nmap map-you-like <Plug>(openbrowser-search)
" Search selected word. vmap map-you-like <Plug>(openbrowser-search)

" If it looks like URI, Open URI under cursor.
" Otherwise, Search word under cursor.
nmap map-you-like <Plug>(openbrowser-smart-search)
" If it looks like URI, Open selected URI.
" Otherwise, Search selected word.
vmap map-you-like <Plug>(openbrowser-smart-search)

" In command-line
:OpenBrowser http://google.com/
:OpenBrowserSearch ggrks
:OpenBrowserSmartSearch http://google.com/
:OpenBrowserSmartSearch ggrks


ENVIRONMENTS

We have tested on these environments.
- Ubuntu 9.10 GNOME
- Windows XP
- Cygwin
- Mac OS X

Thanks for testing:
- mfumi (Mac OS X)
- iicebar (Windows XP)

LATEST VERSION
http://github.com/tyru/open-browser.vim
 
install details
unzip zip file, and move them to ~/.vim or ~/vimfiles (Windows).
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
openbrowser.zip 0.0.7 2011-12-01 7.0 tyru - Support some search engines (alphabetically)
  Most search engines were suggested by stardiviner, thanks!
  - Ask Ubuntu
  - Baidu
  - Blekko
  - CPAN (search.cpan.org)
  - DuckDuckGo
  - GitHub
  - Google Code (en)
  - PHP (www.php.net)
  - Python (docs.python.org)
  - SPACE ALC
  - Twitter Search
  - Twitter (user)
  - VeryCD
  - Wikipedia (en)
  - vim.org
- Fix bug: command-line completion did not return all matched search engines,
  it returned only first matched search engine.
- Fix bug: if the key contains "-" in g:openbrowser_search_engines,
  it does not work.
- Change s:expand_keyword() syntax. It recognizes only {vim expression}.
  (see :help openbrowser-option-syntax for details)
  - Change default value of g:openbrowser_open_rules
  - Change default value of g:openbrowser_search_engines
openbrowser.zip 0.0.6a 2011-11-27 7.0 tyru - Allow b:option, w:option, t:option not only g:option.
- Fix Mac OS X environment detection.
  (Thanks Chomo for the report. and sorry to forget including your name in 0.0.6 changelog. I've uploaded again.)
- Fix the problem that open-browser.vim does not work on cygwin.
  (Thanks toooooooby for the patch. and sorry to forget including your name in 0.0.6 changelog. I've uploaded again.)
openbrowser.zip 0.0.5 2011-06-30 7.0 tyru (NOTE: Next release will break some backward compatibility, maybe)
- Document fix/improvement
- Add :command-completion to :OpenBrowserSmartSearch.
- :OpenBrowserSmartSearch: allow {search-engine} option
  like :OpenBrowserSearch
- Minor bug fixes
openbrowser.zip 0.0.4 2011-06-21 7.0 tyru - Improve |:OpenBrowserSearch| completion
- Add <Plug>(openbrowser-search)
- Add <Plug>(openbrowser-smart-search)
- Merge Daniel Hahler's branch. thanks!
- Spawn a browser in background
  - This fixes freezing when spawning a browser
- Change |g:openbrowser_fix_schemes| default value
  - Add pair: "ttps" => "https"
- etc.
openbrowser.zip 0.0.3 2011-03-09 7.0 tyru - Implement g:openbrowser_default_search.
- Implement g:openbrowser_search_engines.
- Implement g:openbrowser_open_filepath_in_vim.
- Implement g:openbrowser_open_vim_command.
- Separate plugin/openbrowser.vim to autoload/openbrowser.vim to save the memory.
- Bundle urilib.vim (autoload/urilib.vim)
- Fix bug: openbrowser should open URI which has no scheme
  (e.g.: example.com)
openbrowser.zip 0.0.2 2010-06-28 7.0 tyru - Rename |g:openbrowser_isfname| to |g:openbrowser_iskeyword|.
variable |g:openbrowser_isfname| is still available for
backward compatibility.
- Specialize |g:openbrowser_iskeyword| value to get URI in <cword>.
- More readable messages.
openbrowser.zip 0.0.1 2010-06-27 7.0 tyru - Support opening file path.
- Fix minor bugs.
openbrowser.zip 0.0.0 2010-06-26 7.0 tyru Initial upload
ip used for rating: 23.22.59.252

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo