Ⅰ. 插件描述
:cyclone: Perform a quick web search for the text selected in (Neo)VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'clouduan/vim-searchme'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'clouduan/vim-searchme'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'clouduan/vim-searchme'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/clouduan/vim-searchme
Ⅳ. 文档说明
# vim-browser-search
This plugin helps perform a quick web search for the text selected in (Neo)Vim
Installation
Plug 'voldikss/vim-browser-search'Keymappings
This plugin doesn't supply any default mappings. Here are some recommended key mappings
nmap <silent> <Leader>s <Plug>SearchNormal
vmap <silent> <Leader>s <Plug>SearchVisualUse cases
- Select text and type
<Leader>sto do a web search - Type
<Leader>sawin to search web for a word - Type
<Leader>sa(to search web for the text wrapped in the bracket - Type
<Leader>sasto search web for a sentence - ...
Variables
g:browser_search_default_engine
Defaut: 'google'
g:browser_search_engines
Defaut:
{
\ 'google':'https://google.com/search?q=%s',
\ 'github':'https://github.com/search?q=%s',
\ 'stackoverflow':'https://stackoverflow.com/search?q=%s',
\ 'bing': 'https://www.bing.com/search?q=%s',
\ 'duckduckgo': 'https://duckduckgo.com/?q=%s',
\ 'wikipedia': 'https://en.wikipedia.org/wiki/%s',
\ 'youtube':'https://www.youtube.com/results?search_query=%s&page=&utm_source=opensearch',
\ 'baidu':'https://www.baidu.com/s?ie=UTF-8&wd=%s'
\ }Commands
:Search {engine} {text}
Search text with engine
:SearchCurrentText [engine]
Search the text under the cursor with engine, if no engine, use g:browser_search_default_engine
:SearchVisualText [engine]
Search the selected text with engine, if no engine, use g:browser_search_default_engine