No edit summary |
(Change to TipImported template + severe manual clean) |
||
Line 1: | Line 1: | ||
{{review}} |
{{review}} |
||
+ | {{TipImported |
||
− | {{Tip |
||
|id=1377 |
|id=1377 |
||
+ | |previous=1376 |
||
− | |title=Context sensitive access to MSDN help |
||
+ | |next=1378 |
||
− | |created=November 3, 2006 |
+ | |created=November 3, 2006 |
|complexity=basic |
|complexity=basic |
||
|author=gosaca |
|author=gosaca |
||
|version=n/a |
|version=n/a |
||
|rating=14/7 |
|rating=14/7 |
||
− | |text= |
||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | - navigates to google search |
||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
⚫ | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}} |
}} |
||
⚫ | |||
⚫ | |||
⚫ | |||
+ | <pre> |
||
− | > The space between "!" and "start" is needed to avoid a "command not found" error for a reason unknown to me. |
||
⚫ | |||
+ | </pre> |
||
⚫ | |||
− | Putting a space before start, sends the command to cmd.exe. |
||
⚫ | |||
− | Start is a cmd command, not a windows command. |
||
+ | *Navigates to Google search. |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | Samantha |
||
− | , November 8, 2006 17:36 |
||
− | ---- |
||
⚫ | |||
⚫ | |||
− | Something like . . . |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
+ | <pre> |
||
− | '''Anonymous''' |
||
⚫ | |||
− | , November 9, 2006 11:02 |
||
+ | </pre> |
||
− | ---- |
||
− | google search is better than msdn search. |
||
− | valentin.baciu--AT--gmail |
||
− | , November 9, 2006 11:13 |
||
---- |
---- |
||
⚫ | |||
− | |||
− | Re: not using msdn search directly: |
||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
− | |||
⚫ | |||
⚫ | |||
⚫ | |||
− | gosaca |
||
− | , November 10, 2006 6:56 |
||
---- |
---- |
||
− | <!-- parsed by vimtips.py in 0.546906 seconds--> |
Revision as of 03:45, 31 December 2007
created November 3, 2006 · complexity basic · author gosaca · version n/a
Access MSDN help for a specific keyword from gvim on Windows.
Add following to gvimrc:
nmap <F1> :silent ! start iexplore "[http://www.google.com/search?hl=en&btnI=I http://www.google.com/search?hl=en&btnI=I]\%27m+Feeling+Lucky&q=site\%3Amsdn.microsoft.com\%20<cWORD>"<CR>
This accomplishes the following:
- Starts a new instance of Internet Explorer.
- Navigates to Google search.
- Limits the search to site msdn.microsoft.com.
- Searches for the term under the cursor.
- Navigates the browser directly to the first page returned from the search.
For example, putting your cursor over WaitForSingleObject and hitting <F1> brings you directly to the documentation for that API on the MSDN site.
Use :set ch=2 to avoid the Hit Enter To Continue message.
The space between "!" and "start" is needed to avoid a "command not found" error. The space causes Vim to send the start command to the cmd.exe shell. Start is a cmd command, not a separate program.
Comments
Is there any reason that you don't search msdn directly? Something like:
nmap <F3> :silent !cmd /C start iexplore "[http://search.msdn.microsoft.com/search/default.aspx?query=<cWORD>"<CR> http://search.msdn.microsoft.com/search/default.aspx?query=<cWORD>"<CR>];
The msdn search brings you to a search results page, from which you must click on another link to get the desired documentation.
Using Google's I'm Feeling Lucky feature navigates you directly to the first page returned by the search, which more often than not is the page you want (since you have limited your search to the msdn.microsoft.com site).
This closely replicates the function of context sensitive help via F1 when working in MSDEV.
In addition, you can always change the site: filter in the search querystring to something other than msdn, if you aren't working on a win32 project.