<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[vim使用php自动完成功能]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Wed, 18 Feb 2009 11:08:07 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	说一下如何使用 Tab 键自动完成，按照习惯，Tab 键通常是用来缩进行的，如输入 4 个空格 如果要把 Tab 映射为自动完成，可能使用上稍微有点麻烦，下面会讲如何解决这个问题。<br/><br/>首先需要为 Vim 提供一个 PHP 的函数列表文件，这样 Vim 才能知道如何自动完成一个 PHP 函数。 函数列表不需要自己做，PHP 网站上有现成的，拿来用就可以了：<br/><br/>http://cvs.php.net/viewvc.cgi/phpdoc/funclist.txt<br/><br/>得到这个文件，直接拷贝到 Vim 目录中，比如根目录下面，然后在 vimrc 中加入如下代码， 告知 vim 在自动完成时，需要扫描这个文件来分析关键字。<br/><br/><br/>"You can obtain the completion dictionary file from:<br/>"&nbsp;&nbsp;http://cvs.php.net/viewvc.cgi/phpdoc/funclist.txt<br/>set dictionary-=/etc/vim/funclist.txt dictionary+=/etc/vim/funclist.txt<br/><br/>"Use the dictionary completion<br/>set complete-=k complete+=k<br/><br/>那么如何解决缩进的问题呢？我们肯定不愿意在映射另外一个键来做缩进用，感觉会很别扭。 下面的函数会解决这个问题。<br/><br/><br/>"Auto completion using the TAB key<br/>"This function determines, wether we are on<br/>"the start of the line text(then tab indents)<br/>"or if we want to try auto completion<br/>function! InsertTabWrapper()<br/>&nbsp;&nbsp;&nbsp;&nbsp;let col=col('.')-1<br/>&nbsp;&nbsp;&nbsp;&nbsp;if !col &#124;&#124; getline('.')[col-1] !~ '&#92;k'<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "&#92;<TAB>"<br/>&nbsp;&nbsp;&nbsp;&nbsp;else<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return "&#92;<C-N>"<br/>&nbsp;&nbsp;&nbsp;&nbsp;endif<br/>endfunction<br/><br/>"Remap the tab key to select action with InsertTabWrapper<br/>inoremap <TAB> <C-R>=InsertTabWrapper()<CR><br/><br/>这个函数的作用是判断当前光标前的一个字符是否为一个 Keyword 字符(:help iskeyword)，vim 中用 &#92;k 表示， 这个字符的范围大约是所有非空白的可打印的字符，但除开某些特殊字符，比如 @ * " 等等。<br/><br/>于是效果就出来了，当前导字符为空白或者 @ * 等字符时，Tab 就映射为 成为缩进键。 否则就映射为 ，也就是 CTRL+N 调用自动完成功能。<br/><br/>大约就是这样...<br/>
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] vim使用php自动完成功能]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>