Seamless web search - lose less focus
90% of the time I switch context away from Vim, it’s to load Chrome to search for something. In order to make this as seamless as possible, I’ve added a function to my .vimrc which brings up a prompt where I can enter my search terms, hit enter and it launches Chrome and searches the search engine of my choice with the entered text.
I should note - this is for Chrome on OS X, however, it could be adapted to work on other platforms and with other browsers.
1 2 3 4 5 6 7
The above code maps
alt + g to bring up the prompt, hitting enter then launches a Google search in Chrome. You needn’t restrict yourself to just searching Google either - for DuckDuckGo you can replace
https://duckduckgo.com/?q= or for Blekko you can use
You can check out my full .vimrc on GitHub.