<?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>Vimer的程序世界 &#187; Vim</title>
	<atom:link href="http://www.vimer.cn/category/vim/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vimer.cn</link>
	<description></description>
	<lastBuildDate>Thu, 17 May 2012 11:40:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>vim(gvim)支持对齐线</title>
		<link>http://www.vimer.cn/2012/05/vimgvim%e6%94%af%e6%8c%81%e5%af%b9%e9%bd%90%e7%ba%bf.html</link>
		<comments>http://www.vimer.cn/2012/05/vimgvim%e6%94%af%e6%8c%81%e5%af%b9%e9%bd%90%e7%ba%bf.html#comments</comments>
		<pubDate>Thu, 17 May 2012 11:40:36 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[colorcolumn]]></category>
		<category><![CDATA[Indent Guides]]></category>
		<category><![CDATA[vim-indent-guides]]></category>
		<category><![CDATA[vim对齐]]></category>
		<category><![CDATA[vim对齐线]]></category>
		<category><![CDATA[对齐线]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2546</guid>
		<description><![CDATA[前段时间有朋友在微博上@我推荐了一款vim的插件，用来显示对齐线，感觉效果不错，就给大家推荐一下. 下载链接: Indent Guides 截图如下: 一. 安装 不用多说，直接解压放到vimfiles or .vim下 二. 配... ]]></description>
			<content:encoded><![CDATA[<p>前段时间有朋友在微博上@我推荐了一款vim的插件，用来显示对齐线，感觉效果不错，就给大家推荐一下.<br />
下载链接: <a href="http://www.vim.org/scripts/script.php?script_id=3361" target="_blank" >Indent Guides</a></p>
<p>截图如下:</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2012/05/indentguide.png" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2012/05/indentguide.png" src="http://www.vimer.cn/wp-content/uploads/2012/05/indentguide.png" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p><b>一. 安装 </b><br />
不用多说，直接解压放到vimfiles or .vim下</p>
<p><b>二. 配置</b><br />
基本可以不用配置，不过由于默认的对齐线宽度太宽，不太美观，所以我改成1了，如下</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>indent_guides_guide_size=<span style="color: #000000; font-weight:bold;">1</span></pre></td></tr></table></div>

<p>详细的配置，可以参看他的文档，这里不再多说</p>
<p><b>三. 使用</b><br />
默认的键盘映射是</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">&lt;</span>mapleader<span style="color: #000000;">&gt;</span>ig</pre></td></tr></table></div>

<p>OK，插件就介绍到这里，其实如果只是单纯的介绍插件，就不用写这篇文章了。<br />
我在用这个插件的时候，又发现了另一个需求，即标尺的功能。vim7.3里面默认提供了colorcolumn，例如执行:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>set cc=<span style="color: #000000; font-weight:bold;">80</span></pre></td></tr></table></div>

<p>就可以高亮第80列，效果如下：</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2012/05/cc.png" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2012/05/cc.png" src="http://www.vimer.cn/wp-content/uploads/2012/05/cc.png" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>但是有时候我们想看一下几行的字符是不是在同一列上时，手工去输入列数实在太麻烦了，所以我就单独写了一个函数，来满足这个需求：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #25BB4D;">map</span> ,ch <span style="color: #000000;">:</span><span style="color: #804040;">call</span> SetColorColumn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&lt;</span>CR<span style="color: #000000;">&gt;</span>
<span style="color: #804040;">function</span><span style="color: #000000;">!</span> SetColorColumn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">let</span> col_num = <span style="color: #25BB4D;">virtcol</span><span style="color: #000000;">&#40;</span><span style="color: #C5A22D;">&quot;.&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">let</span> cc_list = <span style="color: #25BB4D;">split</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&amp;</span>cc, <span style="color: #C5A22D;">','</span><span style="color: #000000;">&#41;</span>
    <span style="color: #804040;">if</span> <span style="color: #25BB4D;">count</span><span style="color: #000000;">&#40;</span>cc_list, <span style="color: #25BB4D;">string</span><span style="color: #000000;">&#40;</span>col_num<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&lt;</span>= <span style="color: #000000; font-weight:bold;">0</span>
        <span style="color: #804040;">execute</span> <span style="color: #C5A22D;">&quot;set cc+=&quot;</span><span style="color: #000000;">.</span>col_num
    <span style="color: #804040;">else</span>
        <span style="color: #804040;">execute</span> <span style="color: #C5A22D;">&quot;set cc-=&quot;</span><span style="color: #000000;">.</span>col_num
    <span style="color: #804040;">endif</span>
endfunction</pre></td></tr></table></div>

<p>按下,ch 就可以将当前光标下的列高亮，再按下一次，取消高亮；并且可以同时多列高亮。</p>
<p>这两个工具搭配在一起使用，相信会取得更好的效果。</p>
<p>OK，就是这样~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2012/05/vimgvim%e6%94%af%e6%8c%81%e5%af%b9%e9%bd%90%e7%ba%bf.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Vim(gVim)对排序的妙用</title>
		<link>http://www.vimer.cn/2012/03/vimgvim%e5%af%b9%e6%8e%92%e5%ba%8f%e7%9a%84%e5%a6%99%e7%94%a8.html</link>
		<comments>http://www.vimer.cn/2012/03/vimgvim%e5%af%b9%e6%8e%92%e5%ba%8f%e7%9a%84%e5%a6%99%e7%94%a8.html#comments</comments>
		<pubDate>Fri, 09 Mar 2012 08:47:13 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vim中文]]></category>
		<category><![CDATA[排序]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2515</guid>
		<description><![CDATA[前段时间有博友在群里问了一个关于vim排序的问题，因为时间问题一直没帮忙解决，今天时间正好空出来，就帮忙搞了一下。 原文的问题如下: vimuser 说： 2012年03月1日 于 5:04 下午 (编辑) 今天... ]]></description>
			<content:encoded><![CDATA[<p>前段时间有博友在群里问了一个关于vim排序的问题，因为时间问题一直没帮忙解决，今天时间正好空出来，就帮忙搞了一下。</p>
<p>原文的问题如下:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">vimuser 说：
2012年03月1日 于 5:04 下午  (编辑)
今天折腾了一下午，研究vim的排序，看了教程和搜索了一些文档，还是没弄明白，vim的正则表达式跟一般的又不一样，来请教下博主。
&nbsp;
|1 | 11 | 111| 1111|
|2 | 22 | 222| 2222|
要根据第3个|和第4个|之间的列进行排序该如何写命令呢？</pre></div></div>

<p>其实之前也只是简单的用过vim的sort命令，没有想过vim是否能完成如此复杂的排序，不过抱着试试看的态度，我看了一下sort的描述(:h :sort)，其中一段话如下:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">:[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
&nbsp;
When /{pattern}/ is specified and there is no [r] flag
the text matched with {pattern} is skipped, so that
you sort on what comes after the match.
Instead of the slash any non-letter can be used.
For example, to sort on the second comma-separated
field:
    :sort /[^,]*,/</pre></div></div>

<p>翻译过来就是，sort确实可以指定跳过的字段，也就是说，我们只要能通过正则把</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">|1 | 11 | 
|2 | 22 |</pre></div></div>

<p>这一部分跳过就可以了~~</p>
<p>这部分的正则表达式是:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">|</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">^|</span><span style="color: #000000;">&#93;</span>\<span style="color: #000000;">+|</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">^|</span><span style="color: #000000;">&#93;</span>\<span style="color: #000000;">+</span>\s<span style="color: #000000;">*</span></pre></td></tr></table></div>

<p>所以最终的sort命令如下:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span><span style="color: #25BB4D;">sort</span> <span style="color: #000000;">/|</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">^|</span><span style="color: #000000;">&#93;</span>\<span style="color: #000000;">+|</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">^|</span><span style="color: #000000;">&#93;</span>\<span style="color: #000000;">+</span>\s<span style="color: #000000;">*/</span></pre></td></tr></table></div>

<p>原文给的例子不好看效果，我们改成如下的例子:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">|1 | 11 | 222| 1111|
|2 | 22 | 111| 2222|</pre></div></div>

<p>调用:sort命令的结果是和原来的样子一致的，而调用我们的新命令的结果是:</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">|2 | 22 | 111| 2222|
|1 | 11 | 222| 1111|</pre></div></div>

<p>OK，就这样~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2012/03/vimgvim%e5%af%b9%e6%8e%92%e5%ba%8f%e7%9a%84%e5%a6%99%e7%94%a8.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>css.vim bug修正</title>
		<link>http://www.vimer.cn/2012/02/css-vim-bug%e4%bf%ae%e6%ad%a3.html</link>
		<comments>http://www.vimer.cn/2012/02/css-vim-bug%e4%bf%ae%e6%ad%a3.html#comments</comments>
		<pubDate>Sun, 12 Feb 2012 10:20:26 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[css.vim]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2485</guid>
		<description><![CDATA[过年回来也一直没发博客，其实东西还是搞了不少的，挨个给大家分享一下吧 今年过年回家恶补了一下js和css，发现vim的 css.vim 在处理着色的时候有bug，描述如下: 如果是如下css代码: 1 #menu ul li... ]]></description>
			<content:encoded><![CDATA[<p>过年回来也一直没发博客，其实东西还是搞了不少的，挨个给大家分享一下吧</p>
<p>今年过年回家恶补了一下js和css，发现vim的 <a href="http://www.vim.org/scripts/script.php?script_id=2150" target="_blank" >css.vim</a> 在处理着色的时候有bug，描述如下:</p>
<p>如果是如下css代码:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#menu</span> ul li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#eee</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>则原版的css.vim 无法在同一行上显示两种颜色(#eee和#ccc)，所以笔者修改了css.vim的代码，放出下载如下:<br />
<a href="http://vimercode.googlecode.com/svn/trunk/css.vim/css.vim" target="_blank" >http://vimercode.googlecode.com/svn/trunk/css.vim/css.vim</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2012/02/css-vim-bug%e4%bf%ae%e6%ad%a3.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>用Vim(gVim)发腾讯微博-weibo.vim</title>
		<link>http://www.vimer.cn/2011/12/%e7%94%a8vimgvim%e5%8f%91%e8%85%be%e8%ae%af%e5%be%ae%e5%8d%9a.html</link>
		<comments>http://www.vimer.cn/2011/12/%e7%94%a8vimgvim%e5%8f%91%e8%85%be%e8%ae%af%e5%be%ae%e5%8d%9a.html#comments</comments>
		<pubDate>Thu, 08 Dec 2011 10:40:56 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2433</guid>
		<description><![CDATA[前言： 好久没写Vim插件了，这次给Vimer们带来个好福利！-- 用Vim（gVim）发腾讯微博 昨晚折腾了大半夜，总算成功实现！~~ 当然，代价就是今天头痛的厉害…… 昨天突发奇想，当我用vim读文档... ]]></description>
			<content:encoded><![CDATA[<p><b>前言：</b></p>
<ul>
<li>
    好久没写Vim插件了，这次给Vimer们带来个好福利！-- <b>用Vim（gVim）发腾讯微博</b>
    </li>
<li>
    昨晚折腾了大半夜，总算成功实现！~~ 当然，代价就是今天头痛的厉害……
    </li>
</ul>
<p>昨天突发奇想，当我用vim读文档，看代码的时候，如果有一段我觉得特别好，想要分享给大家，有没有快捷点的方式呢？</p>
<p>所以需求也就来了，在Vim里面分享内容~而目前用的最广的，自然是微博~（由于笔者只用腾讯微博，所以只实现了腾讯微博……）</p>
<p><b>细化一下功能:</b></p>
<ol>
<li>分享文章中的一段文字，并支持评论</li>
<li>直接发送微博</li>
</ol>
<p>如果你读这篇文章比较早，应该还能看到页面右侧的微博里有这条微博：</p>

<div class="wp_syntax"><div class="code"><pre class="txt" style="font-family:monospace;">花了一晚上，终于把用vim发腾讯微博给折腾出来了，明天写博客跟大家分享，敬请期待！ 来自weibo.vim</pre></div></div>

<p><b>在正式开始介绍之前，声明一下: </b></p>
<ol>
<li>
文中所使用的QQ登录的API均为对外公开的API，不存在任何使用保密API的问题
</li>
<li>
笔者是用 vimer.cn 来申请了 QQ登录，但是access_token在生成之后，笔者不会对这个信息做任何保存，如果有所怀疑，请不要使用。
</li>
<li>
weibo.vim插件本身不会主动发起任何发送微博的操作
</li>
</ol>
<p>OK，废话不多说，开始介绍吧</p>
<p><b>一. 环境依赖</b></p>
<ol>
<li>python</li>
</ol>
<p><b>二. 安装</b></p>
<ol>
<li>
    去 <a href="http://www.vim.org/scripts/script.php?script_id=3839" target="_blank" >http://www.vim.org/scripts/script.php?script_id=3839</a> 下载 <a href="http://www.vim.org/scripts/script.php?script_id=3839" target="_blank" >weibo.vim</a>
    </li>
<li>
    将 <a href="http://www.vim.org/scripts/script.php?script_id=3839" target="_blank" >weibo.vim</a> 放在 plugin目录
    </li>
</ol>
<p><b>三. 配置</b><br />
目前支持的配置如下:</p>
<ul>
<li>
g:weibo_access_token        oauth2.0的access_token，是由QQ登录提供的授权token，貌似过期时间是1个月。后面会写出获取这个token的方法。
</li>
<li>
g:weibo_access_token        签名档，默认值是“来自weibo.vim”，如果不喜欢可以配置为空
</li>
</ul>
<p>在_vimrc中配置:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>weibo_access_token = <span style="color: #C5A22D;">'第四步会生成的access_token'</span></pre></td></tr></table></div>

<p><b>四. 生成access_token</b></p>
<ol>
<li>
点击如下链接:
</li>
<p><a href="https://graph.qq.com/oauth2.0/authorize?response_type=token&#038;client_id=100229856&#038;redirect_uri=vimer.cn&#038;scope=add_t" target="_blank" >生成access_token</a></p>
<li>
在进行QQ登录之后，会跳转到类似如下链接:
</li>
<p>http://www.vimer.cn/#access_token=4E6421B8719124324217AF48E085F&#038;expires_in=7776000</p>
<p>其中access_token=后面的即要获取的access_token。</p>
<li>
将其配置到第二步的g:weibo_access_token中。
</li>
</ol>
<p>如果在使用中，提示 access_token 过期的话，只要按照上面的步骤重新申请一遍即可。</p>
<p><b>五. 命令</b></p>
<ol>
<li>分享选中的的文字</li>
<p>    选中要分享的文字后，按下 “,at”， 如果不需要写评论，则直接回车；如果需要评论，则输入空格后，输入评论，回车。</p>
<li>直接发送微博</li>
<p>    在normal模式下，直接按下 “,at”， 输入空格后，输入文字，回车。
</ol>
<p>OK，就是这样，enjoy it！</p>
<p>最后再贴一下下载地址:<br />
<a href="http://www.vim.org/scripts/script.php?script_id=3839" target="_blank" >http://www.vim.org/scripts/script.php?script_id=3839</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/12/%e7%94%a8vimgvim%e5%8f%91%e8%85%be%e8%ae%af%e5%be%ae%e5%8d%9a.html/feed</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>vim(gVim)统计字节、字符数</title>
		<link>http://www.vimer.cn/2011/11/vimgvim%e7%bb%9f%e8%ae%a1%e5%ad%97%e8%8a%82%e3%80%81%e5%ad%97%e7%ac%a6%e6%95%b0.html</link>
		<comments>http://www.vimer.cn/2011/11/vimgvim%e7%bb%9f%e8%ae%a1%e5%ad%97%e8%8a%82%e3%80%81%e5%ad%97%e7%ac%a6%e6%95%b0.html#comments</comments>
		<pubDate>Wed, 02 Nov 2011 11:51:50 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[字符数]]></category>
		<category><![CDATA[字节数]]></category>
		<category><![CDATA[统计]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2390</guid>
		<description><![CDATA[前段时间在做文件扫描的时候，有一些关于字节、字符数统计的需求，考虑到有同学也可能用的到，所以整理一下记录在这里。 1.统计当前字符之前的所有字节数 1 command! -nargs=0 CountBytesBack :norm... ]]></description>
			<content:encoded><![CDATA[<p>前段时间在做文件扫描的时候，有一些关于字节、字符数统计的需求，考虑到有同学也可能用的到，所以整理一下记录在这里。</p>
<p><b>1.统计当前字符之前的所有字节数</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #668080;">command</span><span style="color: #000000;">!</span> <span style="color: #668080;">-nargs</span>=<span style="color: #000000; font-weight:bold;">0</span> CountBytesBack        <span style="color: #000000;">:</span>normal mxvgg<span style="color: #C5A22D;">&quot;ay`x:echo strlen(@a)&lt;CR&gt;</span></pre></td></tr></table></div>

<p><b>2.统计当前字符之后的所有字节数</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #668080;">command</span><span style="color: #000000;">!</span> <span style="color: #668080;">-nargs</span>=<span style="color: #000000; font-weight:bold;">0</span> CountBytesForward     <span style="color: #000000;">:</span>normal mxv<span style="color: #000000;">$</span>G<span style="color: #C5A22D;">&quot;ay`x:echo strlen(@a)&lt;CR&gt;</span></pre></td></tr></table></div>

<p><b>3.统计当前文件所有字节数</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #668080;">command</span><span style="color: #000000;">!</span> <span style="color: #668080;">-nargs</span>=<span style="color: #000000; font-weight:bold;">0</span> CountBytesAll         <span style="color: #000000;">:</span>normal mxggVG<span style="color: #C5A22D;">&quot;ay`x:echo strlen(@a)&lt;CR&gt;</span></pre></td></tr></table></div>

<p><b>4.统计当前文件所有字符数</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #668080;">command</span><span style="color: #000000;">!</span> <span style="color: #668080;">-nargs</span>=<span style="color: #000000; font-weight:bold;">0</span> CountCharsAll         <span style="color: #000000;">:%</span>s<span style="color: #000000;">/./&amp;/</span>gn<span style="color: #000000;">|</span>noh</pre></td></tr></table></div>

<p><b>5.统计当前文件所有单词数</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #668080;">command</span><span style="color: #000000;">!</span> <span style="color: #668080;">-nargs</span>=<span style="color: #000000; font-weight:bold;">0</span> CountWordsAll         <span style="color: #000000;">:%</span>s<span style="color: #000000;">/</span>\i\<span style="color: #000000;">+/&amp;/</span>gn<span style="color: #000000;">|</span>noh</pre></td></tr></table></div>

<p><span style="text-decoration: line-through">统计当前字符前、后的字符数，暂时没有比较好的实现，因为vim的s命令都是基于行的，如果有朋友有解决方案，欢迎不吝告知~~多谢~<SPAN></p>
<p>感谢依云的帮助，vim确实已经帮忙考虑到了这一点，具体方法如下:</p>
<ol>
<li>选择需要统计的文本</li>
<li>按下 g&lt;C-g&gt;</li>
</ol>
<p>即会显示需要的统计信息。如果想到对信息进行解析，可以通过:redir命令传到变量中</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/11/vimgvim%e7%bb%9f%e8%ae%a1%e5%ad%97%e8%8a%82%e3%80%81%e5%ad%97%e7%ac%a6%e6%95%b0.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>糗事百科网站改版，对应qiushibaike.vim插件升级</title>
		<link>http://www.vimer.cn/2011/09/%e7%b3%97%e4%ba%8b%e7%99%be%e7%a7%91%e7%bd%91%e7%ab%99%e6%94%b9%e7%89%88%ef%bc%8c%e5%af%b9%e5%ba%94qiushibaike-vim%e6%8f%92%e4%bb%b6%e5%8d%87%e7%ba%a7.html</link>
		<comments>http://www.vimer.cn/2011/09/%e7%b3%97%e4%ba%8b%e7%99%be%e7%a7%91%e7%bd%91%e7%ab%99%e6%94%b9%e7%89%88%ef%bc%8c%e5%af%b9%e5%ba%94qiushibaike-vim%e6%8f%92%e4%bb%b6%e5%8d%87%e7%ba%a7.html#comments</comments>
		<pubDate>Thu, 29 Sep 2011 10:56:46 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[qb]]></category>
		<category><![CDATA[qiushibaike]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[升级]]></category>
		<category><![CDATA[糗事百科]]></category>
		<category><![CDATA[糗事百科改版]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2370</guid>
		<description><![CDATA[前不久糗百改版，所以原有的qiushibaike.vim插件用起来会有一些问题，今天有时间就修改了一下. 如图: 下载地址: http://www.vim.org/scripts/script.php?script_id=3083 有不清楚的朋友可以到 用Vim(gvim)看糗事... ]]></description>
			<content:encoded><![CDATA[<p>前不久糗百改版，所以原有的<a href="http://www.vim.org/scripts/script.php?script_id=3083" target="_blank" >qiushibaike.vim</a>插件用起来会有一些问题，今天有时间就修改了一下.</p>
<p>如图:</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2010/05/qiushi.png" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2010/05/qiushi.png" src="http://www.vimer.cn/wp-content/uploads/2010/05/qiushi.png" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>下载地址: <a href="http://www.vim.org/scripts/script.php?script_id=3083" target="_blank" >http://www.vim.org/scripts/script.php?script_id=3083</a></p>
<p>有不清楚的朋友可以到 <a href="http://www.vimer.cn/2010/05/%E7%94%A8vimgvim%E7%9C%8B%E7%B3%97%E4%BA%8B%E7%99%BE%E7%A7%91.html" target="_blank" >用Vim(gvim)看糗事百科</a>查看说明。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/09/%e7%b3%97%e4%ba%8b%e7%99%be%e7%a7%91%e7%bd%91%e7%ab%99%e6%94%b9%e7%89%88%ef%bc%8c%e5%af%b9%e5%ba%94qiushibaike-vim%e6%8f%92%e4%bb%b6%e5%8d%87%e7%ba%a7.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Vi-查询卡片</title>
		<link>http://www.vimer.cn/2011/07/vi-%e6%9f%a5%e8%af%a2%e5%8d%a1%e7%89%87.html</link>
		<comments>http://www.vimer.cn/2011/07/vi-%e6%9f%a5%e8%af%a2%e5%8d%a1%e7%89%87.html#comments</comments>
		<pubDate>Sat, 09 Jul 2011 18:10:50 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vi查询卡片]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2258</guid>
		<description><![CDATA[本文来自于Unix对话录的博主刺猬的投稿。 很高兴有朋友能够制作这样的翻译作品来分享给大家，笔者也仔细看了一下，都是些非常常用的命令，因此对Vim初学者应该会很有帮助。 截一部分图... ]]></description>
			<content:encoded><![CDATA[<p>本文来自于<a href="http://www.talk2unix.com/" target="_blank" >Unix对话录</a>的博主刺猬的投稿。</p>
<p>很高兴有朋友能够制作这样的翻译作品来分享给大家，笔者也仔细看了一下，都是些非常常用的命令，因此对Vim初学者应该会很有帮助。</p>
<p>截一部分图给大家预览一下，如果觉得不错请点击<a href="http://www.vimer.cn/wp-content/uploads/2011/07/Vi-查询卡片.pdf" target="_blank" >这里</a>下载。</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/07/preview.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/07/preview.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/07/preview.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/07/vi-%e6%9f%a5%e8%af%a2%e5%8d%a1%e7%89%87.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>vimgtd-在vim(gvim)中实现GTD时间管理！【本博原创插件】</title>
		<link>http://www.vimer.cn/2011/06/vimgtd-%e5%9c%a8vimgvim%e4%b8%ad%e5%ae%9e%e7%8e%b0gtd%ef%bc%81%e3%80%90%e6%9c%ac%e5%8d%9a%e5%8e%9f%e5%88%9b%e6%8f%92%e4%bb%b6%e3%80%91.html</link>
		<comments>http://www.vimer.cn/2011/06/vimgtd-%e5%9c%a8vimgvim%e4%b8%ad%e5%ae%9e%e7%8e%b0gtd%ef%bc%81%e3%80%90%e6%9c%ac%e5%8d%9a%e5%8e%9f%e5%88%9b%e6%8f%92%e4%bb%b6%e3%80%91.html#comments</comments>
		<pubDate>Sun, 26 Jun 2011 15:34:21 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[GTD]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[snipmate]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[vim 时间管理]]></category>
		<category><![CDATA[vimgtd]]></category>
		<category><![CDATA[vimwiki]]></category>
		<category><![CDATA[vim时间管理]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2222</guid>
		<description><![CDATA[emacs中有gtd模式，那vim是不是也可以实现呢？当然可以！ 只要搭配vimwiki和snipmate，再加上笔者写的插件vimgtd，就可以完美实现gtd的功能，目前实现的功能如下: 查看今天待完成的任务 查看所有... ]]></description>
			<content:encoded><![CDATA[<p>emacs中有gtd模式，那vim是不是也可以实现呢？当然可以！<br />
只要搭配<a href="http://www.vim.org/scripts/script.php?script_id=2226" target="_blank" >vimwiki</a>和<a href="http://www.vim.org/scripts/script.php?script_id=2540" target="_blank" >snipmate</a>，再加上笔者写的插件<a href="http://www.vim.org/scripts/script.php?script_id=3644" target="_blank" >vimgtd</a>，就可以完美实现gtd的功能，目前实现的功能如下:</p>
<ol>
<li>查看今天待完成的任务</li>
<li>查看所有待完成的任务</li>
<li>查看过去某天已完成的任务</li>
<li>快捷创建任务，标记为已完成</li>
<li>以不同的颜色标识 未开始、进行中、过期、已完成 状态的任务</li>
</ol>
<p><b>一.安装方法</b></p>
<ul>
<li>
    安装依赖:<br />
    <a href="http://www.vim.org/scripts/script.php?script_id=2226" target="_blank" >vimwiki</a><br />
    <a href="http://www.vim.org/scripts/script.php?script_id=2540" target="_blank" >snipmate</a>
    </li>
<li>
    安装步骤:</p>
<ol>
<li>到<a href="http://www.vim.org/scripts/script.php?script_id=3644" target="_blank" >http://www.vim.org/scripts/script.php?script_id=3644</a>下载本博编写的<a href="http://www.vim.org/scripts/script.php?script_id=3644" target="_blank" >vimgtd</a>，并解压到vimfile 或者 .vim目录</li>
<li>安装好vimwiki和snipmate</li>
<li>OK啦！</li>
</ol>
</li>
</ul>
<p><b>二.使用说明</b></p>
<p>如功能列表里面提到的，我们一步步来操作</p>
<ul>
<li>
        <b>查看今天要完成的任务列表</b></p>
<p>        输入如下命令:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>TaskToday</pre></td></tr></table></div>

<p>        此时的界面应该是空的，因为我们还没有创建任何任务。现在在编辑区输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;">tpl</pre></td></tr></table></div>

<p>        并按tab键，将会出现如下内容:</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/06/v1.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/06/v1.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/06/v1.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>        在inbox下输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">*</span></pre></td></tr></table></div>

<p>        并按tab键，之后再输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;">task</pre></td></tr></table></div>

<p>        将会出现如下内容</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/06/x2.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/06/x2.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/06/x2.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>        然后就可以编辑任务的内容了</p>
<p>        这个时候，我们再输入</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>TaskToday</pre></td></tr></table></div>

<p>        将会看到如下界面:</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/06/x3.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/06/x3.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/06/x3.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
</li>
<li>
        <b>同样的，查看所有待完成的命令是:</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>TaskAll</pre></td></tr></table></div>

<p>        查看过去某天完成的任务的命令是:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>TaskDoneOrDoingByDate <span style="color: #000000;">&#123;</span>date<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>        如</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>TaskDoneOrDoingByDate <span style="color: #000000; font-weight:bold;">2011</span><span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">6</span><span style="color: #000000;">-</span><span style="color: #000000; font-weight:bold;">1</span></pre></td></tr></table></div>

</li>
<li>
        <b>标记任务为已完成的命令为:</b></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>TaskToggle</pre></td></tr></table></div>

</li>
</ul>
<p>最后，贴一张我在日常使用中的图片:</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/06/x5.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/06/x5.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/06/x5.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>OK，基本就是这样啦，更多的功能就由大家自己来体验吧！也欢迎大家多多提建议！</p>
<hr />
ps：<br />
刚刚偶尔发现 <a href="http://www.vim.org" target="_blank" >www.vim.org</a>上有一个记便签的插件，试用了一下还不错，有兴趣的朋友可以试一下：<br />
<a href="http://www.vim.org/scripts/script.php?script_id=3375" target="_blank" >notes.vim</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/06/vimgtd-%e5%9c%a8vimgvim%e4%b8%ad%e5%ae%9e%e7%8e%b0gtd%ef%bc%81%e3%80%90%e6%9c%ac%e5%8d%9a%e5%8e%9f%e5%88%9b%e6%8f%92%e4%bb%b6%e3%80%91.html/feed</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>更适合面向对象语言使用的显示函数列表插件-tagbar.vim</title>
		<link>http://www.vimer.cn/2011/03/%e6%9b%b4%e9%80%82%e5%90%88%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1%e8%af%ad%e8%a8%80%e4%bd%bf%e7%94%a8%e7%9a%84%e6%98%be%e7%a4%ba%e5%87%bd%e6%95%b0%e5%88%97%e8%a1%a8%e6%8f%92%e4%bb%b6-tagbar-vim.html</link>
		<comments>http://www.vimer.cn/2011/03/%e6%9b%b4%e9%80%82%e5%90%88%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1%e8%af%ad%e8%a8%80%e4%bd%bf%e7%94%a8%e7%9a%84%e6%98%be%e7%a4%ba%e5%87%bd%e6%95%b0%e5%88%97%e8%a1%a8%e6%8f%92%e4%bb%b6-tagbar-vim.html#comments</comments>
		<pubDate>Fri, 25 Mar 2011 16:03:37 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[tagbar]]></category>
		<category><![CDATA[taglist]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2066</guid>
		<description><![CDATA[之前在www.vim.org上逛，很惊讶于一个刚发布的插件居然就能获得100多的评分，很是吃惊，看了介绍才知道居然是一个类taglist的插件，并且弥补了一些taglist未曾解决的缺陷。 链接如下: Tagbar 我们... ]]></description>
			<content:encoded><![CDATA[<p>之前在<a href="http://www.vim.org" target="_blank" >www.vim.org</a>上逛，很惊讶于一个刚发布的插件居然就能获得100多的评分，很是吃惊，看了介绍才知道居然是一个类taglist的插件，并且弥补了一些taglist未曾解决的缺陷。<br />
链接如下:<br />
<a href="http://www.vim.org/scripts/script.php?script_id=3465" target="_blank" >Tagbar</a></p>
<p>我们以C++的头文件和实现文件为例，用图片来直观的比较一下与taglist.vim的区别。<br />
首先是头文件，代码如下:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">class</span> CTestTagBar
<span style="color: #008000;">&#123;</span>
<span style="color: #0000ff;">public</span><span style="color: #008080;">:</span>
    CTestTagBar<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
    <span style="color: #0000ff;">virtual</span> ~CTestTagBar<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">protected</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">int</span> GetName<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">bool</span> bOpen<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">private</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">int</span> _init<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> timeout<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
&nbsp;
<span style="color: #0000ff;">private</span><span style="color: #008080;">:</span>
    <span style="color: #0000ff;">int</span> m_ret<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span><span style="color: #008080;">;</span></pre></td></tr></table></div>

<p>截图如下，其中左边的是taglist，右边的是tagbar。</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/03/1.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/03/1.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/03/1.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>然后是cpp文件，代码如下:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #339900;">#include &quot;test_tagbar.h&quot;</span>
CTestTagBar<span style="color: #008080;">::</span><span style="color: #007788;">CTestTagBar</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span>
CTestTagBar<span style="color: #008080;">::</span>~CTestTagBar<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">int</span> CTestTagBar<span style="color: #008080;">::</span><span style="color: #007788;">GetName</span><span style="color: #008000;">&#40;</span><span style="color: #0000ff;">bool</span> bOpen<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">int</span> CTestTagBar<span style="color: #008080;">::</span>_init<span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> timeout<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span><span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>截图如下，也是左边taglist，右边tagbar。</p>
<p><a href="http://www.vimer.cn/wp-content/uploads/2011/03/2.jpg" target="_blank" ><img title="http://www.vimer.cn/wp-content/uploads/2011/03/2.jpg" src="http://www.vimer.cn/wp-content/uploads/2011/03/2.jpg" width="570" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" alt="1" border="0" /></a></p>
<p>OK，相信大家一眼就能看出来tagbar与taglist关注点的区别。笔者通过自身的使用，简单的列了几点比taglist优化了的地方。</p>
<ul>
<li>1.支持头文件的函数列表显示</li>
<p>    细心的读者可能会发现，tagbar对函数的可见级别也是做了区分的，分别用+ - # 并配合着色来做了区分</p>
<li>2.对面向对象的支持更好</li>
<p>    taglist虽然也会列出类列表，但是整体还是很不直观</p>
<li>3.自动根据文件修改时间来重建</li>
<p>    taglist在这一点上体验就很不好，其实明明可以通过这种时间戳的方式来实现
</ul>
<p>既然tagbar有这么多好处，那我们就赶紧看看怎么用吧~</p>
<ul>
<li>1.在官网上下载tagbar.vba文件，并执行:so %</li>
<li>2.在vimrc中加入如下配置</li>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="vim" style="font-family:monospace;">    nmap <span style="color: #000000;">&lt;</span>silent<span style="color: #000000;">&gt;</span> <span style="color: #000000;">&lt;</span>F4<span style="color: #000000;">&gt;</span> <span style="color: #000000;">:</span>TagbarToggle<span style="color: #000000;">&lt;</span>CR<span style="color: #000000;">&gt;</span>
    <span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>tagbar_ctags_bin = <span style="color: #C5A22D;">'ctags'</span>
    <span style="color: #804040;">let</span> g<span style="color: #000000;">:</span>tagbar_width = <span style="color: #000000; font-weight:bold;">30</span></pre></td></tr></table></div>

<li>3.按下F4即可显示列表</li>
</ul>
<p>OK，就这么简单！赶紧去试试吧！</p>
<p>好吧，说完了这么多优点，我还是不得不提几个缺点:</p>
<ul>
<li>1.文件不支持中文路径</li>
<p>    这个其实taglist也有这个问题，笔者做了一个fix过之后的版本，放在<a href="http://code.google.com/p/vimercode/source/browse/#svn%2Ftrunk%2Ftagbar" target="_blank" >这里</a>，大家有兴趣可以自行下载。</p>
<li>2.bug较多</li>
<p>    可能由于刚刚发布不久，所以感觉bug还是有点多，希望能尽快fix掉。
</ul>
<p>希望插件的作者能够尽快fix掉这些问题，超过taglist，指日可待！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/03/%e6%9b%b4%e9%80%82%e5%90%88%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1%e8%af%ad%e8%a8%80%e4%bd%bf%e7%94%a8%e7%9a%84%e6%98%be%e7%a4%ba%e5%87%bd%e6%95%b0%e5%88%97%e8%a1%a8%e6%8f%92%e4%bb%b6-tagbar-vim.html/feed</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>无所不能的vim-vim到底能做什么</title>
		<link>http://www.vimer.cn/2011/03/%e6%97%a0%e6%89%80%e4%b8%8d%e8%83%bd%e7%9a%84vim-vim%e5%88%b0%e5%ba%95%e8%83%bd%e5%81%9a%e4%bb%80%e4%b9%88.html</link>
		<comments>http://www.vimer.cn/2011/03/%e6%97%a0%e6%89%80%e4%b8%8d%e8%83%bd%e7%9a%84vim-vim%e5%88%b0%e5%ba%95%e8%83%bd%e5%81%9a%e4%bb%80%e4%b9%88.html#comments</comments>
		<pubDate>Sat, 05 Mar 2011 13:35:34 +0000</pubDate>
		<dc:creator>Dante</dc:creator>
				<category><![CDATA[Vim]]></category>
		<category><![CDATA[ctags]]></category>
		<category><![CDATA[gvim]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.vimer.cn/?p=2026</guid>
		<description><![CDATA[其实很早就想写这篇文章了，虽然晚上介绍vim的文章很多，本博也已经就vim的使用写了70多篇博文，但是由于历史的原因，还有很多人对vim能做什么存在误解，包括: vim对中文支持不好 vim适合临... ]]></description>
			<content:encoded><![CDATA[<p>其实很早就想写这篇文章了，虽然晚上介绍vim的文章很多，本博也已经就vim的使用写了70多篇博文，但是由于历史的原因，还有很多人对vim能做什么存在误解，包括:</p>
<ul>
<li>vim对中文支持不好</li>
<li>vim适合临时编辑文本，对IDE的支持不好</li>
<li>vim的内嵌脚本语言不够强大，不像emacs的lisp那样无所不能</li>
</ul>
<p>我不知道提出这些论断的人是因为不了不了解vim的现状，还是是对vim心存偏见。本博在写vim相关文章的时候，一直坚持只谈技术的原则，不会涉及到与其他编辑器尤其是emacs的任何比较，然而最近在看了某些博文之后，觉得为了不让某些已经过时的观点给初学者选择编辑器时造成困扰，写下这篇文章十分必要。</p>
<p>OK，我们正式开始，在文章的末尾，相信大家都会明白上面的几个观点是否正确。</p>
<p><b>一.普通人的编辑利器</b></p>
<ul>
    之所以第一点就提到这个，是因为"文字处理"当然是一个编辑器最基本的功能，而能把编辑的体验发挥到极致的也恐怕只有vim而已了。<br />
    这一节，也会参考<a href="http://xbeta.info" target="_blank" >善用佳软</a>对vim的使用心得，相信用户的感受是最好的证明。</p>
<li>1.免费</li>
<p>    用户再也不用去网上辛苦的下载D版了！</p>
<li>2.提高输入速度</li>
<p>    这个相信也没有什么好争论的，纯键盘操作的速度是鼠标无法比拟的，虽然会带来一定的学习成本，但是相信还是值得的。</p>
<li>3.完美支持中文，并支持多种文件编码</li>
<p>    很多编辑器会有处理多字节编码的问题，而vim完美解决了这一点。（如果你的vim没解决，请参考<a href="http://www.vimer.cn/2010/03/linux%E4%B8%8Bvim%E7%9A%84%E7%BC%96%E8%AF%91%E4%BB%A5%E5%8F%8A%E7%BB%88%E7%AB%AF%E4%B9%B1%E7%A0%81%E7%9A%84%E6%9C%80%E7%BB%88%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88.html" target="_blank" >linux下vim的编译以及终端乱码的最终解决方案</a>）</p>
<li>4.文本笔记管理</li>
<p>    这要归功于vim的一款插件:voom,详情可以参考善用佳软的这篇博文--<a href="http://xbeta.info/vim-voof.htm" target="_blank" >VOoM(原VOOF)：vim实现带折叠双栏树状文本管理</a>
</ul>
<p><b>二.程序员的编辑利器</b></p>
<ul>
    如果你是一名程序员，那就千万不要错过vim，它真的为程序员提供了太多贴心的功能。</p>
<li>1.支持几乎所有语言类型</li>
<p>    不夸张的说，vim真的是将这一点做到了极致，只要是大家知道的语言，大到c++，python，小到bash,sql，vim全部都默认支持了这些语言的语法高亮，自动缩进，等等。一个编辑器搞定所有源码编写，不用为每门语言学习他的编辑器，降低学习成本，何乐而不为？</p>
<li>2.支持各种语言的代码自动补全和智能提示</li>
<p>    详见:<a href="http://www.vimer.cn/2010/01/vim%E6%89%80%E6%94%AF%E6%8C%81%E7%9A%84%E8%87%AA%E5%8A%A8%E5%AE%8C%E6%88%90%E8%AF%A6%E8%A7%A3.html" target="_blank" >vim所支持的自动完成详解</a>，<a href="http://www.vimer.cn/2009/10/%E6%8A%8Avim%E6%89%93%E9%80%A0%E6%88%90%E4%B8%80%E4%B8%AA%E7%9C%9F%E6%AD%A3%E7%9A%84ide3.html" target="_blank" >把VIM打造成一个真正的IDE(3)</a></p>
<li>3.快速查找函数定义功能及显示函数列表功能</li>
<p>    vim+tags+taglist即可轻松实现上面的功能，功能上完全可以替代si或者vs.详见:<a href="http://www.vimer.cn/2009/10/%E6%8A%8Avim%E6%89%93%E9%80%A0%E6%88%90%E4%B8%80%E4%B8%AA%E7%9C%9F%E6%AD%A3%E7%9A%84ide2.html" target="_blank" >把VIM打造成一个真正的IDE(2)</a>，<a href="http://www.vimer.cn/2009/10/%E5%9C%A8vim%E4%B8%AD%E4%BD%BF%E7%94%A8ctags.html" target="_blank" >在Vim中使用ctags</a></p>
<li>4.支持类似textmate的代码片段功能</li>
<p>    我目前使用的是<a href="http://www.vim.org/scripts/script.php?script_id=2540" target="_blank" >snipMate</a>，当然提供这种功能的插件可不只这一个，你可以有更多选择~</p>
<li>5.集成编译调试功能，快速定位编译错误</li>
<p>    vim提供了quickfix的功能，可以集成gcc，g++，java，c#，python，php等各种语言的错误定位功能，极大提高了代码编译调试时的错误定位。参见:<a href="http://www.vimer.cn/2009/10/11.html" target="_blank" >VIM-一键编译单个源文件</a></p>
<li>6.开源</li>
<p>    如果发现vim有bug，那么大可以自己去研究代码修复~</p>
<li>7.跨平台</li>
<p>    在linux,windows,mac等多平台都有相应的版本，不用担心跨平台开发的问题！</p>
<li>8.支持插件，无限扩展自己想要的功能</li>
<p>    vim本身有自己的脚本语言，如果你真的不想再多学一门语言，那也不是什么大事，gvim7.3已经默认编译支持了python,ruby,lua,perl等等脚本语言，用你喜欢的脚本语言开发去吧！（我爱python！），与emacs的lisp相比，vim自身的脚本语言确实有所欠缺，但是python较之lisp也算是旗鼓相当了吧
</ul>
<p><b>三.vim骨灰级玩家的超级终端</b></p>
<ul>
    这是我几个月来一直试图总结的结论，也是vim发展至今我认为颠覆性的一个大特性。<br />
    其实在我现在看来，vim更像是一个超级终端，vim已经支持用python,lua,perl,ruby等多种脚本语言进行脚本编写，只要你愿意，你可以用脚本语言实现任何你想要的功能，然后通过vim展示出来。<br />
    简单来说，即vim替你实现了一个通用的界面，而你只需要编写你的逻辑代码，而展现到屏幕这一层，就调用vim的接口，由vim来完成就可以了~<br />
    这就是我所说的超级终端的定义，如果还是不能理解，那我们就用实例来说明吧！</p>
<li>1.<a href="http://www.vim.org/scripts/script.php?script_id=1953" target="_blank" >Vimpress</a>，提供在vim中查看、发布、修改、删除博客的功能</li>
<li>2.<a href="http://vim.sourceforge.net/scripts/script.php?script_id=2204" target="_blank" >TwitVim</a>，提供在vim查看、发布、修改、删除twitter的功能</li>
<li>3.<a href="http://www.vim.org/scripts/script.php?script_id=2226&#038;rating=life_changing" target="_blank" >vimwiki</a>，用vim打造你的个人wiki~</li>
<li>4.<a href="http://www.vim.org/scripts/script.php?script_id=3083" target="_blank" >qiushibaike</a>，在vim中看糗事百科（本博编写）</li>
<li>5.<a href="http://www.vim.org/scripts/script.php?script_id=52" target="_blank" >Calendar</a>，提供日历的功能，并且可以记笔记</li>
<li>6.<a href="http://www.vim.org/scripts/script.php?script_id=26" target="_blank" >vimmailr</a>，用vim来发邮件，参见:<a href="http://www.vimer.cn/2010/04/%E7%94%A8vimgvim%E5%8F%91%E9%82%AE%E4%BB%B6%E4%B8%8A%E6%B5%81%E5%93%87.html" target="_blank" >用Vim(gvim)发邮件(上流哇)</a></li>
</ul>
<p>OK，到此为止就结束啦~对照文章开头的那些所谓vim的不足，是否有了新的认识呢？<br />
然而其实vim所能做的远不止这么点，只要你肯去发掘，你会发现vim真的远超乎你的想象！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vimer.cn/2011/03/%e6%97%a0%e6%89%80%e4%b8%8d%e8%83%bd%e7%9a%84vim-vim%e5%88%b0%e5%ba%95%e8%83%bd%e5%81%9a%e4%bb%80%e4%b9%88.html/feed</wfw:commentRss>
		<slash:comments>98</slash:comments>
		</item>
	</channel>
</rss>

