<?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>Hacklog &#187; Vim</title>
	<atom:link href="http://ihacklog.com/cat/internet_software/powerfulvim/feed" rel="self" type="application/rss+xml" />
	<link>http://ihacklog.com</link>
	<description>荒野无灯weblog</description>
	<lastBuildDate>Sat, 04 Feb 2012 12:30:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>实现Vim tags自动更新</title>
		<link>http://ihacklog.com/software/powerfulvim/vim-tags-auto-update.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/vim-tags-auto-update.html#comments</comments>
		<pubDate>Sun, 08 Jan 2012 02:46:45 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=5305</guid>
		<description><![CDATA[这里要用到两个插件： projtags.vim : Set tags file for per project AutoTag : Updates entries in a tags file automatically when saving 这两个插件单独工作都不能满足我的要求，但是他们合起来使用却是非常方便。 projtags.vim用于给项目配置tags文件，如配置项目路径为 /path-to-proj ,那么，当文件在 /path-to-proj及其子目录时，tags选项此时被局部地设置为了/p...]]></description>
			<content:encoded><![CDATA[<p>这里要用到两个插件：<br />
projtags.vim : Set tags file for per project<br />
AutoTag : Updates entries in a tags file automatically when saving</p>
<p>这两个插件单独工作都不能满足我的要求，但是他们合起来使用却是非常方便。<br />
projtags.vim用于给项目配置tags文件，如配置项目路径为 /path-to-proj ,那么，当文件在 /path-to-proj及其子目录时，tags选项此时被局部地设置为了/path-to-proj/tags ，这样，即使是在子目录，tags选项的配置也能工作。<br />
现在还有一个问题是tags自动更新的问题了。总不能每添加一个新文件就手动运行一下命令吧？而且，ctags的-a选项(append)并不会自动删除已经不存在的tag,此时，autotag.vim华丽登场～～，它能搞定这一切。</p>
<p>不过直接把这两个插件扔plugin目录是不会达到上述效果的，得稍做一些修改。<br />
AutoTag.vim 作者的安装指导是要你直接在.vimrc里面source它。<br />
这里我把它修改一下，然后放到~/.vim/plugin目录，给出补丁吧：</p>
<div class="codecolorer-container diff default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="">&#91;</span>admin@huangye plugin<span style="">&#93;</span>$ diff -urNB ~/document/vim/plugins/autotag.vim autotag.vim <br />
<span style="color: #888822;">--- /home/admin/document/vim/plugins/autotag.vim&nbsp; &nbsp; 2012-01-06 16:50:37.912729822 +0800</span><br />
<span style="color: #888822;">+++ autotag.vim 2012-01-08 10:43:21.423301599 +0800</span><br />
<span style="color: #440088;">@@ -87,7 +87,7 @@</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;while file:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; file = os.path.dirname<span style="">&#40;</span>file<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #self.__diag<span style="">&#40;</span>'drive = &quot;%s&quot;, file = &quot;%s&quot;' % <span style="">&#40;</span>drive, file<span style="">&#41;</span><span style="">&#41;</span><br />
<span style="color: #991111;">- &nbsp; &nbsp; &nbsp; &nbsp; tagsFile = os.path.join<span style="">&#40;</span>drive, file, self.tags_file<span style="">&#41;</span></span><br />
<span style="color: #00b000;">+ &nbsp; &nbsp; &nbsp; &nbsp; tagsFile = self.tags_file</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #self.__diag<span style="">&#40;</span>'tagsFile &quot;%s&quot;' % tagsFile<span style="">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if os.path.isfile<span style="">&#40;</span>tagsFile<span style="">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;st = os.stat<span style="">&#40;</span>tagsFile<span style="">&#41;</span><br />
<span style="color: #440088;">@@ -184,7 +184,7 @@</span><br />
&nbsp; &nbsp; let g:autotagDisabled=<span style="">0</span><br />
&nbsp;endif<br />
&nbsp;if !exists<span style="">&#40;</span>&quot;g:autotagVerbosityLevel&quot;<span style="">&#41;</span><br />
<span style="color: #991111;">- &nbsp; let g:autotagVerbosityLevel=0</span><br />
<span style="color: #00b000;">+ &nbsp; let g:autotagVerbosityLevel=2</span><br />
&nbsp;endif<br />
&nbsp;if !exists<span style="">&#40;</span>&quot;g:autotagExcludeSuffixes&quot;<span style="">&#41;</span><br />
&nbsp; &nbsp; let g:autotagExcludeSuffixes=&quot;tml.xml.text.txt&quot;</div></td></tr></tbody></table></div>
<p>projtags.vim的话，在</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #804040;">execute</span> <span style="color: #C5A22D;">'autocmd BufEnter '</span> <span style="color: #000000;">.</span> filepattern <span style="color: #000000;">.</span> <span style="color: #C5A22D;">' :setlocal tags+='</span> <span style="color: #000000;">.</span> tagfile</div></td></tr></tbody></table></div>
<p>前面加上一句：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>autotagTagsFile=tagfile</div></td></tr></tbody></table></div>
<p>,然后把其内容直接加到.vimrc里面即可。因为这里要让projtags.vim优先运行以告知autotag.vim tags文件的位置。<br />
<strong>还有要注意的一点是，在给projtags.vim配置项目路径时，要写绝对路径，不能写 $HOME或 ~ ，不然autotag.vim不能更新tags.</strong></p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">:</span>scriptnames</div></td></tr></tbody></table></div>
<p>命令会列出你加载的插件列表，按加载顺序排列。不用总结哪个目录的插件先加载了，直接运行这条命令就好，一目了然。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=5305";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=5305" title="Permanent Link to 实现Vim tags自动更新" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=5305</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2008年12月19日  //  <a href="http://ihacklog.com/php/framework/%e5%9b%bd%e5%86%85php%e4%b8%ad%e6%b5%81%e8%a1%8c%e7%9a%84%e6%a1%86%e6%9e%b6.html" title="国内php中流行的框架">国内php中流行的框架</a> (0)</li><li>2009年05月29日  //  <a href="http://ihacklog.com/php/original/wptitleicon.html" title="WP Title Icon">WP Title Icon</a> (13)</li><li>2011年12月19日  //  <a href="http://ihacklog.com/memory/hacklog/csdn-was-hacked.html" title="童鞋，CSDN被黑了，速度改密码去">童鞋，CSDN被黑了，速度改密码去</a> (8)</li><li>2011年12月4日  //  <a href="http://ihacklog.com/software/development-tool/emeditor-color-scheme-keywords-what-the-fuck.html" title="令人蛋疼的EmEditor配色问题">令人蛋疼的EmEditor配色问题</a> (3)</li><li>2011年11月14日  //  <a href="http://ihacklog.com/server/ubuntu-server/how-to-setup-linux-pptp-vpn-server.html" title="linux pptp链路vpn简单配置">linux pptp链路vpn简单配置</a> (4)</li><li>2008年02月22日  //  <a href="http://ihacklog.com/php/skills/%e4%bd%bf%e7%94%a8%e4%ba%94%e7%a7%8d%e4%bb%a5%e4%b8%8a%e6%96%b9%e5%bc%8f%e8%8e%b7%e5%8f%96%e4%b8%80%e4%b8%aa%e6%96%87%e4%bb%b6%e7%9a%84%e6%89%a9%e5%b1%95%e5%90%8d.html" title="使用五种以上方式获取一个文件的扩展名">使用五种以上方式获取一个文件的扩展名</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/vim-tags-auto-update.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自制vim php manual</title>
		<link>http://ihacklog.com/software/powerfulvim/self-made-vim-php-manual.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/self-made-vim-php-manual.html#comments</comments>
		<pubDate>Sat, 07 Jan 2012 06:42:23 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=5298</guid>
		<description><![CDATA[安装 XML Parser PEAR 1sudo pear install XML_Parser 下载parser脚本 1wget http://blog.planetxml.de/uploads/source/php/phpdoc/parser2.php.txt -Oparser2.php 这个parser对目前的php版本来说，有些地方已经不适应了，我在Gasol patch版的基础上修改了一下。 从php.net docs repo中checkout出文档源码： 1svn co http://svn...]]></description>
			<content:encoded><![CDATA[<p>安装 <a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fpear.php.net%2Fpackage%2FXML_Parser%2F" target="_blank">XML Parser</a> PEAR</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pear <span style="color: #c20cb9; font-weight: bold;">install</span> XML_Parser</div></td></tr></tbody></table></div>
<p>下载parser脚本</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>blog.planetxml.de<span style="color: #000000; font-weight: bold;">/</span>uploads<span style="color: #000000; font-weight: bold;">/</span>source<span style="color: #000000; font-weight: bold;">/</span>php<span style="color: #000000; font-weight: bold;">/</span>phpdoc<span style="color: #000000; font-weight: bold;">/</span>parser2.php.txt -Oparser2.php</div></td></tr></tbody></table></div>
<p>这个parser对目前的php版本来说，有些地方已经不适应了，我在Gasol patch版的基础上修改了一下。</p>
<p>从php.net docs repo中checkout出文档源码：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svn co</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.php.net<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>phpdoc<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>doc-en phpdoc</div></td></tr></tbody></table></div>
<p>生成doc</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">php parser2<span style="color: #339933;">.</span>php</div></td></tr></tbody></table></div>
注意：该页面嵌入了下载文件，请访问 <a href="http://ihacklog.com/software/powerfulvim/self-made-vim-php-manual.html">该页面</a>下载该文件。
<p>注意：该页面嵌入了下载文件，请访问 <a href="http://ihacklog.com/software/powerfulvim/self-made-vim-php-manual.html">该页面</a>下载该文件。<br />
使用方法见我以前的文章<a href="http://ihacklog.com/software/powerfulvim/php-manual-for-vim.html" target="_blank">《PHP Manual for Vim》</a></p>
<hr />
<p>另外一个修改版的parser下载：<br />
<a href="http://ihacklog.com/l.php?url=https%3A%2F%2Fdocs.google.com%2Fleaf%3Fid%3D0B0ORe5N7_r_hOTM4MGEzZTEtMDU5OS00OTc0LWFmOTQtNDkzYTMxZTE4YjU0%26hl%3Den" target="_blank">https://docs.google.com/leaf?id=0B0ORe5N7_r_hOTM4MGEzZTEtMDU5OS00OTc0LWFmOTQtNDkzYTMxZTE4YjU0&#038;hl=en</a><br />
这个parser使用方法：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svn co</span> http:<span style="color: #000000; font-weight: bold;">//</span>svn.php.net<span style="color: #000000; font-weight: bold;">/</span>repository<span style="color: #000000; font-weight: bold;">/</span>phpdoc<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>doc-en phpdoc<br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;reference&quot;</span> <span style="color: #660033;">-print</span> <span style="color: #000000; font-weight: bold;">&gt;</span> references.txt<br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.ent&quot;</span> <span style="color: #660033;">-print</span> <span style="color: #000000; font-weight: bold;">&gt;</span> ent.txt<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> out <br />
php parser.php<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/*</span>.txt ~<span style="color: #000000; font-weight: bold;">/</span>.vim<span style="color: #000000; font-weight: bold;">/</span>doc</div></td></tr></tbody></table></div>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #804040;">filetype</span> <span style="color: #25BB4D;">plugin</span> <span style="color: #25BB4D;">on</span><br />
<span style="color: #804040;">au</span> <span style="color: #25BB4D;">FileType</span> php <span style="color: #804040;">set</span> <span style="color: #668080;">keywordprg</span>=<span style="color: #000000;">:</span>help</div></td></tr></tbody></table></div>
<hr />
另外，根据Gasol提示：</p>
<blockquote><p>有用pathogen的話要把pathogen#helptags()拿掉，它會自動執行helptags把tags檔覆蓋過去，我個人是用pathogen擺在$HOME/.vim/bundle/phpdoc/doc底下，接著在.vimrc加上一行autocmd BufNewFile,BufRead *.php set keywordprg=”help”就大功告成了！</p></blockquote>
<p>由于我没有用pathogen,所以，不知道放在~/.vim/phpdoc/doc目录是否会自动覆盖。基于小心的原则，还是把这段话放在这里。毕竟Gasol的博客在墙外。</p>
<p>参考文档：<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fblog.planetxml.de%2Farchives%2F16-PHP-Manual-in-VIM-einbinden.html" target="_blank">http://blog.planetxml.de/archives/16-PHP-Manual-in-VIM-einbinden.html</a><br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fblog.gasol.tw%2F2011%2F05%2Fphp-manual-in-vim.html" target="_blank">http://blog.gasol.tw/2011/05/php-manual-in-vim.html</a><br />
<a href="http://ihacklog.com/l.php?url=https%3A%2F%2Fgist.github.com%2F993468" target="_blank">https://gist.github.com/993468</a><br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fwww.fumbling-in-the-dark.com%2F2011%2F03%2Fviewing-php-manual-in-vim.html" target="_blank">http://www.fumbling-in-the-dark.com/2011/03/viewing-php-manual-in-vim.html</a><br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fvim.wikia.com%2Fwiki%2FPHP_manual_in_Vim_help_format" target="_blank">http://vim.wikia.com/wiki/PHP_manual_in_Vim_help_format</a></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=5298";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=5298" title="Permanent Link to 自制vim php manual" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=5298</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2008年12月29日  //  <a href="http://ihacklog.com/memory/%e6%84%9f%e5%8a%a8%ef%bc%81%e8%be%9b%e9%85%b8%e7%9a%84%e6%84%9f%e5%8a%a8%ef%bc%81.html" title="感动！辛酸的感动！">感动！辛酸的感动！</a> (0)</li><li>2010年03月1日  //  <a href="http://ihacklog.com/php/wordpress/problems/strange-403-forbidden-error.html" title="更换空间后奇怪的403 Forbidden错误">更换空间后奇怪的403 Forbidden错误</a> (7)</li><li>2012年01月8日  //  <a href="http://ihacklog.com/memory/hacklog/blog-pending.html" title="年终了，丢两张图&#8230;&#8230;">年终了，丢两张图&#8230;&#8230;</a> (5)</li><li>2009年08月14日  //  <a href="http://ihacklog.com/linux/ubuntu-desktop/ubuntuqiyong3dxiaoguohouchuxiancuowu.html" title="UBUNTU启用3d效果后出现错误">UBUNTU启用3d效果后出现错误</a> (1)</li><li>2011年11月25日  //  <a href="http://ihacklog.com/php/wordpress/upgrade/wordpress-multisite-setup.html" title="wordpress多用户站点配置">wordpress多用户站点配置</a> (1)</li><li>2008年12月25日  //  <a href="http://ihacklog.com/php/skills/discuz%e4%b8%ad%e7%9a%84%e5%88%86%e9%a1%b5%e5%87%bd%e6%95%b0.html" title="Discuz中的分页函数">Discuz中的分页函数</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/self-made-vim-php-manual.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpcomplete.vim 比官方版功能强大的全能补全插件</title>
		<link>http://ihacklog.com/software/powerfulvim/phpcomplete-vim-php-omnicomplete-with-extra-support.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/phpcomplete-vim-php-omnicomplete-with-extra-support.html#comments</comments>
		<pubDate>Sat, 07 Jan 2012 02:55:57 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=5297</guid>
		<description><![CDATA[官方自带的全能补全默认vim脚本文件是 /usr/share/vim/vim73/autoload/phpcomplete.vim 经试用，官方的搜索很费时间并且不准确。 还好找到了这个修改版的 phpcomplete.vim Default phpcomplete.vim does not support in-file checking of $var = new Class; so if you don&#8217;t have a tags file with the variable in it...]]></description>
			<content:encoded><![CDATA[<p>官方自带的全能补全默认vim脚本文件是 /usr/share/vim/vim73/autoload/phpcomplete.vim </p>
<p>经试用，官方的搜索很费时间并且不准确。<br />
还好找到了这个修改版的<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fwww.vim.org%2Fscripts%2Fscript.php%3Fscript_id%3D3171" target="_blank"> phpcomplete.vim</a></p>
<blockquote><p>
Default phpcomplete.vim does not support in-file checking of $var = new Class; so if you don&#8217;t have a tags file with the variable in it already you have to hack around it by placing the comment /* @var $yourvar YourClass */ above the line which is really kludgy. </p>
<p>This patch allows for in-file checking so you don&#8217;t need the comment. </p>
<p>$instance = new Class;<br />
&#8230;<br />
$instance->Blah(); // <-- complete without comment </p>
<p>It also allows support for singleton instantiations: </p>
<p>$instance = Class::getInstance();<br />
$instance->completeMe(); // sweet completion </p>
<p>=== Usage ===<br />
// example class which has a TAGS file generated for it somewhere<br />
class SomeClass {<br />
  private function _private_method() {} // never shows up in completion list<br />
  public static function staticMethod() {} // only shows up when using completion on SomeClass::<C-X><C-O><br />
  public function completeMe() {} // only shows up when using completion on $instance_of_someclass-><C-X><C-O><br />
} </p>
<p>== Non-static completion ==<br />
$instance = new SomeClass;<br />
&#8230;<br />
$instance-><C-X><C-O> to display the omnicompletion menu (see :help ins-completion)<br />
$instance->completeMe(); // will autoselect completeMe since it&#8217;s the only public non-static method </p>
<p>== Static completion ==<br />
SomeClass::<C-X><C-O> to display omnicompletion menu<br />
SomeClass::staticMethod(); // once again will autoselect staticMethod since it&#8217;s the only public static method </p>
<p>== Singleton completion ==<br />
$instance = SomeClass::getInstance();<br />
$instance-><C-X><C-O> complete just like non-static </p>
<p>=== Other features ===<br />
 * Correct restriction of static or standard methods based on context ( show only static methods with :: and only standard with ->)<br />
 * Real support for self:: and $this-> with the aforementioned context restriction<br />
 * Constant variable completion (not just define(VARIABLE, 1) but const VARIABLE = 1) </p>
<p>Follow updates: </p>
<p>http://github.com/shawncplus/phpcomplete.vim</p>
<p>install details<br />
Place in $HOME/.vim/autoload/phpcomplete.vim and enable the php ftplugin
</p></blockquote>
<p>另外还有一种<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F1224838%2Fvim-php-omni-completion%2F2316468%232316468" target="_blank">添加注释的方式</a>让vim识别，不过这种方式还是没有上面的全能补全插件爽：</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #666666; font-style: italic;">/* @var $myVar myClass */</span><br />
<span style="color: #000088;">$myVar</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> myClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$myVar</span><span style="color: #339933;">-&gt;</span></div></td></tr></tbody></table></div>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=5297";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=5297" title="Permanent Link to phpcomplete.vim 比官方版功能强大的全能补全插件" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=5297</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2010年09月6日  //  <a href="http://ihacklog.com/software/cool_software_share/qq-exmail.html" title="QQ企业邮箱试用">QQ企业邮箱试用</a> (17)</li><li>2011年05月25日  //  <a href="http://ihacklog.com/software/glx-dock-cairo-dock-a-perfect-dock-for-linux.html" title="Glx-Dock (Cairo-Dock)——界面超酷的dock for Linux">Glx-Dock (Cairo-Dock)——界面超酷的dock for Linux</a> (3)</li><li>2011年07月22日  //  <a href="http://ihacklog.com/software/tips/bring-windows-classic-theme-back.html" title="DIY windows经典界面，图标更加清爽——神器Reshacker">DIY windows经典界面，图标更加清爽——神器Reshacker</a> (10)</li><li>2010年06月4日  //  <a href="http://ihacklog.com/programming/c/simple-yueli.html" title="简单的月历程序">简单的月历程序</a> (5)</li><li>2011年05月27日  //  <a href="http://ihacklog.com/software/zend-studio-8-0-1-released.html" title="Zend Studio 8.0.1发布">Zend Studio 8.0.1发布</a> (3)</li><li>2010年04月14日  //  <a href="http://ihacklog.com/php/wordpress/theme/google-page-rank-updated-to-4-and-my-new-theme-ascii.html" title="PR更新到4了，换了个新主题">PR更新到4了，换了个新主题</a> (21)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/phpcomplete-vim-php-omnicomplete-with-extra-support.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim项目tags文件问题</title>
		<link>http://ihacklog.com/software/powerfulvim/vim-project-tags-file.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/vim-project-tags-file.html#comments</comments>
		<pubDate>Fri, 06 Jan 2012 14:12:18 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">/?p=5296</guid>
		<description><![CDATA[貌似国人有个插件： projtags.vim 用的时候这样： 1let g:ProjTags = &#91; &#34;~/work/proj1&#34; &#93; 要用这个插件,可修改.vimrc文件或者新建一.vim文件再在.vimrc文件里面source之。 直接把它的说明copy来吧： Usage: Set your projects path into g:ProjTags as a list, for example: let g:ProjTags = [ "~/work/proj1" ] ...]]></description>
			<content:encoded><![CDATA[<p>貌似国人有个插件：<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fwww.vim.org%2Fscripts%2Fscript.php%3Fscript_id%3D1873" target="_blank">projtags.vim</a></p>
<p>用的时候这样：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>ProjTags = <span style="color: #000000;">&#91;</span> <span style="color: #C5A22D;">&quot;~/work/proj1&quot;</span> <span style="color: #000000;">&#93;</span></div></td></tr></tbody></table></div>
<p>要用这个插件,可修改.vimrc文件或者新建一.vim文件再在.vimrc文件里面source之。<br />
直接把它的说明copy来吧：</p>
<blockquote><p>Usage: </p>
<p>Set your projects path into g:ProjTags as a list, for example: </p>
<p>let g:ProjTags = [ "~/work/proj1" ] </p>
<p>In this case for all file match the pattern “~/work/proj1/*”, the tag file<br />
“~/work/proj1/tags” will be used. </p>
<p>You can also specify a tags file other than the default one or more tags<br />
files for one directory by a list: </p>
<p>let g:ProjTags += [[ "~/work/proj2", "~/work/proj2/tags",<br />
"~/work/common.tags" ]] </p>
<p>In this case for all files match the pattern “~/work/proj2/*”, the tag files<br />
“~/work/proj2/tags” and “~/work/common.tags” will be used. </p>
<p>If one of the items in the list begins with “:”, it will be treated as a<br />
command (other than tag file): </p>
<p>let g:ProjTags += [[ "~/work/proj3", "~/work/proj3/tags",<br />
":set shiftwidth=4" ]] </p>
<p>In this case for all files match the pattern “~/work/proj3/*”, the tag file<br />
“~/work/proj3/tags” will be used, and “shiftwidth=4&#8243; will be set. </p>
<p>Please note that if you use “set” in the command, we will actually use<br />
“setlocal” instead, to avoid polluting the whole vim environment. </p>
<p>You can add the above codes into your vimrc file</p></blockquote>
<p>为什么要设置一个带绝对路径的tags值呢？因为，如果在/proj目录下面生成了tags文件，在/proj目录时，用vim打开文件，自动是能够找到标记。<br />
如果进入其子目录呢？此时由于其子目录下面并没有tags文件，因此，源码里面的标记便无法交叉引用了。。。</p>
<p>在没有看到这个插件前，我用过这种办法：<br />
首先，.vimrc里面加一句：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">tags</span>=.<span style="color: #000000; font-weight: bold;">/</span>tags,tags,<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.tags<span style="color: #000000; font-weight: bold;">/</span>tags</div></td></tr></tbody></table></div>
<p>写一脚本生成当前目录及其子目录下指定文件的tags文件：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span>admin<span style="color: #000000; font-weight: bold;">@</span>huangye scripts<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</span> gen_tags.sh <br />
<span style="color: #666666; font-style: italic;">#! /bin/sh</span><br />
<span style="color: #666666; font-style: italic;"># vars</span><br />
<span style="color: #007800;">PRJ_DIR</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">pwd</span><span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #007800;">PRJ_TAG_FILE</span>=<span style="color: #800000;">${PRJ_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>tags<br />
<span style="color: #007800;">LIST_FILES</span>=<span style="color: #800000;">${PRJ_DIR}</span><span style="color: #000000; font-weight: bold;">/</span>tags.list<br />
<br />
<span style="color: #007800;">FIND</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">find</span><br />
<span style="color: #007800;">CTAGS</span>=<span style="color: #ff0000;">&quot;/usr/local/bin/ctags --sort=yes --totals=yes --verbose --tag-relative=no&quot;</span><br />
<span style="color: #007800;">CSCOPE</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cscope<br />
<br />
<span style="color: #666666; font-style: italic;"># find files</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #800000;">${FIND}</span> <span style="color: #800000;">${PRJ_DIR}</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${LIST_FILES}</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> -<br />
<span style="color: #666666; font-style: italic;"># generate tag file</span><br />
<span style="color: #800000;">${CTAGS}</span> <span style="color: #660033;">-f</span><span style="color: #800000;">${PRJ_TAG_FILE}</span> <span style="color: #660033;">-L</span><span style="color: #800000;">${LIST_FILES}</span><br />
<span style="color: #800000;">${CSCOPE}</span> <span style="color: #660033;">-bq</span> -fcscope.out <span style="color: #660033;">-i</span><span style="color: #800000;">${LIST_FILES}</span> <br />
<span style="color: #7a0874; font-weight: bold;">echo</span> done.</div></td></tr></tbody></table></div>
<p>生成完后，如果要使用当前项目下的tags文件，则把此tags文件copy到~/.tags/tags,可以在.bashrc里面加一个别名：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">cptags</span>=<span style="color: #ff0000;">'cp -v `pwd`/tags ~/.tags/tags'</span></div></td></tr></tbody></table></div>
<p>这样也能实现上面插件所实现的功能。当然，有个不好的地方，如果要同时进行两个项目，这种方法就不行了。。。</p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=5296";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=5296" title="Permanent Link to Vim项目tags文件问题" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=5296</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2008年12月31日  //  <a href="http://ihacklog.com/php/%e6%8b%92%e7%bb%9d%e5%a5%b8%e5%95%86%ef%bc%8c%e8%a3%85%e6%9c%ba%e7%a7%98%e8%af%80%e5%88%86%e4%ba%ab.html" title="拒绝奸商，装机秘诀分享">拒绝奸商，装机秘诀分享</a> (0)</li><li>2010年11月11日  //  <a href="http://ihacklog.com/software/tips/windows-live-messenger-2009-v-14-0-8117-416-ad-remove.html" title="Windows Live Messenger 2009(版本 14.0.8117.416) 手动去广告方法">Windows Live Messenger 2009(版本 14.0.8117.416) 手动去广告方法</a> (4)</li><li>2011年10月5日  //  <a href="http://ihacklog.com/php/wordpress/plugins/hacklog-xiami.html" title="Xiami音乐短代码支持插件">Xiami音乐短代码支持插件</a> (15)</li><li>2011年12月18日  //  <a href="http://ihacklog.com/php/wordpress/plugins/the-second-solution-to-modifying-wordpress-admin-password-when-your-have-forgot-it.html" title="普通青年版:WordPress管理员密码忘记了怎么办？上传一个文件即可">普通青年版:WordPress管理员密码忘记了怎么办？上传一个文件即可</a> (3)</li><li>2008年12月7日  //  <a href="http://ihacklog.com/php/skills/clever-forms-with-php.html" title="Clever forms with PHP">Clever forms with PHP</a> (0)</li><li>2012年01月1日  //  <a href="http://ihacklog.com/software/onlinetools/2012-hengtian-host-promotions.html" title="2012，衡天主机继续给力(新年优惠，要购买从速）">2012，衡天主机继续给力(新年优惠，要购买从速）</a> (4)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/vim-project-tags-file.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Vim statusline设置</title>
		<link>http://ihacklog.com/software/powerfulvim/vim-statusline-settings.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/vim-statusline-settings.html#comments</comments>
		<pubDate>Fri, 06 Jan 2012 07:54:49 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=5292</guid>
		<description><![CDATA[如果只需要默认的状态栏，这样就行了： 12345&#34; Always show status line, even for one window set laststatus=2 &#34; Show line, column number, and relative position within a file in the status line set ruler 当然，用set statusline也可模拟 &#8216;ruler&#8217; 设置的标准状态行 1set statuslin...]]></description>
			<content:encoded><![CDATA[<p>如果只需要默认的状态栏，这样就行了：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;">&quot; Always show status line, even for one window</span><br />
<span style="color: #804040;">set</span> <span style="color: #668080;">laststatus</span>=<span style="color: #000000; font-weight:bold;">2</span><span style="color: #adadad; font-style: italic;"><br />
<br />
&quot; Show line, column number, and relative position within a file in the status line</span><br />
<span style="color: #804040;">set</span> <span style="color: #668080;">ruler</span></div></td></tr></tbody></table></div>
<p>当然，用set statusline也可模拟 &#8216;ruler&#8217; 设置的标准状态行</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #804040;">set</span> <span style="color: #668080;">statusline</span>=<span style="color: #000000;">%&lt;%</span>f\ <span style="color: #000000;">%</span>h<span style="color: #000000;">%</span>m<span style="color: #000000;">%</span>r<span style="color: #000000;">%</span>=<span style="color: #000000;">%-</span><span style="color: #000000; font-weight:bold;">14</span><span style="color: #000000;">.</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">%</span>l,<span style="color: #000000;">%</span>c<span style="color: #000000;">%</span>V<span style="color: #000000;">%</span><span style="color: #000000;">&#41;</span>\ <span style="color: #000000;">%</span>P</div></td></tr></tbody></table></div>
<p>既然已经用vim了，当然要根据自己的需要个性化一下～～</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">:</span>h <span style="color: #668080;">statusline</span></div></td></tr></tbody></table></div>
<p>查看帮助信息。statusline用的是类似printf函数的输出。这一点非常友好～～<br />
如现在我的设置是这样的：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;">&quot;状态栏，显示文件名，修改标志,光标处字符ASCII,十六进制ASCII，行，列，虚拟列号,位置百分比，git status</span><br />
<span style="color: #804040;">set</span> <span style="color: #668080;">statusline</span>=<span style="color: #000000;">%&lt;%</span>F<span style="color: #000000;">%</span>1<span style="color: #000000;">*%</span>m<span style="color: #000000;">%*%</span>r<span style="color: #000000;">%</span>y<span style="color: #000000;">%</span>=<span style="color: #000000;">%</span>b\ 0x<span style="color: #000000;">%</span>B\ \ <span style="color: #000000;">&#91;</span>l,c<span style="color: #000000;">&#93;</span><span style="color: #000000;">%</span>l,<span style="color: #000000;">%</span>c<span style="color: #000000;">%</span>V\ <span style="color: #000000;">%</span>p<span style="color: #000000;">%%</span>\ <span style="color: #000000;">%</span><span style="color: #000000;">&#123;</span>GitBranchInfoString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />
<span style="color: #804040;">hi</span> User1 <span style="color: #668080;">term</span>=inverse,bold cterm=inverse,bold ctermfg=red<span style="color: #adadad; font-style: italic;"><br />
&quot;F是全路径，f是仅文件名，%&lt;表示如果过长，截断前面的部分。%1* 表示下面的标记要使用User1的highlight,%m表示“可修改”标识，%*是恢复normal高亮，%r是只读标记,%y是文件类型标识,%=是左对齐和右对齐项目之间的分割点。</span><span style="color: #adadad; font-style: italic;"><br />
&quot;好了，然后是右边的，%b是光标处字符ASCII码的十进制值，\后面加一个空格表示空格,%l是行号,%c%V分别是列号和虚拟列号，%p是当前位置的百分比</span><span style="color: #adadad; font-style: italic;"><br />
&quot;同printf一样，%%是显示一个百分号了</span><span style="color: #adadad; font-style: italic;"><br />
&quot;%{GitBranchInfoString()}是我装了 Git Branch Info( http://www.vim.org/scripts/script.php?script_id=2258) 插件，用这个显示git status.</span></div></td></tr></tbody></table></div>
<p>关于列号和虚拟列号，我解释下，如果某行前面有tag制表符或者一行全部为空的情况下就会显示，此时显示的列号是从制表符后面开始的，是“虚”的，因此叫虚拟列号。<br />
<a href="http://static.ihacklog.com/wp-files/2012/01/vim-statusline.png" class="tinybox2"  onclick="TINY.box.show({image:this.href,boxid:'frameless',animate:true,fixed:false});return false;"  title="Click to enlarge（点击查看大图）" ><img src="http://static.ihacklog.com/wp-files/2012/01/vim-statusline-550x329.png" alt="" title="vim-statusline" width="550" height="329" class="alignnone size-medium wp-image-5294" /> </a></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=5292";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=5292" title="Permanent Link to Vim statusline设置" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=5292</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2010年03月10日  //  <a href="http://ihacklog.com/php/framework/mvc-pattern-ddifferences-bewteen-ci-and-tp.html" title="CI与TP之MVC比较">CI与TP之MVC比较</a> (3)</li><li>2008年12月7日  //  <a href="http://ihacklog.com/php/skills/imagevue-v2.html" title="Imagevue V2">Imagevue V2</a> (0)</li><li>2010年04月14日  //  <a href="http://ihacklog.com/php/wordpress/theme/google-page-rank-updated-to-4-and-my-new-theme-ascii.html" title="PR更新到4了，换了个新主题">PR更新到4了，换了个新主题</a> (21)</li><li>2009年08月27日  //  <a href="http://ihacklog.com/php/wordpress/problems/nextgen-gallery-guilty.html" title="原来NextGEN Gallery才是罪魁祸首">原来NextGEN Gallery才是罪魁祸首</a> (4)</li><li>2009年09月28日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/wordpress-under-html-editor-open-anchor-in-new-window.html" title="让wordpress在 HTML编辑器下添加链接在新窗口中打开">让wordpress在 HTML编辑器下添加链接在新窗口中打开</a> (8)</li><li>2011年08月2日  //  <a href="http://ihacklog.com/linux/archlinux/dropping-tcp_wrappers-support.html" title="Archlinux移除了对tcp_wrappers的支持">Archlinux移除了对tcp_wrappers的支持</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/vim-statusline-settings.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>分享一个用于生成tags文件的脚本</title>
		<link>http://ihacklog.com/software/powerfulvim/generate-ctags-file-for-vim.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/generate-ctags-file-for-vim.html#comments</comments>
		<pubDate>Tue, 27 Sep 2011 20:45:08 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[ctags]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[VIM]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=4858</guid>
		<description><![CDATA[在Linux下面只需要用find 命令即可生成一个包含特定后缀文件路径的文件列表文件。相比之下win下的dir命令就功能不怎么样了。 因此此脚本主要用于Win，因为Linux下有更简单的办法。 在_vimrc中添加： 12&#34; TAGS SETTINGS set tags=./tags,tags,$HOME/tags 这样当在当前目录找不到tags文件时，就会去$HOME目录找。 这也就是我用这个脚本的目的，当做某个项目时，无论你在项目目录下面的哪个文件夹里用vim打开文件，都可以用ctags功能查...]]></description>
			<content:encoded><![CDATA[<p>在Linux下面只需要用find 命令即可生成一个包含特定后缀文件路径的文件列表文件。相比之下win下的dir命令就功能不怎么样了。<br />
因此此脚本主要用于Win，因为Linux下有更简单的办法。</p>
<p>在_vimrc中添加：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;">&quot; TAGS SETTINGS</span><br />
<span style="color: #804040;">set</span> <span style="color: #668080;">tags</span>=<span style="color: #000000;">./</span><span style="color: #668080;">tags</span>,<span style="color: #668080;">tags</span>,<span style="color: #000000;">$</span>HOME<span style="color: #000000;">/</span><span style="color: #668080;">tags</span></div></td></tr></tbody></table></div>
<blockquote><p>这样当在当前目录找不到tags文件时，就会去$HOME目录找。<br />
这也就是我用这个脚本的目的，当做某个项目时，无论你在项目目录下面的哪个文件夹里用vim打开文件，都可以用ctags功能查找函数的定义等。因为上述脚本生成的tags.list文件中的内容都是绝对路径，这样能使ctags生成的tags文件中的路径信息也是绝对路径，在查找标记时便不会发生问题。</p></blockquote>
<p>再配合以下脚本：<br />
genctags.bat 内容如下( D:\software\util\gen_ctags_flist.php是gen_ctags_flist.php的全路径)：</p>
<div class="codecolorer-container winbatch default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="winbatch codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #66cc66;">@</span>echo <span style="color: #0080FF; font-weight: bold;">off</span><br />
color 08<br />
php D<span style="color: #FF1010; font-weight: bold;">:\software\util\gen_ctags_flist.php ./</span><br />
<span style="color: #FF1010; font-weight: bold;">::ctags -R --sort=yes --totals=yes --verbose --tag-relative=no</span><br />
color 3f<br />
<br />
ctags <span style="color: #66cc66;">-</span>R <span style="color: #66cc66;">--</span>sort=<span style="color: #0080FF; font-weight: bold;">yes</span> <span style="color: #66cc66;">--</span>totals=<span style="color: #0080FF; font-weight: bold;">yes</span> <span style="color: #66cc66;">--</span>verbose <span style="color: #66cc66;">--</span>tag<span style="color: #66cc66;">-</span>relative=<span style="color: #0080FF; font-weight: bold;">no</span> <span style="color: #66cc66;">-</span>L tags.list<br />
<br />
copy <span style="color: #66cc66;">/</span>Y tags <span style="color: #66cc66;">%</span>UserProfile<span style="color: #66cc66;">%</span>\tags<br />
echo .</div></td></tr></tbody></table></div>
<p>此脚本需要在当前路径使用，也就是你要生成哪个目录及其子目录下面的文件列表就在哪里执行。</p>
<p>gen_ctags_flist.php内容如下：</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:500px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #666666; font-style: italic;">/*=============================================================================<br />
# &nbsp; &nbsp; FileName: gen_ctags_flist.php<br />
# &nbsp; &nbsp; &nbsp; &nbsp; Desc: <br />
# &nbsp; &nbsp; &nbsp; Author: 荒野无灯<br />
# &nbsp; &nbsp; &nbsp; &nbsp;Email: admin#ihacklog.com<br />
# &nbsp; &nbsp; HomePage: http://ihacklog.com<br />
# &nbsp; &nbsp; &nbsp;Version: 0.0.1<br />
# &nbsp; LastChange: 2011-09-28 04:38:20<br />
# &nbsp; &nbsp; &nbsp;History:<br />
=============================================================================*/</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$argc</span> <span style="color: #339933;">&lt;=</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error: please give me a dir param!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// current directory</span><br />
<span style="color: #666666; font-style: italic;">//echo getcwd() . &quot;\n&quot;;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'.'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">'./'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/getcwd"><span style="color: #990000;">getcwd</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">else</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/is_dir"><span style="color: #990000;">is_dir</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error: <span style="color: #009933; font-weight: bold;">%s</span> is not a dir!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #000088;">$tags_list_file</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rtrim"><span style="color: #990000;">rtrim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/tags.list'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rtrim"><span style="color: #990000;">rtrim</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$dir</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$dir_iterator</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RecursiveDirectoryIterator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$iterator</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RecursiveIteratorIterator<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir_iterator</span><span style="color: #339933;">,</span> RecursiveIteratorIterator<span style="color: #339933;">::</span><span style="color: #004000;">LEAVES_ONLY</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #666666; font-style: italic;">// could use CHILD_FIRST if you so wish</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/*LEAVES_ONLY will only return leaves and not the containers.<br />
&nbsp; &nbsp; SELF_FIRST will list the containers first and then each of their proceeding children.<br />
&nbsp; &nbsp; CHILD_FIRST will reverse the way the current results look. Processing the recursive array from the inside out.*/</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tags_list_file</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
<a href="http://www.php.net/unlink"><span style="color: #990000;">unlink</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tags_list_file</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Notice: file <span style="color: #009933; font-weight: bold;">%s</span> exists.Delete it!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$tags_list_file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/fopen"><span style="color: #990000;">fopen</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tags_list_file</span> <span style="color: #339933;">,</span><span style="color: #0000ff;">'ab'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Error: can not create file <span style="color: #009933; font-weight: bold;">%s</span>!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tags_list_file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000088;">$n</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$iterator</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$ext</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,-</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'.php'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$ext</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">,</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/fwrite"><span style="color: #990000;">fwrite</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span><span style="color: #000088;">$file</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$n</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<a href="http://www.php.net/fclose"><span style="color: #990000;">fclose</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Current dir: '</span><span style="color: #339933;">.</span> <span style="color: #000088;">$dir</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">echo</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;OK: write <span style="color: #009933; font-weight: bold;">%d</span> files to file <span style="color: #009933; font-weight: bold;">%s</span> successfully!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$n</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tags_list_file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
注意：该页面嵌入了下载文件，请访问 <a href="http://ihacklog.com/software/powerfulvim/generate-ctags-file-for-vim.html">该页面</a>下载该文件。
<p><ins datetime="2011-09-28T09:53:14+00:00"><br />
依云说可以装一个find，是的，装find无疑是省事的办法了，我也装了个。<br />
这find是gnuwin32项目中的一个包，可去这里下载：<br />
<strong>http://gnuwin32.sourceforge.net/downlinks/findutils.php</strong><br />
完了之后把win到死那个c:\windows\system32\find.exe　给重命名吧。<br />
</ins></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4858";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4858" title="Permanent Link to 分享一个用于生成tags文件的脚本" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4858</a>
            </p>
             </div><h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2011年09月5日  //  <a href="http://ihacklog.com/software/development-tool/tools-that-phper-should-know.html" title="PHPer应该知道的工具">PHPer应该知道的工具</a> (7)</li><li>2011年09月3日  //  <a href="http://ihacklog.com/software/powerfulvim/markdown-in-vim.html" title="Markdown in Vim">Markdown in Vim</a> (0)</li><li>2011年08月30日  //  <a href="http://ihacklog.com/software/powerfulvim/format-your-php-code-in-vim-with-phpbeautifier.html" title="用VIM和PHP_Beautifier格式化你的PHP代码">用VIM和PHP_Beautifier格式化你的PHP代码</a> (3)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/php-manual-for-vim.html" title="PHP Manual for Vim">PHP Manual for Vim</a> (1)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/zen-coding-a-powerful-tool-for-writing-html-css-code.html" title="Zen Coding:写HTML/CSS之辅助利器">Zen Coding:写HTML/CSS之辅助利器</a> (3)</li><li>2011年06月2日  //  <a href="http://ihacklog.com/software/powerfulvim/encoding-and-fileformats-in-vim-you-should-know.html" title="关于vim的编码与文件格式（备忘）">关于vim的编码与文件格式（备忘）</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/generate-ctags-file-for-vim.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>那些IDE中的VIM插件</title>
		<link>http://ihacklog.com/software/cool_software_share/vim-plugins-for-ide.html</link>
		<comments>http://ihacklog.com/software/cool_software_share/vim-plugins-for-ide.html#comments</comments>
		<pubDate>Sat, 10 Sep 2011 15:33:30 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[酷软分享]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=4783</guid>
		<description><![CDATA[Visual Studio的Vim插件:ViEmu 这个插件是商业产品。支持VS2008　、　VS2010　等，另外，还支持Word和Outlook，SQL Server。 这里提供一下可用的下载地址：http://download.csdn.net/detail/medtrib/2976739 免费的的插件有：VsVim Eclipse中的Vim插件：eclim 使用eclim，你可以在vim中有Eclipse的功能，也可以在Eclipse中嵌入Vim编辑器。 还有一个工具是Vrapper，这个工具是在...]]></description>
			<content:encoded><![CDATA[<p><strong>Visual Studio的Vim插件</strong>:<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fwww.viemu.com%2F" target="_blank">ViEmu</a></p>
<p><img src="http://www.viemu.com/viemu-movie.gif" alt="viEmu" /><br />
这个插件是商业产品。支持VS2008　、　VS2010　等，另外，还支持Word和Outlook，SQL Server。<br />
这里提供一下可用的下载地址：http://download.csdn.net/detail/medtrib/2976739</p>
<p>免费的的插件有：<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fvisualstudiogallery.msdn.microsoft.com%2Fen-us%2F59ca71b3-a4a3-46ca-8fe1-0e90e3f79329" target="_blank">VsVim</a></p>
<p><strong>Eclipse中的Vim插件</strong>：<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Feclim.org%2F" target="_blank">eclim</a><br />
使用eclim，你可以在vim中有Eclipse的功能，也可以在Eclipse中嵌入Vim编辑器。<br />
还有一个工具是Vrapper，这个工具是在Eclipse中使用Vim，你只需要在Eclipse的工具栏上点一下那个gvim的按钮就可以了。<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fvrapper.sourceforge.net%2Fhome%2F" target="_blank">http://vrapper.sourceforge.net/home/</a><br />
更新URL：</p>
<blockquote><p>Stable: http://vrapper.sourceforge.net/update-site/stable<br />
Unstable: http://vrapper.sourceforge.net/update-site/unstable </p></blockquote>
<p><strong>Netbeans　IDE中的Vim插件</strong>：　<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fjvi.sourceforge.net%2F" target="_blank">Jvi</a><br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fjvi.sourceforge.net%2F" target="_blank">http://jvi.sourceforge.net/</a><br />
jVi是Vim一些基本功能的JAVA版实现。在netbeans里面可以很方便地启用和禁用jVi编辑器。jVi目前支持超过200个vim命令：<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fjvi.sourceforge.net%2Fvimhelp%2Fhelp.txt.html%23reference_toc" target="_blank">http://jvi.sourceforge.net/vimhelp/help.txt.html#reference_toc</a></p>
<p><strong>JetBrains PhpStorm 中的Vim插件</strong>：<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fplugins.intellij.net%2Fplugin%2F%3Fwebide%26id%3D164" target="_blank">IdeaVIM</a><br />
支持以下功能：</p>
<blockquote><p>    Motion keys<br />
    Deletion/Changing<br />
    Insert mode commands<br />
    Marks<br />
    Registers<br />
    VIM undo/redo<br />
    Visual mode commands<br />
    Some Ex commands<br />
    Some :set options<br />
    Full VIM regular expressions for search and search/replace<br />
    Macros<br />
    Diagraphs<br />
    VIM help</p></blockquote>
<p>按<strong>ctrl+alt+v </strong>可启用此Vim模拟器。<br />
相比于netbeans中的Vim插件，这个稍微逊色一些。</p>
<p>参考资料：<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fcoolshell.cn%2Farticles%2F1837.html" target="_blank">http://coolshell.cn/articles/1837.html</a></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4783";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4783" title="Permanent Link to 那些IDE中的VIM插件" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4783</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2009年02月10日  //  <a href="http://ihacklog.com/php/noticeonlyvariablereferencesshouldbereturnedbyreference.html" title="Notice: Only variable references should be returned by reference">Notice: Only variable references should be returned by reference</a> (1)</li><li>2010年05月10日  //  <a href="http://ihacklog.com/programming/c/calculate-the-week-of-a-particular-day-a-certain-period.html" title="C语言学习——计算某年某月某日是星期几的函数">C语言学习——计算某年某月某日是星期几的函数</a> (4)</li><li>2009年05月27日  //  <a href="http://ihacklog.com/xml_html_css_js_ajax/baidukongjianshanchuwenzhangdeyincangbiaodan.html" title="百度空间删除文章的隐藏表单">百度空间删除文章的隐藏表单</a> (0)</li><li>2009年06月11日  //  <a href="http://ihacklog.com/software/ruijie/ruijieruanjian3-22pojieban.html" title="锐捷软件3.22破解版">锐捷软件3.22破解版</a> (1)</li><li>2009年08月23日  //  <a href="http://ihacklog.com/linux/ubuntu-desktop/sun-virtualbox-3-0-bridge-setup-on-ubuntu-9-0-4.html" title="UBUNTU 9.0.4下sun VirtualBOX 3.0 桥接 设置详细方法">UBUNTU 9.0.4下sun VirtualBOX 3.0 桥接 设置详细方法</a> (3)</li><li>2010年06月4日  //  <a href="http://ihacklog.com/software/tips/show-hidden.html" title="批量恢复被U盘病毒隐藏的目录和文件">批量恢复被U盘病毒隐藏的目录和文件</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/cool_software_share/vim-plugins-for-ide.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Markdown in Vim</title>
		<link>http://ihacklog.com/software/powerfulvim/markdown-in-vim.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/markdown-in-vim.html#comments</comments>
		<pubDate>Fri, 02 Sep 2011 19:53:16 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[Markdown]]></category>
		<category><![CDATA[VIM]]></category>

		<guid isPermaLink="false">http://ihacklog.com/software/powerfulvim/markdown-in-vim.html</guid>
		<description><![CDATA[首先是语法高亮，目前我用的是这个语法文件： Markdown &#8211; Syntax highlight for Markdown text files : vim online 安装方法： 1$ vim markdown-&#60;version&#62;.vba.gz +&#34;:source % &#124; quit!&#34; 有个叫Plasticboy的也写了一个，在这儿： Markdown Vim Mode &#124; PlasticBoy 不过这个我没有用过，不知道哪个更强大。 ...]]></description>
			<content:encoded><![CDATA[<p>首先是语法高亮，目前我用的是这个语法文件：<br />
<a href="http://www.vim.org/scripts/script.php?script_id=2882">Markdown &#8211; Syntax highlight for Markdown text files : vim online</a><br />
安装方法：</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ vim markdown-&lt;version&gt;.vba.gz +&quot;:source % | quit!&quot;</div></td></tr></tbody></table></div>
<p>有个叫Plasticboy的也写了一个，在这儿：<br />
<a href="http://plasticboy.com/markdown-vim-mode/">Markdown Vim Mode | PlasticBoy</a><br />
不过这个我没有用过，不知道哪个更强大。</p>
<p>然后我们可以编辑.vimrc 加上：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;">&quot;Markdown to HTML &nbsp;</span><br />
nmap <span style="color: #000000;">&lt;</span>leader<span style="color: #000000;">&gt;</span>md <span style="color: #000000;">:%!/</span>usr<span style="color: #000000;">/</span>local<span style="color: #000000;">/</span><span style="color: #668080;">bin</span><span style="color: #000000;">/</span>Markdown<span style="color: #000000;">.</span>pl <span style="color: #000000;">--</span>html4tags <span style="color: #668080;">&lt;cr&gt;</span></div></td></tr></tbody></table></div>
<p>这样在Vim里面我们可以快速将Markdown文本转换为HTML。<br />
Markdown.pl 下载地址：<br />
<a href="http://daringfireball.net/projects/markdown/">Daring Fireball: Markdown</a></p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>daringfireball.net<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>Markdown_1.0.1.zip<br />
<span style="color: #c20cb9; font-weight: bold;">unzip</span> Markdown_1.0.1.zip<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> Markdown_1.0.1<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-v</span> Markdown.pl <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>Markdown.pl</div></td></tr></tbody></table></div>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4777";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4777" title="Permanent Link to Markdown in Vim" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4777</a>
            </p>
             </div><h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2011年09月28日  //  <a href="http://ihacklog.com/software/powerfulvim/generate-ctags-file-for-vim.html" title="分享一个用于生成tags文件的脚本">分享一个用于生成tags文件的脚本</a> (5)</li><li>2011年09月5日  //  <a href="http://ihacklog.com/software/development-tool/tools-that-phper-should-know.html" title="PHPer应该知道的工具">PHPer应该知道的工具</a> (7)</li><li>2011年09月3日  //  <a href="http://ihacklog.com/php/markdown-intro.html" title="Markdown 的使用介绍">Markdown 的使用介绍</a> (0)</li><li>2011年08月30日  //  <a href="http://ihacklog.com/software/powerfulvim/format-your-php-code-in-vim-with-phpbeautifier.html" title="用VIM和PHP_Beautifier格式化你的PHP代码">用VIM和PHP_Beautifier格式化你的PHP代码</a> (3)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/php-manual-for-vim.html" title="PHP Manual for Vim">PHP Manual for Vim</a> (1)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/zen-coding-a-powerful-tool-for-writing-html-css-code.html" title="Zen Coding:写HTML/CSS之辅助利器">Zen Coding:写HTML/CSS之辅助利器</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/markdown-in-vim.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用VIM和PHP_Beautifier格式化你的PHP代码</title>
		<link>http://ihacklog.com/software/powerfulvim/format-your-php-code-in-vim-with-phpbeautifier.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/format-your-php-code-in-vim-with-phpbeautifier.html#comments</comments>
		<pubDate>Tue, 30 Aug 2011 15:29:47 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[PHP_Beautifier]]></category>
		<category><![CDATA[PHP代码美化]]></category>
		<category><![CDATA[VIM]]></category>
		<category><![CDATA[代码格式化]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=4774</guid>
		<description><![CDATA[平常用IDE，如netbeans IDE,Phpstorm ,zendstudio 等，都有格式化代码的功能，用VIM能不能也实现这个功能呢？答案是YES。 最近接手修改一个由别人在N年前写的老PHP程序（各种BUG），代码可读性极差，因此想美化一下。于是有了此文。在此记录一下，方便 有同样需求的朋友查看。如果你有更好的办法，欢迎留言与我分享。 STEP 1: 修改vim配置文件(*nix : .vimrc , win : _vimrc ) 添加： map :% ! php_beautifier &#82...]]></description>
			<content:encoded><![CDATA[<p>平常用IDE，如netbeans IDE,Phpstorm ,zendstudio 等，都有格式化代码的功能，用VIM能不能也实现这个功能呢？答案是YES。<br />
最近接手修改一个由别人在N年前写的老PHP程序（各种BUG），代码可读性极差，因此想美化一下。于是有了此文。在此记录一下，方便<br />
有同样需求的朋友查看。如果你有更好的办法，欢迎留言与我分享。 <img src='http://ihacklog.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':smile:' class='wp-smiley' />  </p>
<p>STEP 1:<br />
修改vim配置文件(*nix : .vimrc , win : _vimrc ) 添加：<br />
<del datetime="2011-08-30T16:29:18+00:00">map <C-b> :% ! php_beautifier &#8211;filters “phpBB() EqualsAlign() ArrayNested() DocBlock()”<CR></del></p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #adadad; font-style: italic;">&quot;用pear　PHP_beautifier 格式化PHP代码，经测试，加上 DocBlock()有时会吃掉你的代码</span><br />
<span style="color: #804040;">map</span> <span style="color: #000000;">&lt;</span>C<span style="color: #000000;">-</span>b<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:%</span> <span style="color: #000000;">!</span> php_beautifier <span style="color: #000000;">--</span>filters <span style="color: #C5A22D;">&quot;phpBB() EqualsAlign() ArrayNested()&quot;</span><span style="color: #668080;">&lt;CR&gt;</span></div></td></tr></tbody></table></div>
<p>个人最喜欢Allman bsd格式的Indent　Style (缩进风格），<br />
与PEAR的编码标准等不同的是，phpBB编码标准使用BSD风格的缩进。<br />
phpBB编码标准：<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Farea51.phpbb.com%2Fdocs%2F30x%2Fcoding-guidelines.html" target="_blank">http://area51.phpbb.com/docs/30x/coding-guidelines.html</a><br />
如果你喜欢用其它的，可以自行修改。<br />
filter是可带参数的，filter之间用空格隔开：<br />
<strong>“FilterName (param=value , param=value&#8230;  FilterName&#8230;)” </strong><br />
也可单独指定Indent　Style，如<br />
<strong>IndentStyles(style=bsd)</strong><br />
详见：http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_IndentStyles.html</p>
<p>STEP 2:<br />
安装<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fpear.php.net%2Fpackage%2FPHP_Beautifier%2Fdownload" target="_blank">PHP_Beautifier</a><br />
目前最新版为0.1.15</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">pear <span style="color: #c20cb9; font-weight: bold;">install</span> PHP_Beautifier-0.1.15</div></td></tr></tbody></table></div>
<p>或：</p>
<div class="codecolorer-container bash default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">php pyrus.phar <span style="color: #c20cb9; font-weight: bold;">install</span> pear<span style="color: #000000; font-weight: bold;">/</span>PHP_Beautifier-0.1.15</div></td></tr></tbody></table></div>
<p>貌似已经OVER啦？NO，没完。</p>
<p>由于在开发环境中我们一般设置错误报告为：　E_ALL | E_STRICT<br />
由于此版本的PHP_Beautifier是2010年的东西，有些函数可能已经DEPRECATED了，因此运行时会产生E_DEPRECATED提示。而我们用此工具主要是用来美化我们的代码，提示信息的内容会混在VIM中显示的格式化后的结果中，因此，去掉是必需D。<br />
修改php.ini 显然不是我们想要的。<br />
试着在pear启动php biautifier的脚本中加上 -d error_reporting=0　，但是依然显示E_DEPRECATED提示。于是看了下<br />
php_beautifier　文件，此文件为shell版PHP_Beautifier的入口点，打开一看，第55行赫然写着：</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>速度把它修改为：</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">//用E_ALL &amp; ~E_DEPRECATED 也行</span><br />
&nbsp;<a href="http://www.php.net/error_reporting"><span style="color: #990000;">error_reporting</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span> ^ E_DEPRECATED<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>再在vim里面按ctrl+b 格式化代码，已经OK了。 <img src='http://ihacklog.com/wordpress/wp-includes/images/smilies/icon_cool.gif' alt=':cool:' class='wp-smiley' />  </p>
<p>PHP　beautifier　命令行方式的详细使用方法：<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fbeautifyphp.sourceforge.net%2Fdocs%2FPHP_Beautifier%2Ftutorial_PHP_Beautifier.howtouse.commandline.pkg.html" target="_blank">http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/tutorial_PHP_Beautifier.howtouse.commandline.pkg.html</a><br />
文档地址：<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fbeautifyphp.sourceforge.net%2Fdocs%2F" target="_blank">http://beautifyphp.sourceforge.net/docs/</a></p>
<table frame="border">
<caption>Command-line options</caption>
<colgroup span="3"></colgroup>
<thead>
<tr>
<td>short option</td>
<td>long option</td>
<td>description</td>
</tr>
</thead>
<tbody>
<tr>
<td>-f</td>
<td>&#8211;input</td>
<td>input path</td>
</tr>
<tr>
<td>-o</td>
<td>&#8211;output</td>
<td>output path</td>
</tr>
<tr>
<td>-c</td>
<td>&#8211;compress</td>
<td>Compress the output (&#8216;tz&#8217;,'bz2&#8242;)</td>
</tr>
<tr>
<td>-t</td>
<td>&#8211;indent_tabs</td>
<td>Indent with tabs</td>
</tr>
<tr>
<td>-s</td>
<td>&#8211;indent_spaces</td>
<td>Indent with spaces</td>
</tr>
<tr>
<td>-l</td>
<td>&#8211;filters</td>
<td>Add one or more filters</td>
</tr>
<tr>
<td>-d</td>
<td>&#8211;directory_filters</td>
<td>Add a filters directory.</td>
</tr>
<tr>
<td>-r</td>
<td>&#8211;recursive</td>
<td>Turn on recursive mode</td>
</tr>
<tr>
<td>-?</td>
<td>&#8211;help</td>
<td>Display help / usage</td>
</tr>
</tbody>
</table>
<p>可用Filfter:</p>
<table cellspacing="0" cellpadding="2" class="class-table">
<tbody>
<tr>
<th class="class-table-header">Class</th>
<th class="class-table-header">Description</th>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_Lowercase.html">PHP_Beautifier_Filter_Lowercase</a>
					</td>
<td>
											Lowercase: lowercase all control structures.
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_Pear.html">PHP_Beautifier_Filter_Pear</a>
					</td>
<td>
											Filter the code to make it compatible with PEAR Coding Standards
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_Default.html">PHP_Beautifier_Filter_Default</a>
					</td>
<td>
											Default Filter: Handle all the tokens. Uses K &amp; R style
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_Fluent.html">PHP_Beautifier_Filter_Fluent</a>
					</td>
<td>
											Filter Fluent: Create fluent style for multi-level object access.
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_phpBB.html">PHP_Beautifier_Filter_phpBB</a>
					</td>
<td>
											Filter the code to make it compatible with phpBB Coding Standards
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_ListClassFunction.html">PHP_Beautifier_Filter_ListClassFunction</a>
					</td>
<td>
											Create a list of functions and classes in the script  By default, this Filter puts the list at the beggining of the script.
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_EqualsAlign.html">PHP_Beautifier_Filter_EqualsAlign</a>
					</td>
<td>
											Filter EqualsAlign: Align the equals symbols in contiguous lines.
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_NewLines.html">PHP_Beautifier_Filter_NewLines</a>
					</td>
<td>
											New Lines: Add new lines after o before specific contents  The settings are &#8216;before&#8217; and &#8216;after&#8217;. As value, use a colon separated  list of contents or tokens
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_IndentStyles.html">PHP_Beautifier_Filter_IndentStyles</a>
					</td>
<td>
											Filter Indent Styles: Indent the code in k&amp;r, allman, gnu or whitesmiths
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_DocBlock.html">PHP_Beautifier_Filter_DocBlock</a>
					</td>
<td>
											Filter Doc Blocks: Use DocBlockGenerator for beautify the phpdoc comments.
										</td>
</tr>
<tr>
<td style="padding-right: 2em; white-space: nowrap">
<p>						<a href="http://beautifyphp.sourceforge.net/docs/PHP_Beautifier/Filter/PHP_Beautifier_Filter_ArrayNested.html">PHP_Beautifier_Filter_ArrayNested</a>
					</td>
<td>
											Filter Array Nested: Indent the array structures  Ex.
										</td>
</tr>
</tbody>
</table>
<p>参考文档：<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Fonesandzeros.posterous.com%2Fformat-php-code-in-vim-with-phpbeautifier" target="_blank">http://onesandzeros.posterous.com/format-php-code-in-vim-with-phpbeautifier</a></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4774";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4774" title="Permanent Link to 用VIM和PHP_Beautifier格式化你的PHP代码" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4774</a>
            </p>
             </div><h3  class="related_post_title">相关日志</h3><ul class="related_post"><li>2011年09月28日  //  <a href="http://ihacklog.com/software/powerfulvim/generate-ctags-file-for-vim.html" title="分享一个用于生成tags文件的脚本">分享一个用于生成tags文件的脚本</a> (5)</li><li>2011年09月5日  //  <a href="http://ihacklog.com/software/development-tool/tools-that-phper-should-know.html" title="PHPer应该知道的工具">PHPer应该知道的工具</a> (7)</li><li>2011年09月3日  //  <a href="http://ihacklog.com/software/powerfulvim/markdown-in-vim.html" title="Markdown in Vim">Markdown in Vim</a> (0)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/php-manual-for-vim.html" title="PHP Manual for Vim">PHP Manual for Vim</a> (1)</li><li>2011年06月6日  //  <a href="http://ihacklog.com/software/powerfulvim/zen-coding-a-powerful-tool-for-writing-html-css-code.html" title="Zen Coding:写HTML/CSS之辅助利器">Zen Coding:写HTML/CSS之辅助利器</a> (3)</li><li>2011年06月2日  //  <a href="http://ihacklog.com/software/powerfulvim/encoding-and-fileformats-in-vim-you-should-know.html" title="关于vim的编码与文件格式（备忘）">关于vim的编码与文件格式（备忘）</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/format-your-php-code-in-vim-with-phpbeautifier.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>关于VIM高亮匹配括号</title>
		<link>http://ihacklog.com/software/powerfulvim/vim-hightlight-match-parentheses.html</link>
		<comments>http://ihacklog.com/software/powerfulvim/vim-hightlight-match-parentheses.html#comments</comments>
		<pubDate>Sun, 28 Aug 2011 14:08:50 +0000</pubDate>
		<dc:creator>荒野无灯</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://ihacklog.com/?p=4766</guid>
		<description><![CDATA[近日发现我的VIM不能自动高亮匹配括号了，于是搜索之，发现该功能是由matchparen提供的。 1:h matchparen paren是单词parentheses（括号）的缩写。 高亮匹配括号 *matchparen* 这里提到的功能是一个标准插件 &#124;standard-plugin&#124;。 只有 'compatible' 不置位时才能使用此插件。 设置 "loaded_matchparen" 变量可以避免载入此插件: > :let loaded_matchparen = 1 此插件安装...]]></description>
			<content:encoded><![CDATA[<p>近日发现我的VIM不能自动高亮匹配括号了，于是搜索之，发现该功能是由matchparen提供的。</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">:</span>h matchparen</div></td></tr></tbody></table></div>
<p>paren是单词parentheses（括号）的缩写。</p>
<pre class="smooth">
高亮匹配括号						*matchparen*

这里提到的功能是一个标准插件 |standard-plugin|。
只有 'compatible' 不置位时才能使用此插件。

设置 "loaded_matchparen" 变量可以避免载入此插件: >
	:let loaded_matchparen = 1

此插件安装 CursorMoved、CursorMovedI 和 WinEnter 自动命令来重新定义匹配高亮。

					*:NoMatchParen* *:DoMatchParen*
要在载入此插件后关闭它，用: >

	:NoMatchParen

要再次打开: >

 <img src='http://ihacklog.com/wordpress/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> oMatchParen

使用的高亮是 MatchParen。":highlight" 命令可用来为它指定不同的颜色。例如: >
>
	:hi MatchParen ctermbg=blue guibg=lightblue

匹配的字符组来自 'matchpairs' 选项。你可以改变该值来高亮不同的匹配。注意 不是
什么值都可以。比如，你不能高亮单引号或双引号，因为它们的开始和结束字符相同。

使用语法高亮的属性。如果光标目前不在字符串或注释语法项目里，则忽略字符串和注释
里的匹配。任何名字里包含 "string" 或 "comment" 的语法项目都被认为是字符串或注
释项目。

移动光标时，限制搜索范围以避免延迟。这些限制包括:
- 窗口的可见部分。
- 光标上下 100 行，避免关闭折叠存在时的延迟过长。
- 光标前后 'synmaxcol' 乘以 2 个字节，避免存在带语法高亮的长行时延迟过长。

如果你希望 |%| 命令更好的工作，可以使用 matchit 插件，见 |matchit-install|。该
插件也可用于跳过注释里的匹配。这不同于 matchparen 高亮，两者使用不同的机制。</pre>
<p>查看了下我的vimrc文件，果然发现有一行：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #804040;">let</span> loaded_matchparen = <span style="color: #000000; font-weight:bold;">1</span></div></td></tr></tbody></table></div>
<p>此行正是导致我的VIM不高亮显示匹配括号的罪魁祸首。<br />
关于高亮组的帮助：</p>
<div class="codecolorer-container vim default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="vim codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000;">:</span>h highlight<span style="color: #000000;">-</span>groups</div></td></tr></tbody></table></div>
<p>顺便提一下刚搜索到的关于语法高亮的一篇文章：<br />
<a href="http://ihacklog.com/l.php?url=http%3A%2F%2Feaswy.com%2Fblog%2Farchives%2Fadvanced-vim-skills-syntax-on-colorscheme%2F" target="_blank">http://easwy.com/blog/archives/advanced-vim-skills-syntax-on-colorscheme/</a></p>

<script type="text/javascript"> 
var cur_host=top.location.hostname;
var huangye_host="ihacklog.com";
if ( huangye_host != cur_host) 
{
	var cur_url=top.location.href;
	//top.location.href = cur_url.replace(cur_host,huangye_host);
	top.location.href = "http://ihacklog.com/?p=4766";
}
</script> 			
<div class='sub'><h4>喜欢这篇文章吗?</h4><p>请订阅本站 <a class="feed" style="font-family:Consolas,'DejaVu Sans Mono',monospace,'Comic Sans MS',Monaco;font-size:14px;" href="http://ihacklog.com/feed" onclick="prompt(&#39;URL:&#39;, this.href); return false;">RSS feed</a> 或<a style="display:inline-block;width:90px;margin-bottom:-8px;" target="_blank" href="http://list.qq.com/cgi-bin/qf_invite?id=5899d1ae341c4fb741adf6648000fbaf3ef47b98e2a163da"><img border="0" alt="填写您的邮件地址，订阅我们的精彩内容：" src="http://rescdn.list.qq.com/zh_CN/htmledition/images/qunfa/manage/picMode_dark_s.png" /></a></p></div>
                <!-- 版权声明开始 -->
   		<div id="permissions">
		作者：<a href="http://ihacklog.com">荒野无灯</a><br/>
		出处：<span style="color: #333300;"><a target="_blank"  href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span><br/>
                <!-- 版权声明结束 -->
                <!-- 协议声明开始 -->
            <p>
            <strong>声明:</strong> 本站遵循 <span style="color: #ff0000;"><a href="http://creativecommons.org/licenses/by-nc-sa/2.5/cn/" target="_blank"> 署名-非商业性使用-相同方式共享 2.5</a> </span>共享协议. 转载请注明转自<span style="color: #333300;"><a target="_blank" href="http://ihacklog.com"><strong>Hacklog</strong>【荒野无灯weblog】</a></span>
            </p>
                <!-- 协议声明结束 -->
                
             <p>
             本文链接:  <a  target="_blank"  href="http://ihacklog.com/?p=4766" title="Permanent Link to 关于VIM高亮匹配括号" onclick="prompt(&#39;URL:&#39;, this.href); return false;">http://ihacklog.com/?p=4766</a>
            </p>
             </div><h3  class="related_post_title">随机日志</h3><ul class="related_post"><li>2009年11月24日  //  <a href="http://ihacklog.com/php/original/im-feeling-lucky.html" title="I&#8217;m feeling lucky完工">I&#8217;m feeling lucky完工</a> (9)</li><li>2009年11月2日  //  <a href="http://ihacklog.com/software/cool_software_share/sogou-cloud-input-method.html" title="搜狗云输入法">搜狗云输入法</a> (6)</li><li>2011年06月23日  //  <a href="http://ihacklog.com/linux/run-whireshark-as-non-root.html" title="以非root运行wireshark">以非root运行wireshark</a> (0)</li><li>2011年11月25日  //  <a href="http://ihacklog.com/php/wordpress/wpskills/use-separate-domain-name-for-attachment-and-main-site-in-wordpress.html" title="wordpress附件与博客主站域名分离">wordpress附件与博客主站域名分离</a> (9)</li><li>2010年05月2日  //  <a href="http://ihacklog.com/software/powerfulvim/vim-for-php-programmers.html" title="折腾vim">折腾vim</a> (2)</li><li>2008年12月9日  //  <a href="http://ihacklog.com/php/skills/use-htaccess-file-to-set-default-index-file.html" title="通过.htaccess 文件配置默认索引文件">通过.htaccess 文件配置默认索引文件</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://ihacklog.com/software/powerfulvim/vim-hightlight-match-parentheses.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

