Ⅰ. 插件描述
A vim plugin to search for things in WebⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'rajasegar/vim-search-web'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'rajasegar/vim-search-web'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'rajasegar/vim-search-web'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/rajasegar/vim-search-web
Ⅳ. 文档说明
# vim-search-web
Search the web from your Vim editor
Install
Place in ~/.vim/plugin/vim-search-web.vim
For Pathogen
cd ~/.vim/bundle
git clone https://github.com/rajasegar/vim-search-web.gitWith Vundle
Add this to your plugins list in .vimrc
Plugin 'rajasegar/vim-search-web'Usage
Normal mode
Just place the cursor on any word about which you want to search and use
the key binding <Leader>sg.
That's all, now a separate browser window will open with your search results.
Visual mode
Just select any word about which you want to search and use
the key binding <Leader>sg.
Ex mode
You can specify the supported search engines as the first parameter and
then followed by the keyword.
:OpenSearch("Google", "hello world")Key Bindings
- [Leader]sdi => Dictionary Search
- [Leader]sd => DuckduckGo Search
- [Leader]sgi => Github Search
- [Leader]sg => Google Search
- [Leader]sn => npm Search
- [Leader]sr => reddit Search
- [Leader]ss => StackOverflow Search
- [Leader]st => Thesaurus Search
- [Leader]sw => Wikipedia Search
- [Leader]sy => Youtube Search
Configuration
There are just a few global variables (options) you may set in the .vimrc file.
g:vsw_open_command
Sets the command used to open the URL. In case of Ubuntu this would be
"xdg-open":
let g:vsw_open_command = "xdg-open"
FAQS
Not able to search keywords with '-' (hyphens)
This plugin is using CWORD so spaces and other special characters like hyphens are ignored.
So if you want to include hypens also in your search keywords, just add them(temporarily) to iskeyword.
:set iskeyword+=-