<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>蓝色的华 &#187; vim</title>
	<atom:link href="http://bluehua.org/tag/vim/feed" rel="self" type="application/rss+xml" />
	<link>http://bluehua.org</link>
	<description>分享所学,backup一切~</description>
	<lastBuildDate>Fri, 27 Aug 2010 08:41:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>用好vim的外部过滤器</title>
		<link>http://bluehua.org/2010/08/16/1430.html</link>
		<comments>http://bluehua.org/2010/08/16/1430.html#comments</comments>
		<pubDate>Mon, 16 Aug 2010 08:26:47 +0000</pubDate>
		<dc:creator>小鹿</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://bluehua.org/2010/08/16/1430.html</guid>
		<description><![CDATA[明知有此功能却不知道利用，以前要在命令行转完再贴过来。。


&#8212;&#8212;&#8212;&#8211;
post by gmail~
]]></description>
			<content:encoded><![CDATA[<p>明知有此功能却不知道利用，以前要在命令行转完再贴过来。。</p>
<p><img src="http://bluehua.org/wp-content/uploads/2010/08/screenshot_084.png" alt="screenshot_084.png" title="screenshot_084.png"/></p>
<p><img src="http://bluehua.org/wp-content/uploads/2010/08/screenshot_085.png" alt="screenshot_085.png" title="screenshot_085.png"/></p>
<p>&#8212;&#8212;&#8212;&#8211;<br />
post by gmail~</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/08/16/1430.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>vim里快速调试PHP</title>
		<link>http://bluehua.org/2010/07/28/1407.html</link>
		<comments>http://bluehua.org/2010/07/28/1407.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 13:10:18 +0000</pubDate>
		<dc:creator>小鹿</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://bluehua.org/2010/07/28/1407.html</guid>
		<description><![CDATA[恩，python中一般会把调试代码跟普通代码混在一块

class xx:
#    .....
if __name__ == '__main__':
    testxx = xx&#40;&#41;
    #测试代码....

这个__name__ == &#8216;__main__&#8217;判断此文件是否被直接执行，而不是被其他文件import,所以在vim中调试时可以直接输入:!python % 执行当前正在编辑的文件,调试代码便会执行并输出结果
php也可以这么加调试代码,php中是这么实现的

class xx &#123;
// ......
&#125;
//确定当前被执行的文件就是自己,而不是被其他php文件包含
if &#40;realpath&#40;$_SERVER&#91;'SCRIPT_FILENAME'&#93;&#41; == __FILE__&#41;
&#123;
    $testxx = new xx;
    //测试代码....
&#125;

如果仅限在命令行运行测试代码就再加个条件

if &#40;php_sapi_name&#40;&#41; == 'cli' &#38;&#38; realpath&#40;$_SERVER&#91;'SCRIPT_FILENAME'&#93;&#41; == __FILE__&#41;

为了更速度，vim配置里添加了一个快捷键F5

&#34;php和python调试快捷键
au FileType php map &#60;F5&#62; :call DebugRun&#40;'php'&#41;&#60;cr&#62;
au FileType php [...]]]></description>
			<content:encoded><![CDATA[<p>恩，python中一般会把调试代码跟普通代码混在一块</p>

<div class="wp_syntax"><div class="code overflow"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> xx:
<span style="color: #808080; font-style: italic;">#    .....</span>
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">'__main__'</span>:
    testxx = xx<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;">#测试代码....</span></pre></div></div>

<p>这个__name__ == &#8216;__main__&#8217;判断此文件是否被直接执行，而不是被其他文件import,所以在vim中调试时可以直接输入:!python % 执行当前正在编辑的文件,调试代码便会执行并输出结果</p>
<p>php也可以这么加调试代码,php中是这么实现的</p>

<div class="wp_syntax"><div class="code overflow"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> xx <span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// ......</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//确定当前被执行的文件就是自己,而不是被其他php文件包含</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">realpath</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$testxx</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> xx<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//测试代码....</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>如果仅限在命令行运行测试代码就再加个条件</p>

<div class="wp_syntax"><div class="code overflow"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">php_sapi_name</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'cli'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">realpath</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SCRIPT_FILENAME'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>为了更速度，vim配置里添加了一个快捷键F5</p>

<div class="wp_syntax"><div class="code overflow"><pre class="vim" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">&quot;php和python调试快捷键</span>
au FileType php <span style="color: #25BB4D;">map</span> <span style="color: #000000;">&lt;</span>F5<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span><span style="color: #804040;">call</span> DebugRun<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'php'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
au FileType php imap <span style="color: #000000;">&lt;</span>F5<span style="color: #000000;">&gt;</span> <span style="color: #000000;">&lt;</span>Esc<span style="color: #000000;">&gt;:</span><span style="color: #804040;">call</span> DebugRun<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'php'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
au FileType python <span style="color: #25BB4D;">map</span> <span style="color: #000000;">&lt;</span>F5<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span><span style="color: #804040;">call</span> DebugRun<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'python'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
au FileType python imap <span style="color: #000000;">&lt;</span>F5<span style="color: #000000;">&gt;</span> <span style="color: #000000;">&lt;</span>Esc<span style="color: #000000;">&gt;:</span><span style="color: #804040;">call</span> DebugRun<span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">'python'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&lt;</span>cr<span style="color: #000000;">&gt;</span>
<span style="color: #804040;">function</span> DebugRun<span style="color: #000000;">&#40;</span>cmd<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">:</span>w
    <span style="color: #804040;">execute</span> <span style="color: #C5A22D;">'!'</span> <span style="color: #000000;">.</span> a<span style="color: #000000;">:</span>cmd <span style="color: #000000;">.</span> <span style="color: #C5A22D;">' %'</span>
endfunction</pre></div></div>

<p>OK,写完调试代码按下F5立刻有结果。</p>
<p>&#8212;&#8212;&#8212;&#8211;<br />
post by gmail~</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/07/28/1407.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ubuntu上flex开发相关</title>
		<link>http://bluehua.org/2010/04/21/1135.html</link>
		<comments>http://bluehua.org/2010/04/21/1135.html#comments</comments>
		<pubDate>Wed, 21 Apr 2010 15:04:25 +0000</pubDate>
		<dc:creator>小鹿</dc:creator>
				<category><![CDATA[web dev]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=1135</guid>
		<description><![CDATA[最近项目需要用到flex, 于是我要学这个本不打算学的东西&#8230;
我的环境很简单 flex sdk 4.0 + vim
sdk的安装参考 : http://blog.minidx.com/2008/05/17/853.html
flex的Makefile参考 : http://www.mindlence.com/WP/?p=301
编写好Makefile之后,就可以在vim里通过:make命令编译当前项目
vim的as和mxml语法高亮: http://www.fireyang.com/blog/?p=115
最后是我自己加的自动补全的字典(从flex4的文档里扣出来的&#8230;.)

&#34;将字典文件放到相应的目录就可以了,这里是~/.vim/as3_dict.txt
au FileType actionscript call AddAS3Dict&#40;&#41;
function AddAS3Dict&#40;&#41;
    set dictionary-=~/.vim/as3_dict.txt dictionary+=~/.vim/as3_dict.txt
    set complete-=k complete+=k
endfunction

字典文件下载 : as3_dict
这个字典有9K多行,应该够用了&#8230;

初学的一点感觉:
虽然actionscript3已经远离了js的语法,但仍然是事件驱动的,所以对熟悉js开发的同学来说,flex很容易上手. 另一点感受是我再也不用考虑狗屁浏览器兼容性了..
最最后最近阅文档无数的终极结果,我的第一个flex半成品 :　http://bluehua.org/demo/avatar-editor/
]]></description>
			<content:encoded><![CDATA[<p>最近项目需要用到flex, 于是我要学这个本不打算学的东西&#8230;</p>
<p>我的环境很简单 flex sdk 4.0 + vim</p>
<p>sdk的安装参考 : <a href="http://blog.minidx.com/2008/05/17/853.html">http://blog.minidx.com/2008/05/17/853.html</a></p>
<p>flex的Makefile参考 : <a href="http://www.mindlence.com/WP/?p=301">http://www.mindlence.com/WP/?p=301</a></p>
<p>编写好Makefile之后,就可以在vim里通过:make命令编译当前项目</p>
<p>vim的as和mxml语法高亮: <a href="http://www.fireyang.com/blog/?p=115">http://www.fireyang.com/blog/?p=115</a></p>
<p>最后是我自己加的自动补全的字典(从flex4的文档里扣出来的&#8230;.)</p>

<div class="wp_syntax"><div class="code overflow"><pre class="vim" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;">&quot;将字典文件放到相应的目录就可以了,这里是~/.vim/as3_dict.txt</span>
au FileType actionscript <span style="color: #804040;">call</span> AddAS3Dict<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #804040;">function</span> AddAS3Dict<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    set dictionary<span style="color: #000000;">-</span>=<span style="color: #000000;">~/.</span>vim<span style="color: #000000;">/</span>as3_dict<span style="color: #000000;">.</span>txt dictionary<span style="color: #000000;">+</span>=<span style="color: #000000;">~/.</span>vim<span style="color: #000000;">/</span>as3_dict<span style="color: #000000;">.</span>txt
    set complete<span style="color: #000000;">-</span>=k <span style="color: #25BB4D;">complete</span><span style="color: #000000;">+</span>=k
endfunction</pre></div></div>

<p>字典文件下载 : <a href='http://bluehua.org/wp-content/uploads/2010/04/as3_dict.zip'>as3_dict</a><br />
这个字典有9K多行,应该够用了&#8230;<br />
<a href="http://bluehua.org/wp-content/uploads/2010/04/screenshot_062.png"><img src="http://bluehua.org/wp-content/uploads/2010/04/screenshot_062.png" alt="" title="screenshot_062" width="444" height="378" class="alignnone size-full wp-image-1139" /></a></p>
<p>初学的一点感觉:<br />
虽然actionscript3已经远离了js的语法,但仍然是事件驱动的,所以对熟悉js开发的同学来说,flex很容易上手. 另一点感受是我再也不用考虑狗屁浏览器兼容性了..</p>
<p>最最后最近阅文档无数的终极结果,我的第一个flex半成品 :　<a href="http://bluehua.org/demo/avatar-editor/">http://bluehua.org/demo/avatar-editor/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2010/04/21/1135.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>懒人工具之:自动刷新firefox，解放ctrl+f5</title>
		<link>http://bluehua.org/2009/04/03/257.html</link>
		<comments>http://bluehua.org/2009/04/03/257.html#comments</comments>
		<pubDate>Fri, 03 Apr 2009 08:48:03 +0000</pubDate>
		<dc:creator>小鹿</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=257</guid>
		<description><![CDATA[y，自从用了vim，该让机器做的都让机器做了。。
这个东东的原理是这样滴，firefox安装一个插件，起作用的就下面几行

var file = Components.classes&#91;&#34;@mozilla.org/file/local;1&#34;&#93;.createInstance&#40;Components.interfaces.nsILocalFile&#41;;
file.initWithPath&#40;&#34;/tmp/refresh.firefox&#34;&#41;;
//浏览器开启时启动一个定时器
var timer = setInterval&#40;function&#40;&#41;
&#123;
    //每隔0.1秒检测一下这个文件存在否 
    if &#40; file.exists&#40;&#41; &#41;
    &#123;
        //如果存在，删除之
        file.remove&#40;true&#41;;
        //获取当前标签的文档对象
        var [...]]]></description>
			<content:encoded><![CDATA[<p>y，自从用了vim，该让机器做的都让机器做了。。</p>
<p>这个东东的原理是这样滴，firefox安装一个插件，起作用的就下面几行</p>

<div class="wp_syntax"><div class="code overflow"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> file <span style="color: #339933;">=</span> Components.<span style="color: #660066;">classes</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;@mozilla.org/file/local;1&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">createInstance</span><span style="color: #009900;">&#40;</span>Components.<span style="color: #660066;">interfaces</span>.<span style="color: #660066;">nsILocalFile</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
file.<span style="color: #660066;">initWithPath</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;/tmp/refresh.firefox&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">//浏览器开启时启动一个定时器</span>
<span style="color: #003366; font-weight: bold;">var</span> timer <span style="color: #339933;">=</span> setInterval<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">//每隔0.1秒检测一下这个文件存在否 </span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> file.<span style="color: #660066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//如果存在，删除之</span>
        file.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//获取当前标签的文档对象</span>
        <span style="color: #003366; font-weight: bold;">var</span> doc <span style="color: #339933;">=</span> gBrowser.<span style="color: #660066;">selectedBrowser</span>.<span style="color: #660066;">contentDocument</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//是否是在调试的东东</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/(xiaonei\.com|kaixin\.com)/</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span> doc.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">//如果是，调用dnsFluher，刷新host，如果没有安装此插件就算了</span>
            dnsFluher.<span style="color: #660066;">refreshdns</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #006600; font-style: italic;">//刷新页面</span>
            doc.<span style="color: #660066;">location</span>.<span style="color: #660066;">reload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">100</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>所以，只要在/tmp/目录生成一个refresh.firefox的文件，firefox便会刷新了</p>
<p>vim 里添加一行配置文件</p>

<div class="wp_syntax"><div class="code overflow"><pre class="text" style="font-family:monospace;">&quot;更改host文件时刷新
autocmd BufWritePost,FileWritePost /etc/hosts execute '!echo '' &gt; /tmp/refresh.firefox'
&quot;更改调试文件时刷新
autocmd BufWritePost,FileWritePost */jspro/*.js execute '!echo '' &gt; /tmp/refresh.firefox'</pre></div></div>

<p>插件附上，根据情况自行修改。。</p>
<p><a href='http://bluehua.org/wp-content/uploads/2009/04/autorefresh.zip'>autorefresh1.0</a></p>
<p>扩展名改成xpi拖到firefox就可以安装了</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/04/03/257.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>vim:上一个光标位置</title>
		<link>http://bluehua.org/2009/01/09/192.html</link>
		<comments>http://bluehua.org/2009/01/09/192.html#comments</comments>
		<pubDate>Fri, 09 Jan 2009 05:32:30 +0000</pubDate>
		<dc:creator>小鹿</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=192</guid>
		<description><![CDATA[额,搜啊搜没结果,还是看文档自己搞
ctrl + alt + left 上一个光标位置
ctrl + alt + right 下一个光标位置
刚写完,bug未知

&#160;
&#34;上一个光标位置
command -nargs=0 GotoPreviousPos :call GotoPreviousPos()
&#160;
function GotoPreviousPos()
    if exists( &#34;b:blue_previous_pos&#34; ) &#38;&#38; len( b:blue_previous_pos ) &#62; 1 &#38;&#38; b:blue_current_pos &#62;= 0
        let b:blue_current_pos = b:blue_current_pos - 1
        call setpos( [...]]]></description>
			<content:encoded><![CDATA[<p>额,搜啊搜没结果,还是看文档自己搞</p>
<p>ctrl + alt + left 上一个光标位置<br />
ctrl + alt + right 下一个光标位置</p>
<p>刚写完,bug未知</p>

<div class="wp_syntax"><div class="code overflow"><pre class="text" style="font-family:monospace;">&nbsp;
&quot;上一个光标位置
command -nargs=0 GotoPreviousPos :call GotoPreviousPos()
&nbsp;
function GotoPreviousPos()
    if exists( &quot;b:blue_previous_pos&quot; ) &amp;&amp; len( b:blue_previous_pos ) &gt; 1 &amp;&amp; b:blue_current_pos &gt;= 0
        let b:blue_current_pos = b:blue_current_pos - 1
        call setpos( &quot;.&quot; , b:blue_previous_pos[ b:blue_current_pos ] )
    endif
endfunction
&nbsp;
&quot;下一个光标位置
&nbsp;
command -nargs=0 GotoNextPos :call GotoNextPos()
&nbsp;
function GotoNextPos()
    if exists( &quot;b:blue_previous_pos&quot; ) &amp;&amp; len( b:blue_previous_pos ) &gt; b:blue_current_pos + 1
        let b:blue_current_pos = b:blue_current_pos + 1
        call setpos( &quot;.&quot; , b:blue_previous_pos[ b:blue_current_pos ] )
    endif
endfunction
&nbsp;
&quot;记录光标位置
&nbsp;
function RecordPreviousPos()
&nbsp;
    let s:pos =  getpos(&quot;.&quot;)
&nbsp;
    if !exists( &quot;b:blue_previous_pos&quot; )
       let b:blue_previous_pos = []
       let b:blue_current_pos = 0
    endif
&nbsp;
    if ( len( b:blue_previous_pos ) &gt; 500 )
        unlet b:blue_previous_pos[0]
    endif
&nbsp;
    if len( b:blue_previous_pos ) &gt; 0 &amp;&amp; b:blue_current_pos != len( b:blue_previous_pos ) - 1
        call remove( b:blue_previous_pos , -1 )
    endif
&nbsp;
    call add( b:blue_previous_pos , s:pos )
    let b:blue_current_pos = len( b:blue_previous_pos ) - 1
&nbsp;
endfunction
&nbsp;
autocmd CursorMovedI * call RecordPreviousPos()
&nbsp;
:imap &lt;C-A-Left&gt; &lt;Esc&gt;:GotoPreviousPos&lt;CR&gt;i
:imap &lt;C-A-Right&gt; &lt;Esc&gt;:GotoNextPos&lt;CR&gt;i
:map &lt;C-A-Left&gt; :GotoPreviousPos&lt;CR&gt;
:map &lt;C-A-Right&gt; :GotoNextPos&lt;CR&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2009/01/09/192.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>换用vim</title>
		<link>http://bluehua.org/2008/12/23/165.html</link>
		<comments>http://bluehua.org/2008/12/23/165.html#comments</comments>
		<pubDate>Tue, 23 Dec 2008 11:52:16 +0000</pubDate>
		<dc:creator>小鹿</dc:creator>
				<category><![CDATA[soft]]></category>
		<category><![CDATA[web dev]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://bluehua.org/?p=165</guid>
		<description><![CDATA[在aptana崩溃了几次之后,偶决定换个稳定又容易上手的编辑器-vim
嗯嗯,用了两天,感觉灰常强大,绝对是懒人利器~
加了几个简单的自定义命令:
快速TortoiseSVN命令

&#34;使用这几个快捷命令的前提是win的环境变量的path包含了TortoiseSVN的bin目录
&#160;
&#34;diff
command -nargs=0 Svndiff :call Svndiff()
function Svndiff()
   silent execute '!TortoiseProc.exe /command:diff /path:' . expand('%:p')
endfunction
&#160;
&#34;commit
command -nargs=1 Svncommit :call Svncommit(&#60;f-args&#62;)
function Svncommit(msg)
   silent execute '!TortoiseProc.exe /command:commit /path:' . expand('%:p') . ' /logmsg:' . iconv(a:msg, &#38;enc, &#34;chinese&#34;)
endfunction
&#160;
&#34;update
command -nargs=0 Svnupdate :call Svnupdate()
function Svnupdate()
   silent execute '!TortoiseProc.exe /command:update /path:' . expand('%:p')
endfunction
&#160;
command -nargs=0 Svnlog :call Svnlog()
function Svnlog()
 [...]]]></description>
			<content:encoded><![CDATA[<p>在aptana崩溃了几次之后,偶决定换个稳定又容易上手的编辑器-vim</p>
<p>嗯嗯,用了两天,感觉灰常强大<img class="xemotion" src="http://bluehua.org/wp-content/plugins/x-emotions/emotions/char/icon_lol.gif" border="0" alt="" />,绝对是懒人利器~</p>
<p>加了几个简单的自定义命令:</p>
<p>快速TortoiseSVN命令</p>

<div class="wp_syntax"><div class="code overflow"><pre class="text" style="font-family:monospace;">&quot;使用这几个快捷命令的前提是win的环境变量的path包含了TortoiseSVN的bin目录
&nbsp;
&quot;diff
command -nargs=0 Svndiff :call Svndiff()
function Svndiff()
   silent execute '!TortoiseProc.exe /command:diff /path:' . expand('%:p')
endfunction
&nbsp;
&quot;commit
command -nargs=1 Svncommit :call Svncommit(&lt;f-args&gt;)
function Svncommit(msg)
   silent execute '!TortoiseProc.exe /command:commit /path:' . expand('%:p') . ' /logmsg:' . iconv(a:msg, &amp;enc, &quot;chinese&quot;)
endfunction
&nbsp;
&quot;update
command -nargs=0 Svnupdate :call Svnupdate()
function Svnupdate()
   silent execute '!TortoiseProc.exe /command:update /path:' . expand('%:p')
endfunction
&nbsp;
command -nargs=0 Svnlog :call Svnlog()
function Svnlog()
   silent execute '!TortoiseProc.exe /command:log /path:' . expand('%:p')
endfunction</pre></div></div>

<p>由于编辑的文件一般都在同一个目录,所以加了一个速得函数</p>

<div class="wp_syntax"><div class="code overflow"><pre class="text" style="font-family:monospace;">command -nargs=1 Get :call Get(&lt;f-args&gt;)
function Get(f)
   exe ':tabnew d:\xxxx\xxx\xxx\' . a:f
endfunction</pre></div></div>

<p>恩,继续学习</p>
]]></content:encoded>
			<wfw:commentRss>http://bluehua.org/2008/12/23/165.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.590 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-07 11:17:48 -->
