Wikia

Vim Tips Wiki

Changes: Use K to easily run a Windows program for the current word

Edit

Back to page

(Move categories to tip template)
(Remove html character entities)
 
Line 17: Line 17:
   
 
<pre>
 
<pre>
map K yiw:exec "silent !".&amp;kp." ".@0&lt;CR&gt;
+
map K yiw:exec "silent !".&kp." ".@0<CR>
 
</pre>
 
</pre>
   
Line 23: Line 23:
   
 
==Comments==
 
==Comments==
 
----
 

Latest revision as of 09:06, September 29, 2008

Tip 642 Printable Monobook Previous Next

created January 21, 2004 · complexity basic · author David Risner · version 6.0


To get the K command to open a Windows program without creating a command prompt window that needs to be closed, you can do the following:

In your vimrc add:

map K yiw:exec "silent !".&kp." ".@0<CR>

You can then set the keywordprg (abbreviated kp above) to the program you want to run.

CommentsEdit

Around Wikia's network

Random Wiki