Giter Club home page Giter Club logo

vim-search-web's Introduction

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.git

With 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+=-

Other Similar plugins

vim-search-web's People

Contributors

grenzionky avatar rajasegar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vim-search-web's Issues

some strings are not escaped

when i tried doing search in css properties and html meta tags it yieded errors:

  • searching for <meta name="viewport" content="width=device-width, initial-scale=1.0" /> yields ```xdg-open: unexpected argument 'initial-scale=1.0 />'
    Try 'xdg-open --help' for more information.

shell returned 1``` from the terminal (outside of vim)

  • searching for color: #222; yields Error detected while processing function OpenSearch: line 3: E194: No alternate file name to substitute for '#': !xdg-open "https://google.com/search?q= color: #222;" (from within vim)

i think some strings are not properly escaped. but otherwise this is a very convenient plugin. help plz.

btw i think a similar repo works slightly better: https://github.com/voldikss/vim-browser-search this searches for the meta tag but got rid of whatever that comes after '#' in the color line.

entering insert mode every time

hi, i'm on Ubuntu 18.04 using ultimate vimrc with vim 8.2.

ultimate vimrc provides shortcuts like <leader>ss for spell checking and it worked fine. however, when i type <leader>sg in normal mode when my cursor is on a word, it enters the insert mode and replaces the first character of the word with a g.

ulitmate vimrc seems to use pathogen and so i just placed vim-search-web under ~/.vim_runtime/my_plugins. this used to work on other machines but this time i just can't get it to work. help please.

[NEW SOURCE] Twitter

Add Twitter as a search source
Binding: [Leader]stw or it should be [Leader]st and change Thesaurus' binding to [Leader]sT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.