VIMからURLを開いて検索するツールボックス
他のVIMプラグインと同じように。 Use pathogen, neobundle or vundle, or just unzip it inside your $HOME/.vim directory.
VIM-WWWでは、VIMからWebブラウザを起動して、任意のURL、定義されたお気に入り、検索エンジンの結果を開くことができます。
The web browser to be used is detected automatically, but it can be manually set through g:www_launch_browser_command , optionally using {{URL}}} as placeholder for the actual URL.例えば:
let g:www_launch_browser_command = "iceweasel {{URL}} &"
In the same way, an alternative CLI browser can be set through g:www_launch_cli_browser_command .作業するには、VIM-Dispatchアドオンをインストールする必要があります。その目的は、たとえば、tmuxペインでWebを開くか、NeovimとVim-Dispatch-Neovimが使用されている場合は仮想端末で開くことです。
:Wopen opens any given URL.例えば:
:Wopen http://vim.org
But typing and remembering full URLs is annoying, so custom favorites can be defined in g:www_urls dictionary.
So, having in vimrc ,
let g:www_urls = {
'vim' : 'http://www.vim.org',
}
次のコマンドは以前のコマンドと同じことを行います。
:Wopen vim
Also, in normal mode, <leader>wo launches the browser using WORD under cursor as URL.ビジュアルモードでは、同じことが実行されますが、現在のテキスト選択をURLとして使用します。
:Wcopen command and <leader>wco mappings do the same but using the CLI browser.
:Wsearch queries a search engine and opens the corresponding results page:
例えば:
:Wsearch google how to learn vim
Previous command opens the resulting page of searching how to learn vim in google.
次の検索エンジンはデフォルトで提供されます:
More search engines can be added through g:www_engines dictionary.クエリは、指定されたURLの最後に追加されます。例えば:
let g:www_engines = {
'youtube' : 'https://www.youtube.com/results?search_query=',
}
In normal mode, <leader>ws searches WORD under cursor, while the same mapping in visual mode searches current visual selection.どちらの場合も、ユーザーは使用する検索エンジンを選択するように求められます。 If none is given, duckduckgo is used, but this behaviour can be changed setting g:www_default_search_engine variable.例えば:
let g:www_default_search_engine = 'google'
:Wcsearch command and <leader>wcs mappings do the same but using the CLI browser.
Convenient shortcuts for commonly used search engines can be defined in g:www_shortcut_engines dictionary. Having in vimrc :
let g:www_engines = {
'ruby' : 'http://ruby-doc.com/search.html?q=',
}
let g:www_shortcut_engines = {
'ruby': ['Docruby', '<leader>dr', 'Doccliruby', '<leader>dcr']
}
automatically adds :Docruby / :Doccliruby commands, and <leader>dr / <leader>dcr mappings that work like :Wsearch / :Wcsearch and <leader>ws / <leader>wcs but using ruby straight away as search engine.
ユーザー定義のコマンドは、大文字で開始する必要があることを忘れないでください。
これは、APIドキュメントを参照するための迅速な方法として使用するのに非常に便利です。
Arbitrary URLs and favorites can be grouped together under a name in g:www_sessions dictionary and opened at once using :Wsession command.
Having in vimrc :
let g:www_urls = {
'vim' : 'http://www.vim.org',
}
let g:www_sessions = {
'dev' : ['vim', 'http://stackoverflow.com'],
}
ランニング:
:Wsession vim
would open http://www.vim.org and http://stackoverflow.com at once.
:Wcsession command does the same but using the CLI browser.
Type :help vim-www for a complete reference and information about configuration.
https://github.com/waiting-for-dev/vim-www/issuesでバグを開きます
git checkout -b my-new-feature )git commit -am 'Add some feature' )git push origin my-new-feature )VIM-WWWはセマンティックバージョンシステム2.0に従います。現在のバージョンは1.1.0です。
MITライセンスhttp://www.opensource.org/licenses/mit-license.php
Copyright(c)2014 MarcBusquéPérez
このソフトウェアと関連するドキュメントファイル(「ソフトウェア」)のコピーを入手して、制限なしにソフトウェアを扱うために、このソフトウェアを制限する権利を含め、ソフトウェアのコピーをコピー、変更、公開、配布、販売する、ソフトウェアのコピーを許可する人を許可する人を許可することを含めて、許可が無料で許可されます。
上記の著作権通知とこの許可通知は、ソフトウェアのすべてのコピーまたはかなりの部分に含まれるものとします。
このソフトウェアは、商品性、特定の目的への適合性、および非侵害の保証を含むがこれらに限定されない、明示的または黙示的なものを保証することなく、「現状のまま」提供されます。いかなる場合でも、著者または著作権所有者は、契約、不法行為、またはその他の訴訟、ソフトウェアまたはソフトウェアの使用またはその他の取引に関連する、またはその他の契約、またはその他の請求、またはその他の責任について責任を負いません。