Vim Tips Wiki
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 13:52
+
|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=
 
 
 
Access MSDN help for a specific keyword from gVim on Windows.
 
 
 
 
Solution: 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 IE
 
 
- navigates to google search
 
 
- limits search to the site msdn.microsoft.com
 
 
- searches for the term under the cursor
 
 
- Navigates the browser directly to the first page returned from the search.
 
 
 
 
Thus, putting your cursor over WaitForSingleObject and hitting <F1> brings you directly to the documentation for that API on the MSDN site.
 
 
 
 
:set ch=2 avoids the Hit Enter To Continue message.
 
 
 
 
The space between "!" and "start" is needed to avoid a "command not found" error for a reason unknown to me.
 
 
 
 
 
 
 
 
 
 
}}
 
}}
 
Access MSDN help for a specific keyword from gvim on Windows.
   
 
Add following to gvimrc:
== Comments ==
 
  +
<pre>
&gt; The space between "!" and "start" is needed to avoid a "command not found" error for a reason unknown to me.
 
 
nmap &lt;F1&gt; :silent ! start iexplore "[http://www.google.com/search?hl=en&btnI=I http://www.google.com/search?hl=en&amp;btnI=I]\%27m+Feeling+Lucky&amp;q=site\%3Amsdn.microsoft.com\%20&lt;cWORD&gt;"&lt;CR&gt;
  +
</pre>
   
 
This accomplishes the following:
Putting a space before start, sends the command to cmd.exe.
 
 
*Starts a new instance of Internet Explorer.
Start is a cmd command, not a windows command.
 
  +
*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 &lt;F1&gt; brings you directly to the documentation for that API on the MSDN site.
Samantha
 
, November 8, 2006 17:36
 
----
 
Is there any reason that you don't search msdn directly?
 
   
 
Use <tt>:set ch=2</tt> to avoid the Hit Enter To Continue message.
Something like . . .
 
   
 
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. <tt>Start</tt> is a cmd command, not a separate program.
nmap &lt;F3&gt; :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=&lt;cWORD&gt;"&lt;CR&gt;];
 
   
 
==Comments==
 
Is there any reason that you don't search msdn directly? Something like:
   
  +
<pre>
'''Anonymous'''
 
 
nmap &lt;F3&gt; :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=&lt;cWORD&gt;"&lt;CR&gt;];
, November 9, 2006 11:02
 
  +
</pre>
----
 
google search is better than msdn search.
 
   
valentin.baciu--AT--gmail
 
, November 9, 2006 11:13
 
 
----
 
----
 
The msdn search brings you to a search results page, from which you must click on another link to get the desired documentation.
 
Re: not using msdn search directly:
 
 
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.
 
 
   
 
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.
   
gosaca
 
, November 10, 2006 6:56
 
 
----
 
----
<!-- parsed by vimtips.py in 0.546906 seconds-->
 

Revision as of 03:45, 31 December 2007

Tip 1377 Printable Monobook Previous Next

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.