All Projects → szw → Vim G

szw / Vim G

Quick Google lookup directly from Vim

Labels

Projects that are alternatives of or similar to Vim G

Textobjectify
TextObjectify is a Vim plugin which improves text-objects
Stars: ✭ 98 (-8.41%)
Mutual labels:  viml
Vim Hybrid
A dark color scheme for Vim
Stars: ✭ 1,380 (+1189.72%)
Mutual labels:  viml
Hermes
An environment for Ruby and JS developers in Darwin
Stars: ✭ 105 (-1.87%)
Mutual labels:  viml
Vimperator Colors
colorsheme
Stars: ✭ 99 (-7.48%)
Mutual labels:  viml
Vimrc
My vim files (i'm a n00b, don't use these)
Stars: ✭ 100 (-6.54%)
Mutual labels:  viml
Tasklist.vim
Eclipse like task list
Stars: ✭ 102 (-4.67%)
Mutual labels:  viml
Preto
A minimal dark theme for VIM.
Stars: ✭ 97 (-9.35%)
Mutual labels:  viml
Seti.vim
Stars: ✭ 107 (+0%)
Mutual labels:  viml
Browser Connect.vim
Live browser interaction for VIM.
Stars: ✭ 101 (-5.61%)
Mutual labels:  viml
Securemodelines
A secure alternative to Vim modelines
Stars: ✭ 104 (-2.8%)
Mutual labels:  viml
Vim Follow My Lead
Vim plugin for showing all your <Leader> mappings in a readable table including the descriptions.
Stars: ✭ 100 (-6.54%)
Mutual labels:  viml
Vim Togglelist
Functions to toggle the [Location List] and the [Quickfix List] windows.
Stars: ✭ 100 (-6.54%)
Mutual labels:  viml
Argtextobj.vim
Text-object like motion for arguments
Stars: ✭ 103 (-3.74%)
Mutual labels:  viml
Elixir.nvim
Vim Completion/Doc/Eval for Elixir (nvim), compile https://github.com/awetzel/neovim-elixir and https://github.com/awetzel/nvim-rplugin
Stars: ✭ 99 (-7.48%)
Mutual labels:  viml
Vim I18n
Vim plugin to easily add I18n translations to your Rails project
Stars: ✭ 106 (-0.93%)
Mutual labels:  viml
Vim Ruby Minitest
Vim highlighting & completion for MiniTest
Stars: ✭ 97 (-9.35%)
Mutual labels:  viml
Vim Luna
Touchdown on Lunar Surface ! :)
Stars: ✭ 102 (-4.67%)
Mutual labels:  viml
Vim Colorscheme Switcher
Makes it easy to quickly switch between color schemes in Vim
Stars: ✭ 107 (+0%)
Mutual labels:  viml
Bufexplorer.zip
Buffer Explorer / Browser
Stars: ✭ 106 (-0.93%)
Mutual labels:  viml
Vim Slack
Slack for Vim client
Stars: ✭ 104 (-2.8%)
Mutual labels:  viml

vim-g

vim-g is a tiny plugin that allows you to perform a quick Google search directly from Vim. It opens a new browser window with results. vim-g uses Perl for url encoding.

Installation

Place in ~/.vim/plugin/g.vim or in case of Pathogen:

cd ~/.vim/bundle
git clone https://github.com/szw/vim-g.git

Please, don't forget to star the repository if you like (and use) the plugin. This will let me know how many users it has and then how to proceed with further development :).

Usage

To lookup a word (or words) in Google use Google command:

:Google hello
:Google start up

Google command can use a word under the cursor. Just move the cursor to the word and type the same command in the command line:

:Google

Additionally, you can select words in the visual mode exactly in the same way. Just select words and type :Google. You can also prepend your selection with more clues:

:Google function
:Google ruby

There is also a special command named Gf to prepend the current file type automatically:

:Googlef
:Googlef strpos
:Googlef function

Moreover, you can use double quotes (") to perform phrase search. Just enclose some words between quotation marks as you type. Also, you don't have to close manually open quotation marks. vim-g will add the missing one itself.

Examples:

:Google "foo bar"
:Googlef " help substitute
:Google foo bar " something else

What's even more interesting this also works in the visual mode. Therefore, you can perform a strict phrase search on selected words. Just select words and type:

:Google "
:Google "foo bar

Configuration

There are just a few global variables (options) you may set in the .vimrc file.

  • g:vim_g_open_command

    Sets the command used to open the URL. In case of Ubuntu this would be "xdg-open":

      let g:vim_g_open_command = "xdg-open"
    
  • g:vim_g_perl_command

    Sets the Perl command. By default it's "perl":

      let g:vim_g_perl_command = "perl"
    
  • g:vim_g_query_url

    Sets the query URL. By default it points to Google of course, but you might want to place your favorite search engine there:

      let g:vim_g_query_url = "http://google.com/search?q="
    
  • g:vim_g_command

    Sets the command mapping for vim-g. By default this is Google, but you may want to prefix it to something shorter such as :G or :Go

      let g:vim_g_command = "Go"
    
  • g:vim_g_f_command

    Sets the command mapping for vim-g's file search function. By default this is Googlef, but you may want to prefix it to something shorter such as :Gf

      let g:vim_g_f_command = "Gf"
    

License

Copyright © 2012 Szymon Wrozynski and Contributors. Distributed under the same terms as Vim itself.

See :help license

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].