<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using an external editor in Thunderbird under Mac OS X</title>
	<atom:link href="http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/</link>
	<description>Welcome to Mark Wheadon&#039;s blog; I hope you find it useful. Feel free to comment on anything you read here.</description>
	<lastBuildDate>Sun, 29 Jan 2012 22:26:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Richard</title>
		<link>http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/comment-page-1/#comment-1115</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Sun, 14 Aug 2011 16:50:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwheadon.com/blog/?p=40#comment-1115</guid>
		<description>## Solution to OS X / Thunderbird slow load times ##

- Download MacVim : http://code.google.com/p/macvim/ 
	: Move everything to the directory to /Applications/

- Download Thunderbird External Editor 
	: http://globs.org/articles.php?pg=2&amp;lng=en

- In Thunderbird install `External Editor`

- Edit the preferences to `External Editor` 
		Editor = /Applications/mvim --servername email --remote-wait

- Using Automator, create a new `Workflow`
	
	: Select `Run Shell Script` : For a script enter the two lines : 
		1 open /Applications/mvim --servername email &amp; 
		2 open /Applications/Thunderbird.app 
	: Save -&gt; File Format : Application : 

You now have a built application that&#039;ll run Thunderbird, with a background
	VIM process.

- CMD + E to load a VIM instance</description>
		<content:encoded><![CDATA[<p>## Solution to OS X / Thunderbird slow load times ##</p>
<p>- Download MacVim : <a href="http://code.google.com/p/macvim/" rel="nofollow">http://code.google.com/p/macvim/</a><br />
	: Move everything to the directory to /Applications/</p>
<p>- Download Thunderbird External Editor<br />
	: <a href="http://globs.org/articles.php?pg=2&#038;lng=en" rel="nofollow">http://globs.org/articles.php?pg=2&#038;lng=en</a></p>
<p>- In Thunderbird install `External Editor`</p>
<p>- Edit the preferences to `External Editor`<br />
		Editor = /Applications/mvim &#8211;servername email &#8211;remote-wait</p>
<p>- Using Automator, create a new `Workflow`</p>
<p>	: Select `Run Shell Script` : For a script enter the two lines :<br />
		1 open /Applications/mvim &#8211;servername email &amp;<br />
		2 open /Applications/Thunderbird.app<br />
	: Save -&gt; File Format : Application : </p>
<p>You now have a built application that&#8217;ll run Thunderbird, with a background<br />
	VIM process.</p>
<p>- CMD + E to load a VIM instance</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom K</title>
		<link>http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/comment-page-1/#comment-1059</link>
		<dc:creator>Tom K</dc:creator>
		<pubDate>Thu, 30 Dec 2010 19:11:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwheadon.com/blog/?p=40#comment-1059</guid>
		<description>Thanks for this post; it got me on the right track.

I would suggest, though, that it is easier to not use either the open command in the shell script nor a shell script at all.  You can evoke MacVim directly from the command line.  Here is what I am using in the text editor field.

/Applications/MacVim.app/Contents/MacOS/Vim -g -f &#039;+/^-=-/+1&#039;


The open command was causing more then a 30 second delay for me when I evoked the shell script.  The direct call to the executable takes about 1 second. 

The arguments are the same as from a real unix environment: -g to use the GUI, and -f to not fork into the background (the same reason for adding the -W in the shell script).  The last argument &#039;+/^-=-/+1&#039; starts me at the first blank line after the headers.  

Lastly, if the macvim app name has spaces in it, you should rename it so it does not have spaces.  Spaces in the name makes it harder for the unix command line to find the executable.</description>
		<content:encoded><![CDATA[<p>Thanks for this post; it got me on the right track.</p>
<p>I would suggest, though, that it is easier to not use either the open command in the shell script nor a shell script at all.  You can evoke MacVim directly from the command line.  Here is what I am using in the text editor field.</p>
<p>/Applications/MacVim.app/Contents/MacOS/Vim -g -f &#8216;+/^-=-/+1&#8242;</p>
<p>The open command was causing more then a 30 second delay for me when I evoked the shell script.  The direct call to the executable takes about 1 second. </p>
<p>The arguments are the same as from a real unix environment: -g to use the GUI, and -f to not fork into the background (the same reason for adding the -W in the shell script).  The last argument &#8216;+/^-=-/+1&#8242; starts me at the first blank line after the headers.  </p>
<p>Lastly, if the macvim app name has spaces in it, you should rename it so it does not have spaces.  Spaces in the name makes it harder for the unix command line to find the executable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Francisco Beron-Vera</title>
		<link>http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/comment-page-1/#comment-1000</link>
		<dc:creator>Francisco Beron-Vera</dc:creator>
		<pubDate>Mon, 25 Jan 2010 20:14:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwheadon.com/blog/?p=40#comment-1000</guid>
		<description>Hi Mark,

Your solution works provided that the &quot;Launch Vim processes in a login shell&quot; option is not selected. But Vim-Latex, which I use frequently, needs that option selected in order to work. Any idea as of how to get it to work with this option selected?

Thank you in advance.

Best regards,
Francisco</description>
		<content:encoded><![CDATA[<p>Hi Mark,</p>
<p>Your solution works provided that the &#8220;Launch Vim processes in a login shell&#8221; option is not selected. But Vim-Latex, which I use frequently, needs that option selected in order to work. Any idea as of how to get it to work with this option selected?</p>
<p>Thank you in advance.</p>
<p>Best regards,<br />
Francisco</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Wheadon</title>
		<link>http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/comment-page-1/#comment-983</link>
		<dc:creator>Mark Wheadon</dc:creator>
		<pubDate>Fri, 21 Aug 2009 21:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwheadon.com/blog/?p=40#comment-983</guid>
		<description>Hi Ben -- I can see that&#039;s a problem for you and others who use macvim a fair bit.

Here&#039;s a work-around. It&#039;s dirty (very dirty) but I think it&#039;ll prove reliable. Replace your dovim script with the following -- best use cut and paste as there&#039;s some subtle quoting in there (and best hold your nose whilst doing so :-):

Cheers,

Mark

&lt;code&gt;
#!/bin/sh

open -a macvim &quot;$@&quot;
sleep 3 # be sure Vim has started
pid=`/bin/ps -A &#124; awk &#039;/\/Vim/ &amp;&amp; $NF == &quot;&#039;&quot;/private$@&quot;&#039;&quot; {print $1}&#039;`
while kill -0 $pid 2&gt; /dev/null; do
	sleep 1
done
exit 0
&lt;/code&gt;

Note that the code that starts with pid= and ends with print $1 is all one long line (this should happen anyway if you cut and paste).</description>
		<content:encoded><![CDATA[<p>Hi Ben &#8212; I can see that&#8217;s a problem for you and others who use macvim a fair bit.</p>
<p>Here&#8217;s a work-around. It&#8217;s dirty (very dirty) but I think it&#8217;ll prove reliable. Replace your dovim script with the following &#8212; best use cut and paste as there&#8217;s some subtle quoting in there (and best hold your nose whilst doing so <img src='http://www.markwheadon.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> :</p>
<p>Cheers,</p>
<p>Mark</p>
<p><code><br />
#!/bin/sh</p>
<p>open -a macvim "$@"<br />
sleep 3 # be sure Vim has started<br />
pid=`/bin/ps -A | awk '/\/Vim/ &#038;&#038; $NF == "'"/private$@"'" {print $1}'`<br />
while kill -0 $pid 2> /dev/null; do<br />
	sleep 1<br />
done<br />
exit 0<br />
</code></p>
<p>Note that the code that starts with pid= and ends with print $1 is all one long line (this should happen anyway if you cut and paste).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://www.markwheadon.com/blog/2009/01/using-an-external-editor-in-thunderbird-under-mac-os-x/comment-page-1/#comment-980</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Thu, 20 Aug 2009 16:46:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.markwheadon.com/blog/?p=40#comment-980</guid>
		<description>Thanks for the tip, however this doesn&#039;t work for me for a very good reason! I frequently have multiple instances of macvim running with 5-10 tabs open in each instance. I also write emails all day long. 

This method requires me to close all of my macvim instances just to send an email! This is much less convenient than simply composing in macvim, and then pasting into TB.

Any ideas around this?</description>
		<content:encoded><![CDATA[<p>Thanks for the tip, however this doesn&#8217;t work for me for a very good reason! I frequently have multiple instances of macvim running with 5-10 tabs open in each instance. I also write emails all day long. </p>
<p>This method requires me to close all of my macvim instances just to send an email! This is much less convenient than simply composing in macvim, and then pasting into TB.</p>
<p>Any ideas around this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

