From 8960e8a7feff0069040a46ae349ecb8ff1470776 Mon Sep 17 00:00:00 2001 From: codepiano Date: Tue, 10 Dec 2013 21:24:21 +0800 Subject: [PATCH 1/5] clean for new user --- CNAME | 1 - README.md | 8 +- Rakefile | 6 +- _config.yml | 12 +- _includes/codepiano/analytics | 14 - .../codepiano/analytics-providers/google | 11 - _includes/codepiano/anchor_of_categories | 11 - _includes/codepiano/comments | 10 - _includes/codepiano/comments-providers/disqus | 14 - _includes/codepiano/liquid_raw | 6 - _includes/codepiano/navigation_list | 10 - _includes/codepiano/post_categories_info | 14 - _includes/codepiano/posts_of_category | 15 - _includes/codepiano/posts_table | 12 - _includes/codepiano/setup | 22 - _includes/codepiano/sharing | 8 - _includes/codepiano/tags_list | 10 - _includes/codepiano/time_list | 14 - _includes/codepiano/timeline | 36 - _includes/themes/twitter/default.html | 12 +- _includes/themes/twitter/impress.html | 2 +- _includes/themes/twitter/post.html | 8 +- _layouts/default.html | 2 +- _layouts/impress.html | 2 +- _layouts/index.html | 2 +- _layouts/page.html | 2 +- _layouts/post.html | 2 +- ...valid-in-renren-homepage-with-maxthon.html | 46 - ...012-03-02-jquery-datatables-config-cn.html | 47 - ...24-translate-word-under-cursor-in-vim.html | 83 - _posts/2012-04-04-100-vim-commands.html | 30 - ...2-05-08-sort-large-number-of-integers.html | 84 - ...-29-quickly-change-working-dir-in-cmd.html | 35 - ...rapid-validation-dependence-to-jquery.html | 26 - _posts/2013-04-04-pull-all-git-project.html | 56 - ...gin-generate-table-border-with-symbol.html | 40 - ...-27-bug-trace-of-vim-zencoding-plugin.html | 110 -- ...-07-03-push-multi-remote-repositories.html | 41 - _posts/2013-08-12-vim-surround.html | 260 --- _posts/2013-09-08-vim-pathogen.html | 86 - _posts/2013-12-10-ctrlp-chinese-doc.html | 26 - about.html | 14 +- categories.html | 6 +- css/codepiano.css | 302 ---- index.html | 6 +- js/codepiano.js | 94 -- pages/100-vim-commands.html | 677 -------- pages/ctrlp-cn.dark.html | 1445 ---------------- pages/ctrlp-cn.light.html | 1445 ---------------- pages/jquery-datatables-config-cn.html | 1475 ----------------- posts.html | 4 +- timeline.html | 6 +- 52 files changed, 47 insertions(+), 6663 deletions(-) delete mode 100644 CNAME delete mode 100644 _includes/codepiano/analytics delete mode 100644 _includes/codepiano/analytics-providers/google delete mode 100644 _includes/codepiano/anchor_of_categories delete mode 100644 _includes/codepiano/comments delete mode 100644 _includes/codepiano/comments-providers/disqus delete mode 100644 _includes/codepiano/liquid_raw delete mode 100644 _includes/codepiano/navigation_list delete mode 100644 _includes/codepiano/post_categories_info delete mode 100644 _includes/codepiano/posts_of_category delete mode 100644 _includes/codepiano/posts_table delete mode 100644 _includes/codepiano/setup delete mode 100644 _includes/codepiano/sharing delete mode 100644 _includes/codepiano/tags_list delete mode 100644 _includes/codepiano/time_list delete mode 100644 _includes/codepiano/timeline delete mode 100644 _posts/2011-12-25-super-drag-invalid-in-renren-homepage-with-maxthon.html delete mode 100644 _posts/2012-03-02-jquery-datatables-config-cn.html delete mode 100644 _posts/2012-03-24-translate-word-under-cursor-in-vim.html delete mode 100644 _posts/2012-04-04-100-vim-commands.html delete mode 100644 _posts/2012-05-08-sort-large-number-of-integers.html delete mode 100644 _posts/2012-06-29-quickly-change-working-dir-in-cmd.html delete mode 100644 _posts/2012-11-26-change-rapid-validation-dependence-to-jquery.html delete mode 100644 _posts/2013-04-04-pull-all-git-project.html delete mode 100644 _posts/2013-05-06-vim-plugin-generate-table-border-with-symbol.html delete mode 100644 _posts/2013-05-27-bug-trace-of-vim-zencoding-plugin.html delete mode 100644 _posts/2013-07-03-push-multi-remote-repositories.html delete mode 100644 _posts/2013-08-12-vim-surround.html delete mode 100644 _posts/2013-09-08-vim-pathogen.html delete mode 100644 _posts/2013-12-10-ctrlp-chinese-doc.html delete mode 100644 css/codepiano.css delete mode 100644 js/codepiano.js delete mode 100644 pages/100-vim-commands.html delete mode 100644 pages/ctrlp-cn.dark.html delete mode 100644 pages/ctrlp-cn.light.html delete mode 100644 pages/jquery-datatables-config-cn.html diff --git a/CNAME b/CNAME deleted file mode 100644 index 353813a..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -blog.codepiano.com diff --git a/README.md b/README.md index 36461a7..4651bac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 个人博客 -[codepiano](http://codepiano.github.io) +[site](http://site.github.io) 个人博客,转载请注明出处,保留所有权利。 @@ -34,7 +34,7 @@ ### 通过clone -1. git clone https://github.com/codepiano/codepiano.github.com.git 替换为你的目录名 +1. git clone https://github.com/site/site.github.com.git 替换为你的目录名 1. git remote set-url origin 替换为你的仓库地址 1. 参见清理文件并修改配置 @@ -46,7 +46,7 @@ 1. 删除pages目录 1. 删除CNAME文件,如果你需要自定义域名,可以修改CNAME文件 1. 修改config.yml中的设置,需要自定义的地方已经加了注释,建议把那个文件看一遍,对设置有个大概的了解 -1. 我使用我的id作为了一些设置的属性名、文件名、目录名,如果你想修改,最好使用替换工具,把所有文件中的"codepiano",替换为你想要的名字 然后重命名以我的id为名的所有文件和目录 +1. 我使用我的id作为了一些设置的属性名、文件名、目录名,如果你想修改,最好使用替换工具,把所有文件中的"site",替换为你想要的名字 然后重命名以我的id为名的所有文件和目录 1. config.yml中的comments和analytics必须修改,配置上你自己的账号,如果不想配置,请置provider为false 1. 出现问题,建议自己google,有很多详细的教程,或者直接参考官方文档 [jekyll](http://jekyllrb.com) 1. 有好的建议或者要求,欢迎提issue或者发邮件交流 @@ -63,7 +63,7 @@ ### 导航栏 -为了自定义导航栏子栏目的顺序,重写了这部分的逻辑,具体在文件\_include/codepiano/navigation\_list中 +为了自定义导航栏子栏目的顺序,重写了这部分的逻辑,具体在文件\_include/site/navigation\_list中 为了在后台实现高亮当前的导航页,用一种不太好的方式实现了这个功能,建议使用js在页面加载后进行设置 diff --git a/Rakefile b/Rakefile index f1df96e..3fcab24 100644 --- a/Rakefile +++ b/Rakefile @@ -70,7 +70,7 @@ task :post do post.puts 'group: archive' post.puts 'icon: file-alt' post.puts "---" - post.puts "{% include codepiano/setup %}" + post.puts "{% include site/setup %}" end end # task :post @@ -97,7 +97,7 @@ task :page do post.puts "title: \"#{title}\"" post.puts 'group: static' post.puts "---" - post.puts "{% include codepiano/setup %}" + post.puts "{% include site/setup %}" end end # task :page @@ -146,7 +146,7 @@ namespace :theme do page.puts "layout: default" page.puts "---" end - page.puts "{% include codepiano/setup %}" + page.puts "{% include site/setup %}" page.puts "{% include themes/#{theme_name}/#{File.basename(filename)} %}" end end diff --git a/_config.yml b/_config.yml index 16e950c..2509213 100644 --- a/_config.yml +++ b/_config.yml @@ -10,9 +10,9 @@ paginate: 4 title : 隐匿于黑夜中的星 tagline: 时间的回响,思维的残影 author : - name : codepiano + name : site email : anyexingchen999@qq.com - github : https://github.com/codepiano + github : https://github.com/site twitter : http://twitter.com/anyexingchen # The production_url is only used when full-domain names are needed @@ -24,13 +24,13 @@ author : # Finally if you are pushing to a GitHub project page, include the project name at the end. # # 博客地址,如果没有自定义CNAME,写用户名即可 -production_url : http://blog.codepiano.com +production_url : http://blog.site.com # All Jekyll-Bootstrap specific configurations are namespaced into this hash # 我使用我的id作为了这个属性的属性名 -# 如果你想修改,最好使用替换工具,把所有文件中的"codepiano",替换为你想要的名字 +# 如果你想修改,最好使用替换工具,把所有文件中的"site",替换为你想要的名字 # 然后重命名以我的id为名的所有文件和目录 -codepiano : +site : version : 0.3.0 # All links will be namespaced by BASE_PATH if defined. @@ -84,7 +84,7 @@ codepiano : comments : provider : disqus disqus : - short_name : codepiano + short_name : site # Settings for analytics helper # Set 'provider' to the analytics provider you want to use. diff --git a/_includes/codepiano/analytics b/_includes/codepiano/analytics deleted file mode 100644 index 05437a4..0000000 --- a/_includes/codepiano/analytics +++ /dev/null @@ -1,14 +0,0 @@ -{% if site.safe and site.codepiano.analytics.provider and page.codepiano.analytics != false %} - -{% case site.codepiano.analytics.provider %} -{% when "google" %} - {% include codepiano/analytics-providers/google %} -{% when "getclicky" %} - {% include codepiano/analytics-providers/getclicky %} -{% when "mixpanel" %} - {% include codepiano/analytics-providers/mixpanel %} -{% when "custom" %} - {% include custom/analytics %} -{% endcase %} - -{% endif %} diff --git a/_includes/codepiano/analytics-providers/google b/_includes/codepiano/analytics-providers/google deleted file mode 100644 index 0d4e0c9..0000000 --- a/_includes/codepiano/analytics-providers/google +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/_includes/codepiano/anchor_of_categories b/_includes/codepiano/anchor_of_categories deleted file mode 100644 index 93b0847..0000000 --- a/_includes/codepiano/anchor_of_categories +++ /dev/null @@ -1,11 +0,0 @@ -{% comment %} categories.html页面中的锚点列表 {% endcomment %} - -{% for category in site_categories %} -
  • - - {{ category[0] | join: "/" }} - -
  • -{% endfor %} - -{% assign site_categories = nil %} diff --git a/_includes/codepiano/comments b/_includes/codepiano/comments deleted file mode 100644 index c466c17..0000000 --- a/_includes/codepiano/comments +++ /dev/null @@ -1,10 +0,0 @@ -{% if site.codepiano.comments.provider and page.comments != false %} - -{% case site.codepiano.comments.provider %} -{% when "disqus" %} - {% include codepiano/comments-providers/disqus %} -{% when "custom" %} - {% include custom/comments %} -{% endcase %} - -{% endif %} diff --git a/_includes/codepiano/comments-providers/disqus b/_includes/codepiano/comments-providers/disqus deleted file mode 100644 index d674e99..0000000 --- a/_includes/codepiano/comments-providers/disqus +++ /dev/null @@ -1,14 +0,0 @@ -
    - - -blog comments powered by Disqus diff --git a/_includes/codepiano/liquid_raw b/_includes/codepiano/liquid_raw deleted file mode 100644 index 19baabc..0000000 --- a/_includes/codepiano/liquid_raw +++ /dev/null @@ -1,6 +0,0 @@ -{% if site.codepiano.liquid_raw.provider == "custom" %} - {% include custom/liquid_raw %} -{% else %} -
    {{text | replace:"|.", "{" | replace:".|", "}" | replace:">", ">" | replace:"<", "<" }}
    -{% endif %} -{% assign text = nil %} diff --git a/_includes/codepiano/navigation_list b/_includes/codepiano/navigation_list deleted file mode 100644 index 1e3f819..0000000 --- a/_includes/codepiano/navigation_list +++ /dev/null @@ -1,10 +0,0 @@ -{% comment %} index.html页面中的导航 {% endcomment %} -{% assign color_hack = 'posts timeline categories about' %} -{% assign current_nav = page.url | remove:'/' | remove:'.html' %} -{% assign color_hack = color_hack | replace:{{current_nav}},'active' %} -{% assign color_hack = color_hack | split:' ' %} - -
  • 文章
  • -
  • 归档
  • -
  • 目录
  • -
  • 关于
  • diff --git a/_includes/codepiano/post_categories_info b/_includes/codepiano/post_categories_info deleted file mode 100644 index 98b865e..0000000 --- a/_includes/codepiano/post_categories_info +++ /dev/null @@ -1,14 +0,0 @@ -{% comment %} 主页中生成post的categories信息 {% endcomment %} -{% for category in post_categories %} -
  • - - {{ category | join: "/" }} - -
  • - {% unless forloop.last %} -
  • - -
  • - {% endunless %} -{% endfor %} -{% assign post_categories = nil %} diff --git a/_includes/codepiano/posts_of_category b/_includes/codepiano/posts_of_category deleted file mode 100644 index a705a42..0000000 --- a/_includes/codepiano/posts_of_category +++ /dev/null @@ -1,15 +0,0 @@ -{% comment %} categories.html页面中的div内容 {% endcomment %} - -{% for post in posts_list %} - {% if post.title != null %} -
  • - - {{ post.title }} - - - {{ post.date | date: " %Y 年 %m 月 %d 日" }} - -
  • - {% endif %} -{% endfor %} -{% assign posts_list = nil %} diff --git a/_includes/codepiano/posts_table b/_includes/codepiano/posts_table deleted file mode 100644 index a859817..0000000 --- a/_includes/codepiano/posts_table +++ /dev/null @@ -1,12 +0,0 @@ -{% comment %} posts.html页面table中的tr {% endcomment %} -{% for post in posts_list %} - - {{ post.date | date: "%Y 年 %m 月 %d 日" }} - - {{ post.title }} - - {{ post.tags | join:', ' }} - -{% endfor %} - -{% assign posts_list = nil %} diff --git a/_includes/codepiano/setup b/_includes/codepiano/setup deleted file mode 100644 index d1f2960..0000000 --- a/_includes/codepiano/setup +++ /dev/null @@ -1,22 +0,0 @@ -{% capture jbcache %} - - {% if site.codepiano.setup.provider == "custom" %} - {% include custom/setup %} - {% else %} - {% if site.safe and site.codepiano.BASE_PATH and site.codepiano.BASE_PATH != '' %} - {% assign BASE_PATH = site.codepiano.BASE_PATH %} - {% assign HOME_PATH = site.codepiano.BASE_PATH %} - {% else %} - {% assign BASE_PATH = nil %} - {% assign HOME_PATH = "/" %} - {% endif %} - - {% if site.codepiano.ASSET_PATH %} - {% assign ASSET_PATH = site.codepiano.ASSET_PATH %} - {% else %} - {% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ page.theme.name }}{% endcapture %} - {% endif %} - {% endif %} -{% endcapture %}{% assign jbcache = nil %} diff --git a/_includes/codepiano/sharing b/_includes/codepiano/sharing deleted file mode 100644 index 1a23a06..0000000 --- a/_includes/codepiano/sharing +++ /dev/null @@ -1,8 +0,0 @@ -{% if site.safe and site.codepiano.sharing.provider and page.codepiano.sharing != false %} - -{% case site.codepiano.sharing.provider %} -{% when "custom" %} - {% include custom/sharing %} -{% endcase %} - -{% endif %} diff --git a/_includes/codepiano/tags_list b/_includes/codepiano/tags_list deleted file mode 100644 index 39e92b4..0000000 --- a/_includes/codepiano/tags_list +++ /dev/null @@ -1,10 +0,0 @@ -{% if tags_list.first[0] == null %} - {% for tag in tags_list %} -
  • {{ tag }} {{ site.tags[tag].size }}
  • - {% endfor %} -{% else %} - {% for tag in tags_list %} -
  • {{ tag[0] }} {{ tag[1].size }}
  • - {% endfor %} -{% endif %} -{% assign tags_list = nil %} diff --git a/_includes/codepiano/time_list b/_includes/codepiano/time_list deleted file mode 100644 index bfcf0fa..0000000 --- a/_includes/codepiano/time_list +++ /dev/null @@ -1,14 +0,0 @@ -{% comment %} timeline.html页面中的时间锚点 {% endcomment %} - -{% for post in posts_list %} - {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} - {% capture this_month %}{{ post.date | date: "%m" }}{% endcapture %} - {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} - {% capture next_month %}{{ post.previous.date | date: "%m" }}{% endcapture %} - - {% if this_year != next_year or this_month != next_month %} -
  •   {{ this_year }} 年 {{ this_month }} 月
  • - {% endif %} - -{% endfor %} - diff --git a/_includes/codepiano/timeline b/_includes/codepiano/timeline deleted file mode 100644 index c74132e..0000000 --- a/_includes/codepiano/timeline +++ /dev/null @@ -1,36 +0,0 @@ -{% comment %} timeline.html页面中的文章链接 {% endcomment %} - -{% for post in posts_list %} - {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} - {% capture this_month %}{{ post.date | date: "%m" }}{% endcapture %} - {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} - {% capture next_month %}{{ post.previous.date | date: "%m" }}{% endcapture %} - - {% if forloop.first %} -
    -

    {{ this_year }} 年 {{ this_month }} 月

    - -
    - {% else %} - {% if this_year != next_year or this_month != next_month %} - - -
    -

    {{ next_year }} 年 {{ next_month }} 月

    - {% endunless %} @@ -21,7 +21,7 @@

    {{ page.title }} {% if page.tagline %}{{page.tagline}}{% endi
    • {% assign tags_list = page.tags %} - {% include codepiano/tags_list %} + {% include site/tags_list %}
    {% endunless %} @@ -33,7 +33,7 @@

    {{ page.title }} {% if page.tagline %}{{page.tagline}}{% endi {% else %} {% endif %} -
  • Archive
  • +
  • Archive
  • {% if page.next %} {% else %} @@ -43,7 +43,7 @@

    {{ page.title }} {% if page.tagline %}{{page.tagline}}{% endi
    - {% include codepiano/comments %} + {% include site/comments %}
    diff --git a/_layouts/default.html b/_layouts/default.html index 9337e40..b1bce28 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -2,5 +2,5 @@ theme : name : twitter --- -{% include codepiano/setup %} +{% include site/setup %} {% include themes/twitter/default.html %} diff --git a/_layouts/impress.html b/_layouts/impress.html index 2e09252..ef47312 100644 --- a/_layouts/impress.html +++ b/_layouts/impress.html @@ -1,2 +1,2 @@ -{% include codepiano/setup %} +{% include site/setup %} {% include themes/twitter/impress.html %} diff --git a/_layouts/index.html b/_layouts/index.html index 51a027b..20ae2b8 100644 --- a/_layouts/index.html +++ b/_layouts/index.html @@ -1,5 +1,5 @@ --- layout: default --- -{% include codepiano/setup %} +{% include site/setup %} {% include themes/twitter/index.html %} diff --git a/_layouts/page.html b/_layouts/page.html index c1707ec..2dd08dd 100644 --- a/_layouts/page.html +++ b/_layouts/page.html @@ -1,5 +1,5 @@ --- layout: default --- -{% include codepiano/setup %} +{% include site/setup %} {% include themes/twitter/page.html %} diff --git a/_layouts/post.html b/_layouts/post.html index da1d594..e0ea1fb 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -1,5 +1,5 @@ --- layout: default --- -{% include codepiano/setup %} +{% include site/setup %} {% include themes/twitter/post.html %} diff --git a/_posts/2011-12-25-super-drag-invalid-in-renren-homepage-with-maxthon.html b/_posts/2011-12-25-super-drag-invalid-in-renren-homepage-with-maxthon.html deleted file mode 100644 index a23dacd..0000000 --- a/_posts/2011-12-25-super-drag-invalid-in-renren-homepage-with-maxthon.html +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: post -title: 人人网主页在遨游浏览器内超级拖放功能失效 -keywords: 人人网,傲游浏览器,超级拖放,失效 -description: 傲游浏览器浏览人人网主页超级拖放功能失效 -categories: [Web, Javascript] -tags: [Javascript] -group: archive -icon: globe ---- -{% include codepiano/setup %} - -

    -很少在人人网主页使用超级拖放功能进行搜索,今天同学发了一条状态,“6.73很欢乐”。 -不知道6.73是什么意思,拖放搜了下,没出结果,我也没在意,直接又选中文字右键搜了下。 -排名第一的居然是豆瓣的一个帖子 ,说是Dota出6.73版了 -

    - -

    -后来同学回复我的状态说超级拖放不能用了,才想着看看是哪的问题。遨游的这类附加功能应该也是监听事件来实现的, -去w3cshool查DOM和javascript中对的事件的支持,并没有拖放事件。不过遨游兼容模式是IE内核,极速模式是WEBKit内核, -去网上搜 "IE 拖放事件",查出来微软在IE里面增加了拖放事件的监听,搜weikit支持的事件,也有对拖放事件的支持。 -这样问题就大概清楚了,估计是人人网的javascript脚本拦截或者覆盖了拖放事件,导致遨游浏览器收不到触发的拖放事件, -所以拖放后没有任何反应 -

    - -

    -用遨游自带的开发者工具看了看人人网js脚本里监听的事件,发现home.js中有代码监听了dragover事件,代码如下: -

    - -{% highlight javascript %} - -var _8f8=document.body; -_8f8.addEventListener("dragover",function(e){ -e.preventDefault(); -return false; -},false); - -{% endhighlight %} - -

    -就是这段代码造成超级拖放失效,代码获取了document的body节点,然后附加拖放事件的监听,如果拖放事件发生了, -代码会调用后面的匿名函数进行处理,e.preventDefault()拦截了事件,通知浏览器不要执行与事件关联的默认动作, -所以当拖放操作发生后,遨游收不到拖放操作发生的通知。 通过实验验证,把人人网主页另存到本地,找到这段代码, -把e.preventDefault()删除,然后再打开就能进行正常的超级拖放。 综合附近的代码来看,监听器是为了实现拖放图片上传的功能 -

    diff --git a/_posts/2012-03-02-jquery-datatables-config-cn.html b/_posts/2012-03-02-jquery-datatables-config-cn.html deleted file mode 100644 index e23b230..0000000 --- a/_posts/2012-03-02-jquery-datatables-config-cn.html +++ /dev/null @@ -1,47 +0,0 @@ ---- -layout: post -keywords: datatables,配置,文档,中文,翻译 -description: datatables表格插件使用说明,中文文档翻译 -title: JQuery DataTables插件中文文档 -categories: [Web, Javascript] -tags: [Javascript, DataTables, Translate] -group: archive -icon: globe ---- -{% include codepiano/setup %} -

    -下面内容翻译自官网: -DataTables (table plug-in for jQuery) 是一个jQuery的表格插件。 -是以渐进增强理念为基础构建的一个高度灵活的工具,可以在任何HTML表格上实现高级交互控制。 -抽时间将帮助文档翻译成了中文版,地址: JQuery-DataTables插件中文文档 -

    -

    主要特点:

    -
      -
    1. 可变长度分页
    2. -
    3. 即时表格数据过滤
    4. -
    5. 与数据类型自动检测相结合的多列排序
    6. -
    7. 智能处理列宽
    8. -
    9. 可以从几乎任何数据源加载数据(DOM,Javascript array,Ajax file and server-side processing)
    10. -
    11. 表单视图的滚动配置
    12. -
    13. 完全国际化
    14. -
    15. jQuery UI ThemeRoller支持
    16. -
    17. 健壮性,背后是2900项单元测试
    18. -
    19. 丰富的插件
    20. -
    21. 免费
    22. -
    23. 表格状态保持
    24. -
    25. 隐藏列
    26. -
    27. 动态创建表格
    28. -
    29. Ajax自动加载数据
    30. -
    31. 自定义DOM元素的位置
    32. -
    33. 单列过滤
    34. -
    35. 自定义的分页类型
    36. -
    37. 非侵入式的DOM交互
    38. -
    39. 高亮排序的列
    40. -
    41. 先进的数据源控制
    42. -
    43. 提供商业支持
    44. -
    45. 提供屏幕阅读器和键盘支持
    46. -
    47. 压缩后70K,gzip压缩后20k
    48. -
    49. 多种扩展插件支持
    50. -
    51. 丰富的文档
    52. -
    53. 130多个样例
    54. -
    diff --git a/_posts/2012-03-24-translate-word-under-cursor-in-vim.html b/_posts/2012-03-24-translate-word-under-cursor-in-vim.html deleted file mode 100644 index 44347db..0000000 --- a/_posts/2012-03-24-translate-word-under-cursor-in-vim.html +++ /dev/null @@ -1,83 +0,0 @@ ---- -layout: post -title: vim中添加快速单词查询功能 -keywords: Vim,单词,查询 -description: 在vim中添加单词查询功能 -categories: [Vim, Vimscript] -tags: [Vim, Vimscript, Translate] -group: archive -icon: code ---- -{% include codepiano/setup %} - -

    -本文内容转载整理自网上的文章,Vim - 闲耘™.Wiki > 其它技巧 > 翻译取词,原始作者不详 -

    - -

    -从github上下载的一些开源项目提供的文档是英文的,在vim里面看文档遇到不认识的单词还得用鼠标取词去查询, -特别不方便。于是去网上找给vim添加便捷单词查询功能的方法,整理在下面 -

    - -

    -首先需要安装一个shell下运行的词典工具stardict,可以使用下面的命令来安装 -

    - -{% highlight bash %} - -sudo apt-get install sdcv stardict stardict-tools - -{% endhighlight %} - -

    -安装完成后可以在shell里面使用sdcv命令来查询单词,stardict并没有自带字典文件,需要自己去下载字典文件, -可以用搜索引擎搜索stardict-langdao-ec-gb-2.4.2.tar.bz2来寻找字典数据包的下载地址, -将下载下来的包解压后放入/usr/share/stardict/dic中,这里可能会碰到权限问题,可以用命令来完成。 -现在使用sdcv命令查询单词就能出现内容了 -

    - - -
    -
    -ubuntu:~1 sdcv terminal
    -Found 1 items, similar to terminal.
    --->朗道英汉字典5.0
    --->terminal
    -['tә:minәl]
    -n. 终端机, 终点, 末端, 极限, 终点站
    -a. 终点的, 定期的, 致死的, 结尾的, 末端的, 晚期的
    -【计】 终端; 终端设备
    -【化】 接线端
    -【医】 终末的, 末端, 端
    -【经】 终站, 终点, 定期
    -  
    -
    - -

    -下面就是给vim添加命令,让vim调用shell命令去查询单词,把结果显示到vim中,在vimrc中添加下面的函数, -需要查词的时候把光标移动到要查的词内,默认使用<leader>f进行查询,在左侧会打开一个窗口,显示查询结果。 -快捷键和窗口的设置都可以通过修改下面的函数来进行自定义。网上提供的函数代码,打开查询结果的窗口后光标也会跟随到新窗口去, -还需要再通过命令跳转回文本窗口,不是很方便。我在函数后面加了一行命令 "wincmd p",来跳转回刚才的窗口,这样查词就方便多了 -

    - -{% highlight vim script %} - -function! Mydict() -"执行sdcv命令查询单词的含义,返回的值保存在expl变量中 -let expl=system('sdcv -n ' . expand("")) -"在每个窗口中执行命令,判断窗口中的文件名是否是dict-tmp,如果是,强制关闭 -windo if expand("%")=="dict-tmp" |q!|endif -"纵向分割窗口,宽度为25,新窗口的内容为dict-tmp文件的内容 -25vsp dict-tmp -"设置查询结果窗口的属性,不缓存,不保留交换文件 -setlocal buftype=nofile bufhidden=hide noswapfile -"将expl的内容显示到查询结果窗口 -1s/^/\=expl/ -"跳转回文本窗口 -wincmd p -endfunction -"按键绑定,将调用函数并执行 -nmap f :call Mydict() - -{% endhighlight %} - diff --git a/_posts/2012-04-04-100-vim-commands.html b/_posts/2012-04-04-100-vim-commands.html deleted file mode 100644 index f059dc7..0000000 --- a/_posts/2012-04-04-100-vim-commands.html +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: post -title: 100个常用的vim命令中文版 -keywords: Vim,100 Vim Commands -description: 100个常用的vim命令中文版 -categories: [Vim, Tips] -tags: [Vim] -group: archive -icon: code ---- -{% include codepiano/setup %} - -

    -这篇文章被标题党冠以《程序员应该知道的100个vim命令》在网上流传,其实这些命令对速成有些帮助, -在加深对vim的理解方面没有太大用处。想用好查找替换功能就必须能熟练写正则表达式, -想方便的操作文件就必须对shell命令有了解,想写程序方便就要装插件模拟IDE的功能, -有些功能可能还要自己动手写shell脚本或者插件在vim中进行调用 -

    -

    -从我自己的经验看来,想用好vim,就必须理解vim命令的设计风格,看几遍vim帮助文档,经常使用, -学习vimscript,没有任何可以速成的方法 -

    -

    -这个文章作为tips也不合格,完全不如这篇 Best of VIM Tips, gVIM's Key Features zzapper。 -作者说自己是一个有15年vi经验和7年vim经验并且还在继续学习的人 -

    -

    -翻译到一半觉得这篇文章完全没有翻译的价值,不过还是继续翻译完了,地址: 常用的vim命令 -

    - diff --git a/_posts/2012-05-08-sort-large-number-of-integers.html b/_posts/2012-05-08-sort-large-number-of-integers.html deleted file mode 100644 index 35c2d95..0000000 --- a/_posts/2012-05-08-sort-large-number-of-integers.html +++ /dev/null @@ -1,84 +0,0 @@ ---- -layout: post -keywords: 排序,编程珠玑,bitset -description: 编程珠玑中的习题,排序大量整数 -title: 《编程珠玑》习题-如何用位逻辑实现位向量 -categories: [Code, C] -tags: [Code, C] -group: archive -icon: code ---- -{% include codepiano/setup %} -

    -《编程珠玑》第一章提到了一个排序问题,具体需求抄在下面: -

    - -

    - 输入:一个最多包含n个正整数的文件,每个数都小于n,其中n=107。如果在输入文件中有任何整数重复出现就是致命错误。没有其他数据与该整数相关联。 -

    - -

    - 输出:按升序排列的输入整数的列表。 -

    - -

    - 约束:最多有(大约)1MB的内存空间可用,有充足的磁盘存储空间可用。运行时间最多几分钟,运行时间为10秒就不需要进一步优化了。 -

    - -

    -整个解题的思路是通过位向量来进行排序,使用107个位来代表从0~107的数,如果文件中包含数n,则将第n位置为1, -输出的时候按序遍历每一位,如果该位为1就输出该位的序号,即可得到最后的排序序列。 -

    - -

    -书中实现位向量是通过整数数组来实现的,或许是因为c语言中没有位向量这个数据结构, -c++中的标准模板库已经提供了bitset这个数据结构。 实现的原理如下: -

    - -

    -由于一个整型是32位,所以只需定义一个长度为107/32的整型数组即可提供所需的二进制位,整数数组记为A。 -从输入文件中读入一个整数,将这个整数整除32,得到的结果即是表示该数存在的二进制位记录在数组的哪个下标的整数中, -比如111,用111整除32得3,即代表该数存在的二进制位在数组下标为3的数,即A[3]中。 -将读入的数模32,得到的数即为代表该数的标志位在A[3]中的位置,比如111模32结果为15, -则将A[3]的第15位置为1,即A[3]现在为00000000000000000100000000000000,即为32768 -如此即可使用整型数组模拟位集合,比如读入的第二个数为127,127整除32为3,模32为31,则A[3]为10000000000000000100000000000000 -代码如下: -

    -{% highlight c %} - -//一个整型有32位 -#define BITSPERWORD 32 -//定义移位的长度,2的5次方为32 -#define SHIFT 5 -//定义取模的掩码 -#define MASK 0x1F -//输入文件中整数的最大范围 -#define N 10000000 -//定义存储的数组 -int a[1 + N/BITSPERWORD]; -/* - *根据参数i,设置对应的标志位的值 - *i>>SHIFT,i右移5位,相当于i/32 - *i & MASK,i和11111做与运算,得到i%32 - *1<<(i & MASK),1左移(i%32)位,将结果与a[i>>SHIFT]做或运算 - *即可设置整数i对应的标志位为1 - */ -void set(int i) -{ - a[i>>SHIFT] |= (1<<(i & MASK)); -} -/* - *根据参数i,设置对应的标志位为0 - */ -void clr(int i) -{ - a[i>>SHIFT] &= ~(1<<(i & MASK)); -} -/* - *根据参数i,判断对应的标志位是否为1 - */ -int test(int i) -{ - return a[i>>SHIFT] & (1<<(i & MASK)); -} -{% endhighlight %} diff --git a/_posts/2012-06-29-quickly-change-working-dir-in-cmd.html b/_posts/2012-06-29-quickly-change-working-dir-in-cmd.html deleted file mode 100644 index bd1bd13..0000000 --- a/_posts/2012-06-29-quickly-change-working-dir-in-cmd.html +++ /dev/null @@ -1,35 +0,0 @@ ---- -layout: post -keywords: cmd,工作目录,快速,切换 -description: 在cmd命令行下快速切换工作目录到配置好的路径中 -title: "在cmd命令行下快速切换工作目录" -categories: [Code, Script] -tags: [Windows, Bat, Code] -group: archive -icon: github ---- -{% include codepiano/setup %} - -

    -有时候会碰到需要在cmd里面切换工作路径的需求,而目录的层数又比较深,于是写了这个脚本, -可以存储路径,并切快速切换 -

    - -

    -建议放置在windows/system32目录下面,或者将脚本所在文件夹加入path, -这样可以直接在终端里面输入ls或者po调用脚本,使用的时候按0增加目录名称和地址, -脚本启动的时候会打印出所有存储的路径,可以直接输入编号进行工作路径的切换 -

    - -

    -ls.bat可以在cmd里面切换工作路径,po.bat可以直接打开路径对应的文件夹,使用方式相同 -

    - -

    -目前没有做删除目录地址的功能,可以通过手动修改path.txt删除目录地址,path.txt和脚本在同一目录下 -

    - -

    -项目地址:codepiano/GuideBoard · GitHub -

    - diff --git a/_posts/2012-11-26-change-rapid-validation-dependence-to-jquery.html b/_posts/2012-11-26-change-rapid-validation-dependence-to-jquery.html deleted file mode 100644 index 92031c0..0000000 --- a/_posts/2012-11-26-change-rapid-validation-dependence-to-jquery.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -layout: post -keywords: prototype.js, jquery, rapid validation -description: 将rapid validation的依赖的js库从prototype.js迁移到jquery -title: 将rapid validation的库依赖从prototype.js迁移到jquery -categories: [Web, Javascript] -tags: [Javascript, Jquery, Code] -group: archive -icon: github ---- -{% include codepiano/setup %} -

    该项目是由baiqiu编写的RapidValidation校验框架,框架原始的依赖是prototype.js, -为了以后维护和改造,将库的依赖替换成了jQuery,目前已完成了基本功能的改造,去掉了tooltip和effect, -项目地址:codepiano/RapidValidation · GitHub -

    - -

    -原始作者:

    - -
    -

    modified by badqiu (badqiu(a)gmail.com)

    -

    blog: badqiu - ITeye技术网站

    -

    Project Home: rapid-validation - Rapid javascript validation framework - Google Project Hosting

    -

    Rapid Framework Project Home: rapid-framework - java web快速开发脚手架 - Google Project Hosting

    -

    Version 1.5.1

    -
    diff --git a/_posts/2013-04-04-pull-all-git-project.html b/_posts/2013-04-04-pull-all-git-project.html deleted file mode 100644 index a8e3056..0000000 --- a/_posts/2013-04-04-pull-all-git-project.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -layout: post -keywords: git,pull all project,更新所有git项目 -description: 更新路径下所有git项目和项目中的子模块 -title: 更新路径下所有git项目和项目中的子模块 -categories: [Code, Script] -tags: [Git, Script, Bash, Code] -group: archive -icon: github ---- -{% include codepiano/setup %} - -

    -在给定目录的所有子文件夹下执行git pull,如果你签出的项目都在一个或几个目录下, -例如,你使用git clone命令签出了4个项目到F:\GIT目录下: -

    - -
    -
    -F:\GIT
    -
    -├─JQuerySourceCode
    -
    -├─pull-all-git-project
    -
    -├─RapidValidation
    -
    -└─TableKnight
    -
    -
    - -

    -可以在脚本的配置变量中添加路径:F:\GIT,执行脚本就可以依次在每个目录中进行下列操作,先更新项目, -如果项目包含子模块再更新所有子模块。注意:更新默认的分支都是主分支 -

    - -{% highlight bash %} - -# 下面两个命令在项目中执行 -git pull origin master -git submodule foreach pull git origin master - -{% endhighlight %} - -

    -脚本提供了Windows版的bat文件和Linux下的Bash文件,两个脚本行为一样,由于脚本语言的差异, -配置方式有一些不同,具体请参考README。如果发现子模块无法更新,请手动在项目中执行下面两个命令, -然后再进行尝试: -

    -{% highlight bash %} - -git submodule init -git submodule update - -{% endhighlight %} - diff --git a/_posts/2013-05-06-vim-plugin-generate-table-border-with-symbol.html b/_posts/2013-05-06-vim-plugin-generate-table-border-with-symbol.html deleted file mode 100644 index 860f4b9..0000000 --- a/_posts/2013-05-06-vim-plugin-generate-table-border-with-symbol.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -layout: post -keywords: vim,plugin,生成,表格,边框 -description: 使用字符生成表格边框的vim插件 -title: 生成表格边框的vim插件 -categories: [Vim, Vimscript] -tags: [Vim, Vimscript] -group: archive -icon: github ---- -{% include codepiano/setup %} -

    -vim插件,惟一用途是在文本文件中来展示表格,使用字符来模拟表格的边框。会破坏原始数据,不便于复制, -请谨慎使用。由于字符的展示方式与字体有关,可能某些字体下边框不能完美的对齐。 -项目地址:codepiano/TableKnight · GitHub -

    -

    -插件会根据分隔符自动分割选定的文本行,然后插入边框字符。例如:下面的字符 -

    -
    -
    -1|2
    -|1|2|||3
    -1|2|3|4|5
    -
    -会生成: -
    -+===========+
    -|1|2| | | | |
    -|-+-+-+-+-+-|
    -| |1|2| | |3|
    -|-+-+-+-+-+-|
    -|1|2|3|4|5| |
    -+===========+
    -
    -
    -

    -插件提供了边框和分割符的自定义机制,具体请参考README -

    - diff --git a/_posts/2013-05-27-bug-trace-of-vim-zencoding-plugin.html b/_posts/2013-05-27-bug-trace-of-vim-zencoding-plugin.html deleted file mode 100644 index 0b2106b..0000000 --- a/_posts/2013-05-27-bug-trace-of-vim-zencoding-plugin.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -layout: post -keywords: bug,vim,zencoding -description: 记录vim插件zencoding的一个bug跟踪和解决过程 -title: vim zencoding插件的一个bug的跟踪和解决过程 -categories: [Vim, Vimscript] -tags: [Vim, Vimscript] -group: archive -icon: code ---- -{% include codepiano/setup %} - -

    -前几天用vim写博客的过程中发现一个bug,当使用<c-y>a自动生成a标签的时候,会丢失href元素, -就跟踪了下那个函数的调用过程。找着bug的原因后,在github上给zencoding的作者发了一个pull request, -不过由于作者想更深层修复缺陷,没有merge,给转成issue了。把具体的跟踪过程和分析记录在这里 -

    -

    -<c-y>a是个很好用的命令,比如你准备插入一个a标签,只用输入http://www.vim.org, -然后使用zencoding扩展,会自动生成a标签,插件会联网读取那个网址的title标签, -并使用标签内容作为a标签的显示内容: -

    -{% highlight html %} - -welcome home : vim online - -{% endhighlight %} -

    -不过我使用的时候遇到一个bug,生成的a标签会丢失href属性,想寻找bug出现的原因就要跟踪代码调用过程。 -使用<c-y>a标签的时候在vim状态栏可以看到调用了zencoding#anchorizeURL函数,并传入了一个参数, -值为0。而zencoding插件的初始化操作在plugin/zencoding.vim文件中,顶层函数放在autoload/zencoding.vim中, -具体的处理标签的底层操作逻辑分散放在autoload/zencoding目录中。先从autoload/zencoding.vim入手, -找到了zencoding#anchorizeURL函数,通过阅读代码找到如下逻辑: -

    -{% highlight vim script %} - -" file:autoload/zencoding.vim - -" a:flag即为传入的参数,当调用a时为0,调用A时为1 -if a:flag == 0 - " 生成a标签的属性字典 - let a = zencoding#lang#html#parseTag('') - let a.attr.href = url - let a.value = '{' . title . '}' - " 根据属性字典生成html代码 - let expand = zencoding#toString(a, rtype, 0, []) - " 去除代表光标位置的标志符号 - let expand = substitute(expand, '\${cursor}', '', 'g') -else - " ... -endif - -{% endhighlight %} -

    -通过分析上面这段代码,可以知道问题应该处在zencoding#toString函数中,不过通过分析该函数的代码, -发现这个函数只是一个顶层函数,根据上步调用传入的属性字典的name或者snippts属性来决定是调用底层工具函数来生成代码, -还是通过自定义snippts进行扩展。结合传入参数和程序逻辑,在这个功能中,是调用了底层工具函数zencoding#lang#html#toString, -该函数位于autoload/zencoding/lang/html.vim中。函数中有下面这段代码 -

    -{% highlight vim script %} - -" file:autoload/zencoding/lang/html.vim - -if len(current_name) > 0 - let str .= '<' . current_name - for attr in zencoding#util#unique(current.attrs_order) - if !has_key(current.attr, attr) - continue - endif - " ... - endfor - " ... -endif - -{% endhighlight %} -

    -出现href属性丢失的原因是因为current.attrs_order为空,没有'href'属性名字符串, -所以生成的标签也不存在href属性。 -也就是说由于程序缺陷,导致属性字典中代表标签属性列表的数组attrs_order为空。 -由于我并没有深层次的去读插件的源码,所以不了解这个数组为空的原因, -而autoload/zencoding.vim中的zencoding#anchorizeURL函数只处理a标签的扩展, -所以我直接在顶层函数zencoding#anchorizeURL中给attrs_order中add了一个值'href', -这样可以解决这一个小问题。后来给插件作者发了pull request,说明了bug的原因, -并指出不确定是不是最好的解决方式,插件作者回复说他想从本质上解决这个问题, -把我的pull request转成了issue。一开始我以为作者会去解决attrs_order数组为空的问题, -不过pull最新的代码,发现作者也没去修改attrs_order数组,而是在底层的工具函数上打了个补丁, -修改后的代码如下 -

    -{% highlight vim script %} - -" file:autoload/zencoding/lang/html.vim - -if len(current_name) > 0 - let str .= '<' . current_name - " 打了个keys(current.attr)的补丁,补全了属性 - for attr in zencoding#util#unique(current.attrs_order + keys(current.attr)) - let val = current.attr[attr] - " ... - endfor - " ... -endif - -{% endhighlight %} -

    -关于这次的bug修改,让我想起看过的伞哥 @田春冰河 的一条微博说过的一种情况, -微博找不到了,大意是说:一个工具模块的代码缺陷A,导致不同的功能中出现bug的并集U, -测试人员通过测试发现其中一个子集u,然后开发人员修复子集u中的bug, -而真正好的解决方式是通过bug集u找到问题的源头,即缺陷A,从而修复整个bug集U。 -这次的情况也类似,我只修复了a标签生成这一个bug,作者修改底层模块后也修复了潜在的其他bug -

    diff --git a/_posts/2013-07-03-push-multi-remote-repositories.html b/_posts/2013-07-03-push-multi-remote-repositories.html deleted file mode 100644 index 9ff7a75..0000000 --- a/_posts/2013-07-03-push-multi-remote-repositories.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -layout: post -keywords: git,推送,远程仓库 -description: 推送git项目到多个远程仓库 -title: "推送git项目到多个远程仓库" -categories: [Git] -tags: [Git] -group: archive -icon: compass ---- -{% include codepiano/setup %} -

    -最近开源中国 - 找到您想要的开源项目,分享和交流也推出了git项目托管服务, -想把部分github中的项目同步到git@osc,在网上搜索了一下,找到了一种比较简单的同步办法,方法分享在下面。 -

    -

    -首先强烈推荐实用ssh的方式来完成push过程中的认证,这样不用每次都输入用户名和密码,十分方便。具体方式可以参考github的 -官方教程GitHub Help -

    -

    -如果已经配置好了ssh验证方式,在开源中国的git托管也可以使用同一个的key,然后打开github项目中中的.git/config文件 -在[remote "origin"]节点的原始url下面直接添加开源中国git中对应项目的ssh地址即可,例如: -

    -
    -
    -[remote "origin"]
    -	url = git@github.com:codepiano/pull-all-git-project.git
    -	url = git@git.oschina.net:codepiano/pull-all-git-project.git
    -	fetch = +refs/heads/*:refs/remotes/origin/*
    -
    -
    -

    -当然,使用命令行也可以直接添加,命令格式如下: -

    - -{% highlight bash %} - -git remote set-url --add origin git@git.oschina.net:codepiano/pull-all-git-project.git - -{% endhighlight %} - diff --git a/_posts/2013-08-12-vim-surround.html b/_posts/2013-08-12-vim-surround.html deleted file mode 100644 index 06ca71b..0000000 --- a/_posts/2013-08-12-vim-surround.html +++ /dev/null @@ -1,260 +0,0 @@ ---- -layout: post -keywords: vim插件,surround -description: vim插件surround介绍 -title: vim插件surround介绍 -categories: [Vim, Vim-Plugin] -tags: [Vim, Vim-Plugin] -group: archive -icon: compass ---- -{% include codepiano/setup %} -

    插件作者

    -

    -vim-surround是一个处理成对出现的“包围结构”的插件,比如处理括号、引号和html标签。对文本的外包的结构进行增加、修改和删除。 -由于插件提供的命令接受vim文本对象和vim的移动命令,使用起来比较方便,额外的学习成本比较低。 -插件的github地址为:tpope/vim-surround · GitHub -
    -作者是tpope,tpope贡献了很多实用的vim插件,他的github:tpope (Tim Pope) · GitHub -

    -

    普通模式命令

    -普通模式下,插件提供下列按键绑定: - -

    替换:change surround

    -

    -cs命令是change surround的缩写,可以对指定的文本的外部包围字符进行替换,命令接受两个参数: -第一个是被替换的外部包围字符,第二个是要替换为的字符。替换时光标需要移动到被包围的文本内。 -比如需要将字符串'test'外部的包围字符'替换为",可以将光标移动到文本区域内,然后使用cs'"即可 -下面是一些例子,部分来自帮助文件,其中的*号代表光标位置 -
    -注意 命令中使用形如()、{}、[]的字符的左半部分和右半部分是有区别的, -区别在于处理中的头部和尾部的空格的处理,考虑例子6、7、8、9的情况,处理字符串(   test   ), -字符串有3个头部空格,有2个尾部空格。 -
    -规则 规则可以总结如下: -
    -1.第一个参数使用符号的左半部分,会自动删除所有的头部和尾部 的空格,使用右半部分则不对空格进行处理 -
    -2.第二个参数使用符号的左半部分,会自动在左半部分的后面和右半部分的前面插入一个空格 -
    -注意例子8中的空格个数,被自动插入了空格 -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    样例序号原始文本执行命令执行结果
    1"Hello*world!"cs"''Helloworld!'
    2"Hello*world!"cs"<q><q>Helloworld!</q>
    3(( Hello*world! ))cs(*(*Hello*world!*)
    4(( Hello*world! ))cs( *(* Hello*world! *)
    5<div>Yo!*</div>cst<p><p>Yo!</p>
    6(   test   )cs([[ test ]
    7(   test   )cs(][test]
    8(   test   )cs)[[    test    ]
    9(   test   )cs)][   test   ]
    -

    删除:delete surround

    -

    -ds命令是delete surround的缩写,该命令只接受一个参数,即为需要删除的外部包围字符 -如果需要删除文本外部的标签,可以使用字符t来指代标签,不需要输入标签全称 -下面是一些例子: -
    -注意 命令中使用形如()、{}、[]的字符的左半部分和右半部分是有区别的, -规则同cs命令的规则1,即同样遵守第一个参数的规则,不再举例示范 -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    样例序号原始文本执行命令执行结果
    1"Hello*world!"ds"Hello world!
    2((Hello*world!))ds{(Hello*world!)
    2(123+4*56)/2ds)123+456/2
    3<div>Yo!*</div>dstYo!
    -

    添加:you surround

    -

    -ys命令是you surround(按作者的说法),可以对指定的文本进行包围,命令接受两个参数: -第一个是指示文本范围或者移动位置的文本对象,第二个是包围操作使用的字符。插入时光标需要移动到被包围的文本内。 -比如需要将字符串test添加外部包围字符',可以将光标移动到文本区域内,然后使用ysaw"即可,其中aw会被当作vim文本对象, -ys模式有一种变形,即yss和ySS,操作的对象是当前行,不过yss的包围符号添加在行首行尾,而ySS的符号会插入两个新行来包围。 -下面是一些例子,部分来自帮助文件,其中的*号代表光标位置 -
    -指定范围的两种方法 -
    -1.文本对象,规则基本同vim的文本对象规则一样 -
    -2.移动位置,可以使用^、$、f等命令来指定位置,作用范围是当前光标到指定的位置 -
    -注意 命令中使用形如()、{}、[]的字符的左半部分和右半部分是有区别的, -规则同cs命令的规则2,即同样遵守第二个参数的规则,不再举例示范 -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    样例序号原始文本执行命令执行结果
    1testysiw''test'
    2'test'ysi')'(test)'
    3'test'ysa')('test')
    4foo*testbarystb)foo(test)bar
    5testysaw<p class="example"><p class="example">test</p>
    -

    可视模式命令

    -

    -可视模式下可以选择需要的文本块,然后使用命令S,就可以输入用来进行包围的字符,不再赘述。 -

    -

    插入模式命令

    -

    -插件的插入模式还处于试验状态,可以在插入模式下插入字符对,不过我并没有测试成功。通过map命令查看文档中的按键绑定,发现并未绑定函数。 -

    -

    定制插件行为

    -

    -插件提供对符号的行为进行定制的功能,如果需要定制'-'符号在php文件中的功能,则按下面步骤操作 -

    - -{% highlight vim script %} - -" 1.使用vim函数获得ascii码 -:echo char2nr("-") -" 2.在vim文件中添加绑定,并使用文件类型侦测 -" 注意b:surround_45使用了'-'的ascii码值45 -autocmd FileType php let b:surround_45 = "" - -{% endhighlight %} - -

    -如果文件类型是php,则在字符串 print "Hello *world!"上执行yss-即可得到<?php print "Hello world!" ?>。使用如下方式还可以请求用户输入,jekyll的语法高亮使用highlight语法来完成,每次输入较麻烦,可以在vimrc中加入下面的设置 -

    - -{% highlight vim script %} - -let g:surround_45 = {% raw %}"{% hightlight \1代码语言: \1 %}\r{% endhighlight %}"{% endraw %} - -{% endhighlight %} - -

    -这样就自定义了字符"-"的包围语法模板,比如在testtest上使用ySS-,会显示“代码语言:”并等待用户输入,输入bash,则得到下面的代码 -其中的"\1代码语言: \1"被替换为用户输入的字符串,"\r"被替换为用户选择的需要被包围的文本,其余的均原样输出, -如果需要,可以在语法模板中使用换行等转义字符。语法模板也支持正则表达式的处理,但是语法过于古怪和丑陋,个人认为没有使用的价值。 -

    -
    -
    -{% raw %}{% highlight bash %}
    -testtest
    -{% endhighlight %}{% endraw %}
    -  
    -
    diff --git a/_posts/2013-09-08-vim-pathogen.html b/_posts/2013-09-08-vim-pathogen.html deleted file mode 100644 index 4d074b7..0000000 --- a/_posts/2013-09-08-vim-pathogen.html +++ /dev/null @@ -1,86 +0,0 @@ ---- -layout: post -keywords: vim插件,pathogen -description: vim插件pathogen介绍 -title: vim插件pathogen介绍 -categories: [Vim, Vim-Plugin] -tags: [Vim, Vim-Plugin] -group: archive -icon: compass ---- -{% include codepiano/setup %} -

    插件作者

    -

    -vim-pathogen是一个操作vim的runtimepath的插件,通过灵活的操作runtimepath,可以对安装的vim插件进行方便的管理。 -vim原始的安装插件的方式需要将插件文件复制到vim下的对应文件中,所有的插件混合在一个目录中,不便于管理。 -使用vim-pathogen后,可以将插件放在原始的独立目录内,由pathogen插件通过操作runtimepath加载其余的插件。 -插件的github地址为:tpope/vim-pathogen · GitHub -
    -作者是tpope,tpope贡献了很多实用的vim插件,他的github:tpope (Tim Pope) · GitHub -

    -

    安装插件

    -

    -pathogen插件的安装可以按照原始的方式,直接将插件文件复制到~/.vim/autoload中,然后将需要由pathogen加载的插件放入~/.vim/bundle。 -要启用pathogen插件,还需要在vimrc文件里, filetype plugin indent on之前的任何地方,加入下面的命令: -

    - -{% highlight vim script %} - -" 执行pathogen.vim中的infect函数 -execute pathogen#infect() -" 注意:需要在下面设置之前添加上面的执行语句 -syntax on -filetype plugin indent on - -{% endhighlight %} - -

    -如果你有强迫症,想把pathogen插件也放入~/.vim/bundle目录中,可以在vimrc中添加如下命令: -

    - -{% highlight vim script %} - -" 通过runtime命令将pathogen.vim加入vim的运行时环境 -runtime bundle/vim-pathogen.git/autoload/pathogen.vim -" 执行pathogen.vim中的infect函数 -execute pathogen#infect() - -{% endhighlight %} - -

    -通过上面的命令,也可以大概猜测出pathogen加载插件的机制,应该也是通过runtime命令,去动态的将~/vim/bundle目录中的插件添加到 -vim的运行时环境。 -

    -

    定制插件存放目录

    -

    -可以通过下面的方式指定pathogen去加载指定目录下的插件: -

    - -{% highlight vim script %} - -execute pathogen#infect('bundle/{}', '~/src/vim/bundle/{}') - -{% endhighlight %} - -

    生成插件tags文件

    -

    -由于插件现在是存放在独立的目录中,使用:helptags命令生成文档的tags文件就不是太方便。插件提供了:Helptags函数来解决这个问题, -通过该函数可以很方便的生成插件文档的tags文件。 -

    -

    使用github管理插件

    -

    -可以使用个人帐号在github新建一个仓库,专门用来托管vim插件和设置,然后将所需的vim插件作为子模块添加到工程中, -vim.org和github.com进行了合作,所有的vim插件都会自动获得一个github地址,pathogen这种组织插件的方式可以结合git的submodule机制, -便捷的将个人所安装的插件全部托管在github上,将vim插件的git项目作为git submodule加入到自己的插件托管项目中, -通过git submodule命令对插件进行统一的管理和更新,具体操作方式参考下面的命令: -

    - -{% highlight bash %} - -" 添加新的vim插件vim-pathogen作为子模块到.vim/bundle目录 -git submodule add git@github.com:tpope/vim-pathogen.git .vim/bundule/pathogen -" 通过git submodule更新所有插件 -git submodule foreach git pull origin master - -{% endhighlight %} - diff --git a/_posts/2013-12-10-ctrlp-chinese-doc.html b/_posts/2013-12-10-ctrlp-chinese-doc.html deleted file mode 100644 index f9a0b8f..0000000 --- a/_posts/2013-12-10-ctrlp-chinese-doc.html +++ /dev/null @@ -1,26 +0,0 @@ ---- -layout: post -keywords: ctrlp, 中文, 文档 -description: ctrlp, 中文, 文档 -title: "vim插件CtrlP中文文档" -categories: [Vim, Vim-Plugin] -tags: [Vim, Vim-Plugin] -group: archive -icon: compass ---- -{% include codepiano/setup %} -

    - -带有直观接口的全路径模糊文件, 缓冲区, 最近最多使用, 标签, ... 检索。使用纯净的Vimscript编写,可以运行在MacVim,gVim和版本号7.0以上的Vim中。 -全面支持Vim的正则表达式 |regexp| 作为搜索模式,内建最近最多使用文件监测,项目根目录定位和更多特性。 - -

    -

    -抽空翻译了CtrlP的帮助文档,这个应该是目前最好的搜索插件了。Github地址:kien/ctrlp.vim · GitHub -如果CtrlP的作者merge我的request的话,可能会成为项目默认的中文文档,暂时只能在我fork的分支中获取,Github地址:codepiano/ctrlp.vim · GitHub。 -这个插件的选项很多,建议把选项都看一下,自己定制过的用起来才顺手。 -对于翻译上的建议和指正,欢迎提issue。 -

    -

    在线版地址:

    -

    solarized-light版:ctrlp-cn-light

    -

    solarized-dark版:ctrlp-cn-dark

    diff --git a/about.html b/about.html index 3d84a53..a41a4a6 100644 --- a/about.html +++ b/about.html @@ -5,7 +5,7 @@ group: navigation index: 4 --- -{% include codepiano/setup %} +{% include site/setup %}

    关于 @@ -20,23 +20,23 @@

    我的github - codepiano · GitHub + site · GitHub 我的知乎 - codepiano - 知乎 + site - 知乎 我的微博 - codepiano - 新浪微博 + site - 新浪微博 我的豆瓣 - codepiano - 豆瓣 + site - 豆瓣 我的邮箱 - codepiano · Gmail + site · Gmail @@ -45,4 +45,4 @@



    -{% include codepiano/comments %} +{% include site/comments %} diff --git a/categories.html b/categories.html index 77d9f81..8081cea 100644 --- a/categories.html +++ b/categories.html @@ -5,11 +5,11 @@ group: navigation index: 3 --- -{% include codepiano/setup %} +{% include site/setup %}
    @@ -17,7 +17,7 @@
      {% assign posts_list = category[1] %} - {% include codepiano/posts_of_category %} + {% include site/posts_of_category %}
    {% endfor %} diff --git a/css/codepiano.css b/css/codepiano.css deleted file mode 100644 index 9543386..0000000 --- a/css/codepiano.css +++ /dev/null @@ -1,302 +0,0 @@ -/* ============================================================================= -# FileName: codepiano.css -# Desc: stylesheet for blog -# Author: codepiano -# Email: anyexingchen999@qq.com -# HomePage: http://www.weibo.com/anyexingchen -# Version: 0.0.1 -# LastChange: 2013-05-14 14:13:41 -# History: -============================================================================= */ - -@charset "utf-8"; - -/* a标签样式 */ -a { - text-decoration: none; -} - -a:link { - color: #1077BC; -} - -a:hover { - color: #FF9900; - text-decoration: none; -} - -a:active { - color: #FF6699; - text-decoration: none; -} - -a:visited { - color: #FF6699; -} - -/* 主页中央区域 */ -html, body, div.wrapper { - height: 100%; - background-color: #F3F3F3; -} - -/* 段落样式 */ -.paragraph { - font-size: 15px; - text-indent: 2em; -} - -/* font-awesome post信息按钮样式 */ -.icon-folder-open, .icon-tags, .icon-calendar { - color:#A84365; -} - -.icon-double-angle-right { - color: #FF6699; -} - -/* 自定义高亮样式 */ -.highlight pre,code { - font-size: 15px; - background-color: #002B36; - color:#93A1A1; -} - -blockquote { - font-size: 15px; - background-color: #002B36; - color:#93A1A1; -} - -blockquote p { - font-size: 15px; -} -/* 覆盖bootstrap导航条设置 */ -a.brand { - height: auto; -} - -.navbar ul.nav { - padding: 15px 20px 15px; - height:auto; -} - -.navbar>.navbar-inner{ - padding-left: 0px; - padding-right: 0px; - border-left: none; - border-right: none; -} - -/* 覆盖导航条激活菜单的背景色设置 */ -.navbar .nav>.active>a, .navbar .nav>.active>a:hover, .navbar .nav>.active>a:focus { - background-color: transparent; - box-shadow:none; -} - -.navbar .nav>li.active>a { - color:#EC6197; -} - -/* 覆盖typo.css中ul默认的margin-left属性 */ -ul.tag_box { - margin-left: 0; -} - -ul.tag_box > li:first-child { - padding-left: 0px; -} - -/* 标题栏文字样式 */ -.site-title { - font-size: 14px; - color: #1B813F; -} - -.site-author { - font-size: 28px; - color: #169FDE; -} - -/* 底部div定位 */ -div.wrapper>div.typo{ - padding-bottom: 60px; -} - -/* 底栏div样式 */ -div.bottom { - position: relative; - margin-top: -60px; - height: 60px; - clear: both; -} - -/* 底栏声明链接样式 */ -a.license { - color:#5E6087; -} - -/* 解决typo.css覆盖bootstrap的li.list-style */ -ul.nav.nav-tabs { - list-style: none; -} - -/* 技术支持列表样式 */ -ul#support { - margin-top: 20px; -} - -.dispear { - border-color: #F3F3F3; -} - -ul#support.dispear>li { - display:none; -} - -ul#support.dispear>li:first-child { - display:block; -} - -ul#support.dispear>li>a { - border-color: #F3F3F3; - color: #F3F3F3; -} - -ul#support.dispear>li>a:hover { - background-color: transparent; -} - - -ul#support.dispear>li:first-child>a:hover { - color: #CC527A; -} - -ul#support.dispear>li:first-child>a>i.icon-star-empty { - color: #F3F3F3; -} - -ul#support.dispear>li:first-child>a:hover>i.icon-star-empty { - color: #E8175D; -} - -#support.show a { - color: #CC527A; -} - -.icon-ok, .icon-star-empty { - color: #E8175D; -} - -ul#support.show { - border-color: #F3F3F3; -} - -ul#support.show li { - display:block; -} - -ul#support.show a { - border-color: #DDDDDD; - color:#CC527A; -} - -/* 文章日期样式 */ -.post-date { - color: #1077BC; -} - -/* Datatable设置,应用bootstrap样式 */ -table#post-data { - border-spacing:0; - border-collapse:collapse; -} - -table#post-data td, table#post-data th { - color: #1077BC; -} - -table#post-data .icon-calendar, table#post-data .icon-bookmark, table#post-data .icon-tags { - color: #1077BC; -} - -table#post-data a:hover { - color: #FF6699; -} - -div.row { - margin-left: 0px; -} - -/* 覆盖bootstrap默认的tooltip设置 */ -div.tooltip.right .tooltip-arrow { - border-right-color: #1693A7; -} - -div.tooltip-inner { - font-size: 14px; - color: #F3F3F3; - background-color: #1693A7; -} - -/* 归档和时间线页面列表样式 */ -ul.posts-list { - list-style: none; - position: relative; -} - -ul.posts-list li{ - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: #D9D7D4; - margin-top: 9px; - padding-bottom: 5px; - font-size: 14px; -} - -a.post-url { - font-size: 16px; - margin-left: 2px; -} - -span.post-right-info { - right: 0px; - position: absolute; - font-size: 16px; - color: #BBBBBB; -} - - -/* 时间锚点的样式 */ -ul.time-list { - margin-top: 10px; -} - -ul.time-list a { - font-size: 14px; - color: #FF6699; -} - -ul.time-list a>i.icon-chevron-right{ - color: #F3F3F3; -} - -ul.time-list>li.active>a>i.icon-chevron-right { - color: #333333; -} - -/* about样式 */ -p.about { - text-indent: 2em; - font-size: 18px; -} - -/* 链接table样式 */ -table#about-me td{ - font-size: 18px; - padding:7px; -} - -table#about-me a{ - color: #1077BC; -} diff --git a/index.html b/index.html index 7d760f6..5fec0bf 100644 --- a/index.html +++ b/index.html @@ -1,8 +1,8 @@ --- layout: index -title: codepiano +title: site --- -{% include codepiano/setup %} +{% include site/setup %} {% for post in paginator.posts %}

    {{ post.title }}

    @@ -13,7 +13,7 @@

    {{ post.title }}

  • {{ post.date | date: " %Y 年 %m 月 %d 日" }}
  • {% assign post_categories = post.categories %} - {% include codepiano/post_categories_info %} + {% include site/post_categories_info %} {% endunless %} diff --git a/js/codepiano.js b/js/codepiano.js deleted file mode 100644 index 0225d2a..0000000 --- a/js/codepiano.js +++ /dev/null @@ -1,94 +0,0 @@ -/* ============================================================================= -# FileName: codepiano.js -# Desc: javascript for blog -# Author: codepiano -# Email: anyexingchen999@qq.com -# HomePage: http://www.weibo.com/anyexingchen -# Version: 0.0.1 -# LastChange: 2013-05-12 01:39:30 -# History: -============================================================================= */ -/* 页面加载后执行 */ -!function ($) { - $(function(){ - - var tableReference; - /* 初始化dataTable */ - if($('#post-data')[0]){ - tableReference = $('#post-data').dataTable(datatablesConfig); - } - /* 初始化tooltip */ - if($('#support a')[0]){ - $('#support a').tooltip(tooltipConfig); - } - - /* 目录页导航 */ - var url = window.location.href; - if(url.indexOf('categories.html') > -1){ - $('#categories-nav a').click(function (e){ - $(this).tab('show'); - }) - - /* 自动打开链接中的锚点 */ - var matches = url.match(/categories\.html(#.*)/); - if(matches){ - $('#categories-nav a[href="' + matches[1] + '"]').tab('show'); - }else{ - $('#categories-nav a:first').tab('show'); - } - } - - /* 自动根据标签过滤table */ - if(url.indexOf('posts.html') > -1){ - var matches = url.match(/posts\.html#(.*)/); - if(matches && tableReference){ - tableReference.fnFilter(matches[1],2); - } - - $('#post-data_filter input').val(matches[1]) - - $("#post-data_filter input").keyup( function () { - tableReference.fnFilter('', 2); - tableReference.fnFilter( this.value, 2); - } ); - } - }); - -}(window.jQuery); - -/* 切换技术支持列表的样式 */ -function toggleSupport(){ - $('#support').toggleClass('dispear').toggleClass('show'); - return false; -} - -/* datatables设置 */ -datatablesConfig = { - "aaSorting": [[ 0, "desc" ],[ 1, "asc" ],[ 2, "asc" ]], - "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>", - "sWrapper": "dataTables_wrapper form-inline", - "sPaginationType": "bootstrap", - "oLanguage":{ - "sProcessing": "处理中...", - "sLengthMenu": "显示 _MENU_ 篇文章", - "sZeroRecords": "没有匹配文章", - "sInfo": "显示第 _START_ 至 _END_ 篇文章,共 _TOTAL_ 篇", - "sInfoEmpty": "显示第 0 至 0 篇文章,共 0 项", - "sInfoFiltered": "(由 _MAX_ 篇文章过滤)", - "sInfoPostFix": "", - "sSearch": "检索:", - "sUrl": "", - "oPaginate": { - "sFirst": "首页", - "sPrevious": "上页", - "sNext": "下页", - "sLast": "末页" - } - } -} - -/* tooltip设置 */ -tooltipConfig = { - "placement": "right", - "delay": { show: 200, hide: 100 } -} diff --git a/pages/100-vim-commands.html b/pages/100-vim-commands.html deleted file mode 100644 index dc34c57..0000000 --- a/pages/100-vim-commands.html +++ /dev/null @@ -1,677 +0,0 @@ - - - - - 常用的vim命令 - - - - -
    -

    常用的vim命令

    -
    -

    - -

    -

    - 翻译整理:codepiano  - css样式来自typo.css,作者为sofish Lin,github地址:typo.css  - 演示地址:中文网页重设与排版:TYPO.CSS  -

    -
    - 翻译自100 Vim commands every programmer should know -
    -
      -
    1. - 基 本 -
    2. -
    3. - 搜 索 -
    4. -
    5. - 替 换 -
    6. -
    7. - 大小写 -
    8. -
    9. - 读写文件 -
    10. -
    11. - 文件浏览 -
    12. -
    13. - 与Unix系统交互 -
    14. -
    15. - 对 齐 -
    16. -
    17. - 标 签 -
    18. -
    19. - 分割窗口 -
    20. -
    21. - 自动补全 -
    22. -
    23. - 标 记 -
    24. -
    25. - 缩 写 -
    26. -
    27. - 文本缩进 -
    28. -
    29. - 语法高亮 -
    30. -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    类 型序 号命 令释 义
    基 本 - 1:e 文件名打开文件进行编辑
    2:w保存文件
    3:q退出vim
    4:q!不保存文件退出vim
    6?word从结尾处到开始处搜索字符串
    7/jo[ha]n搜索john或者joan
    8/\<the搜索the、theatre或者then,匹配以the开始的字符串
    9/the\>搜索the或者breathe,匹配以the结尾的字符串
    10/\<the\>搜索the,只匹配the
    11/\<\w\{4}\>匹配所有四个字母的单词
    12/\<fred\>/匹配fred但是不匹配alfred或者frederick
    13/fred\|joe匹配fred或者joe
    14/\<\d\d\d\d\>匹配四个数字
    15/^\n\{3}匹配连续的三个空行
    16:bufdo /正则表达式/在所有打开的文件中搜索
    替 换 - 17:%s/old/new/g把文件中所有匹配old的地方替换成new
    18:%s/old/new/gc把文件中所有匹配old的地方替换成new,替换前提示确认
    19:2,35s/old/new/g把文件从第2行到第35行中所有匹配old的地方替换成new
    20:5,$s/old/new/g把文件从第5行到文件结束符中所有匹配old的地方替换成new
    21:%s/^/hello/g把每一行的开始位置替换为Hello
    22:%s/$/Harry/g把每一行的结束位置替换为Harry
    23:%s/onward/forward/gi替换onward为forward,大小写不敏感
    24:%s/ *$//g替换所有行末的空格为空字符串
    25:g/string/d删除所有匹配正则表达式string的行
    26:v/string/d删除所有不匹配正则表达式string的行
    27:s/Bill/Steve/把当前行中的Bill替换为Steve
    28:s/Bill/Steve/g把所有行中的Bill替换为Steve
    29:%s/Bill/Steve/g把所有文件中的Bill替换为Steve
    30:s/\r//g替换dos换行符为空字符串
    31:s/\r/\n/g替换dos换行符为回车
    32:%s#<[^>]\+>##g删除所有的html标签,保留其中的内容
    33:%s/^\(.*\)\n\1$/\1/替换所有连续出现两次的行为一行
    34Ctrl+a把光标下的数字自增1
    35Ctrl+x把光标下的数字自减1
    36ggVGg?对全文使用ROT13加密,关于ROT13,参考 ROT13_WIKI
    大小写 - 37Vu选择一行,使其字母变为小写
    38VU选择一行,使其字母变为大写
    39g~~反转字母的大小写
    40veU选择一个单词,将其变为大写
    41ve~选择一个单词,将其变为小写
    42ggguG把所有文本变为小写
    43:set ignorecase搜索的时候忽略大小写
    44:set smartcase如果模式串中没有大写字母,则搜索的时候忽略大小写
    45:%s/\<./\u&/g将每个单词的第一个字母转为大写
    46:%s/\<./\l&/g将每个单词的第一个字母转为小写
    47:%s/.*/\u&将每行的第一个字母转为大写
    48:%s/.*/\l&将每行的第一个字母转为小写
    读写文件 - 49:1,10 w outfile把1到10行保存到outfile中
    50:1,10 w >> outfile把1到10行追加到outfile中
    51:r infile插入infile的内容
    52:23r infile插入infile中23行以后的内容
    文件浏览 - 53e:.打开内置的文件浏览器
    54:Sex分割窗口,并打开内置的文件浏览器
    55:browse e打开图形化的文件浏览器
    56:ls列出缓冲区的内容
    57:cd..到父目录
    58:args列出参数列表,当前文件会用方括号标注
    59:args *.php将当前目录下所有后缀是php的文件加入参数列表,并打开其中的第一个
    60:grep expression *.php返回所有包含expression的php文件列表
    61gf打开当前光标下的文件
    与Unix系统交互 - 62:!pwd执行unix命令pwd,然后返回到vi中
    63:!!pwd执行unix命令pwd,并将结果插入到文件中
    64:sh暂时回到unix
    65$exit返回vi
    对 齐 - 66:%!fmt对齐所有行
    67!}fmt对齐当前位置的所有行
    685!!fmt对齐下面5行
    标 签 - 69:tabnew新建标签
    70gt切换到下一个标签
    71:tabfirst切换到第一个标签
    72:tablast切换到最后一个标签
    73:tabm n(位置)重新排列标签
    74tabdo %s/foo/bar/g在每一个标签中执行命令
    75:tab ball把所有打开的文件放入标签
    分割窗口 - 76:e filename在当前窗口中编辑文件
    77:split filename分割窗口并打开文件
    78ctrl-w up arrow将光标移到顶部的窗口
    79ctrl-w ctrl-w将光标移动到下一个窗口
    80ctrl_最大化当前窗口
    81ctrl-w=将所有的窗口设置为同样的大小
    8210ctrl-w+在当前窗口中增加10行
    83:vsplit file垂直分割窗口
    84:sview file功能与只读模式下的:split命令一样
    85:hide关闭当前窗口
    86:nly关闭除当前窗口以外的所有窗口
    87:b 2在当前窗口中打开第二个缓冲区的内容,具体描述请见:help b:
    自动补全 - 88ctrl-n ctrl-p(插入模式下)补全单词
    89ctrl-x ctrl-l补全整行
    90:set dictionary=dict定义dict为dictionary
    91ctrl+x ctrl+k使用字典进行补全
    标 记 - 92mk将当前位置标记为k
    93~k将光标移动至标记k
    94dk删除至标记k
    缩 写 - 95:ab mail mail@provider.org定义mail为mail@provider.org的缩写
    文本缩进 - 96:set autoindent打开自动缩进
    97:set smartindent打开智能缩进
    98:set shiftwidth=4定义缩进的宽度为四个空格
    99ctrl-t,ctrl-d插入模式下缩进/反向缩进
    100>>缩进
    101<<反向缩进
    语法高亮 - 102:syntax on打开语法高亮
    103:syntax off关闭语法高亮k
    104:set syntax=perl强制打开语法高亮
    -
    - - diff --git a/pages/ctrlp-cn.dark.html b/pages/ctrlp-cn.dark.html deleted file mode 100644 index a927281..0000000 --- a/pages/ctrlp-cn.dark.html +++ /dev/null @@ -1,1445 +0,0 @@ - - - - -~/.vim/bundle/ctrlp.git/doc/ctrlp.cnx.xhtml - - - - - - - - - - -
    -ctrlp.txt       模糊的 文件, 缓冲区, 最近最多使用, 标签, ... 检索. v1.79
    -CtrlP ControlP 'ctrlp' 'ctrl-p'
    -===============================================================================
    -#                                                                             #
    -#          :::::::: ::::::::::: :::::::::  :::             :::::::::          #
    -#         :+:    :+:    :+:     :+:    :+: :+:             :+:    :+:         #
    -#         +:+           +:+     +:+    +:+ +:+             +:+    +:+         #
    -#         +#+           +#+     +#++:++#:  +#+             +#++:++#+          #
    -#         +#+           +#+     +#+    +#+ +#+             +#+                #
    -#         #+#    #+#    #+#     #+#    #+# #+#             #+#                #
    -#          ########     ###     ###    ### ##########      ###                #
    -#                                                                             #
    -===============================================================================
    -名词对照(译注)
    -
    -  buffer:缓冲区                    mapping:按键绑定
    -     mru:最近最多使用               prompt:提示符面板
    -     tag:标签                          tab:页签
    -     tab:制表符
    -
    -===============================================================================
    -内容                                                            ctrlp-content
    -
    -    1. 介绍.............................................ctrlp-intro
    -    2. 选项.............................................ctrlp-options
    -    3. 命令.............................................ctrlp-commands
    -    4. 按键绑定.........................................ctrlp-mappings
    -    5. 输入格式.........................................ctrlp-input-formats
    -    6. 扩展.............................................ctrlp-extensions
    -
    -===============================================================================
    -介绍                                                              ctrlp-intro
    -
    -带有直观接口的全路径模糊文件, 缓冲区, 最近最多使用, 标签, ... 检索。
    -使用纯净的Vimscript编写,可以运行在MacVim,gVim和版本号7.0以上的Vim中。
    -全面支持Vim的正则表达式 regexp 作为搜索模式,内建最近最多使用文件监测,
    -项目根目录定位和更多特性。
    -
    -开启可选的扩展(标记,目录,rtscripts...),参考 ctrlp-extensions 。
    -
    -===============================================================================
    -OPTIONS                                                         ctrlp-options
    -
    -总览:
    -
    -  loaded_ctrlp................禁用插件。
    -  ctrlp_map...................默认按键绑定。
    -  ctrlp_cmd...................默认按键绑定调用的命令。
    -  ctrlp_by_filename...........是否默认开启文件名模式。
    -  ctrlp_regexp................是否默认开启正则表达式模式。
    -  ctrlp_match_window..........匹配窗口的显示位置。
    -  ctrlp_switch_buffer.........如果文件已在缓冲区中打开,跳转到该打开的缓冲区。
    -  ctrlp_reuse_window..........重用特殊窗口(帮助、快速修复 quickfix ,等等)。
    -  ctrlp_tabpage_position......新标签页出现的位置。
    -  ctrlp_working_path_mode.....如何设置CtrlP的本地工作目录。
    -  ctrlp_root_markers..........额外的,高优先级的根目录标识。
    -  ctrlp_use_caching...........针对每个会话,设置是否开启缓存的。
    -  ctrlp_clear_cache_on_exit...退出Vim后是否保留缓存。
    -  ctrlp_cache_dir.............缓存目录的位置。
    -  ctrlp_show_hidden...........是否显示隐藏文件和隐藏文件夹。
    -  ctrlp_custom_ignore.........使用 globpath() 时自定义忽略的文件或目录。
    -  ctrlp_max_files.............扫描文件的最大数目。
    -  ctrlp_max_depth.............扫描目录的最大层数。
    -  ctrlp_user_command..........使用外部的扫描工具。
    -  ctrlp_max_history...........历史提示符面板中保留的最大条目数。
    -  ctrlp_open_new_file.........由<c-y>创建的文件的打开方式。
    -  ctrlp_open_multiple_files...由<c-z>选择的文件的打开方式。
    -  ctrlp_arg_map...............是否拦截<c-y><c-o> 命令。
    -  ctrlp_follow_symlinks.......是否跟随链接。
    -  ctrlp_lazy_update...........停止输入时才更新。
    -  ctrlp_default_input.........为提示符面板提供一个种子。
    -  ctrlp_abbrev................输入缩写。
    -  ctrlp_key_loop..............为多字节输入开启输入事件循环。
    -  ctrlp_use_migemo............为日语文件名启用Migemo模式。
    -  ctrlp_prompt_mappings.......改变提示符面板内部的按键绑定。
    -
    -  最近最常使用模式:
    -  ctrlp_mruf_max..............记录的最近最常最多使用的最大数据。
    -  ctrlp_mruf_exclude..........需要被排除的文件。
    -  ctrlp_mruf_include..........需要被记录的文件。
    -  ctrlp_mruf_relative.........只显示在工作目录内的最近最多使用。
    -  ctrlp_mruf_default_order....禁用排序。
    -  ctrlp_mruf_case_sensitive...最近最多使用文件是否大小写敏感。
    -  ctrlp_mruf_save_on_update...只要有一个新的条目添加,就保存到磁盘。
    -
    -  缓冲区标签模式: (开启此模式,参考 ctrlp-extensions )
    -  g:ctrlp_buftag_ctags_bin....兼容的ctags二进制程序的位置。
    -  g:ctrlp_buftag_systemenc....ctags命令的编码。
    -  g:ctrlp_buftag_types........添加新的文件类型和设置命令行参数。
    -
    -  高级选项:
    -  ctrlp_open_func.............使用自定义的打开文件的函数。
    -  ctrlp_status_func...........改变CtrlP的两个状态栏
    -  ctrlp_buffer_func...........在CtrlP的缓冲区内调用自定义的函数。
    -  ctrlp_match_func............替换内建的匹配算法。
    -
    --------------------------------------------------------------------------------
    -详细描述和默认值:
    -
    -                                                                'g:ctrlp_map'
    -使用该选项来改变普通模式 Normal 下调用CtrlP的按键绑定:
    -  let g:ctrlp_map = '<c-p>'
    -
    -
    -                                                                'g:ctrlp_cmd'
    -
    -设置当按下上面的按键绑定时,使用的默认打开命令:
    -  let g:ctrlp_cmd = 'CtrlP'
    -
    -
    -                                                             'g:loaded_ctrlp'
    -使用该选项完全禁用插件:
    -  let g:loaded_ctrlp = 1
    -
    -
    -                                                        'g:ctrlp_by_filename'
    -修改该选项为1,设置默认为按文件名搜索(否则为全路径):
    -  let g:ctrlp_by_filename = 0
    -
    -在提示符面板内可以使用 <c-d> 来切换。
    -
    -                                                             'g:ctrlp_regexp'
    -修改该选项为1,设置默认为使用正则表达式匹配。:
    -  let g:ctrlp_regexp = 0
    -
    -在提示符面板内可以使用 <c-r> 来切换。
    -
    -                                                       'g:ctrlp_match_window'
    -改变匹配窗口的位置,结果的排列顺序,最小和最大高度:
    -  let g:ctrlp_match_window = ''
    -
    -例子:
    -  let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10'
    -
    -位置: (默认:底部)
    -  top - 在屏幕顶部显示匹配窗口。
    -  bottom - 在屏幕底部显示匹配窗口。
    -
    -结果的排列顺序: (默认: btt)
    -  order:ttb - 从顶部到底部。
    -  order:btt - 从底部到顶部。
    -
    -最小和最大高度:
    -  min:{n} - 最少显示 {n} 行 (默认: 1).
    -  max:{n} - 最多显示 {n} 行 (默认: 10).
    -
    -结果集的最大数目:
    -  results:{n} - 列出最多 {n} 条结果 (默认: 和最大高度同步).
    -
    -注意: 当一个设置项没有被设置时,将会使用默认值。
    -
    -                                                      'g:ctrlp_switch_buffer'
    -当尝试打开一个文件时,如果它已经在某个窗口被打开,CtrlP会尝试跳到那个窗口,而
    -不是新打开一个实例。:
    -  let g:ctrlp_switch_buffer = 'Et'
    -
    -  e - 当 <cr> 被按下时跳转,但是只跳转到当前页签内的窗口内。
    -  t - 当 <c-t> 被按下时跳转, 但是只跳转到其它标签的窗口内。
    -  v - 类似 "e", 但是当 <c-v> 被按下时跳转。
    -  h - 类似 "e", 但是当 <c-x> 被按下时跳转。
    -  E, T, V, H - 行为类似 "e", "t", "v", and "h", 但是跳转到任何地方的窗口中。
    -  0 或者 <empty> - 禁用这项功能。
    -
    -                                                       'g:ctrlp_reuse_window'
    -当使用 <cr> 打开新文件时,CtrlP避免在插件,帮助,快速修复创建的窗口中打开该文
    -件。使用该选项来设置一些例外:
    -  let g:ctrlp_reuse_window = 'netrw'
    -
    -接受的值可以为特殊缓冲区的名字的一部分,文件类型或者缓冲区类型使用正则表达式来
    -指定匹配模式。
    -例子:
    -  let g:ctrlp_reuse_window = 'netrw\|help\|quickfix'
    -
    -
    -                                                   'g:ctrlp_tabpage_position'
    -新打开页签的位置:
    -  let g:ctrlp_tabpage_position = 'ac'
    -
    -  a - 后面。
    -  b - 前面。
    -  c - 当前页签。
    -  l - 最后一个页签。
    -  f - 第一个页签。
    -
    -                                                  'g:ctrlp_working_path_mode'
    -当启动时,CtrlP依据这个变量来设置它的工作目录:
    -  let g:ctrlp_working_path_mode = 'ra'
    -
    -  c - 当前文件所在的目录。
    -  a - 类似 "c", 但是只有在CtrlP之外的当前工作目录不是当前文件所在目录的直接祖
    -      先时才生效。(译注:请参考https://github.com/kien/ctrlp.vim/issues/397)
    -  r - 包含下列文件或者目录的最近的祖先:
    -      .git .hg .svn .bzr _darcs
    -  w - 开始从CtrlP的工作目录之外的目录,而不是当前文件所在的目录(默认)查找根
    -      目录。只有在"r"选项存在的时候才生效。
    -  0 或者 <empty> - 禁用这项功能。
    -
    -注意 #1: 如果 "a" 或者 "c" 和 "r"一起被包含,当无法找到根目录时使用 "a" 或者
    -"c" 的行为(作为备选)。
    -
    -注意 #2: 你可以在每个缓冲区内使用 b:var 来设置该选项。
    -
    -                                                       'g:ctrlp_root_markers'
    -使用该选项来设置自定义的根目录标记作为对默认标记(.hg, .svn, .bzr, and _darcs)
    -的补充。自定义的标记具有优先权:
    -  let g:ctrlp_root_markers = ['']
    -
    -注意: 你可以在每个缓冲区内使用 b:var 来设置该选项。
    -
    -                                                        'g:ctrlp_use_caching'
    -启用/禁用每个会话的缓存:
    -  let g:ctrlp_use_caching = 1
    -
    -  0 - 禁用缓存。
    -  1 - 启用缓存。
    -  n - 当大于1时,禁用缓存,使用该数值作为重新启用缓存的限制条件。
    -
    -注意: 当在CtrlP中时你可以使用 <F5> 来快速的清除缓存。
    -
    -                                                'g:ctrlp_clear_cache_on_exit'
    -设置该选项为0通过退出Vim时不删除缓存文件来启用跨回话的缓存:
    -  let g:ctrlp_clear_cache_on_exit = 1
    -
    -
    -                                                          'g:ctrlp_cache_dir'
    -设置存储缓存文件的目录:
    -  let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
    -
    -
    -                                                        'g:ctrlp_show_hidden'
    -如果你想CtrlP扫描隐藏文件和目录,设置该选项为1:
    -  let g:ctrlp_show_hidden = 0
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                           'ctrlp-wildignore'
    -你可以使用Vim的 'wildignore' 来从结果集中排序文件或目录。
    -例子:
    -  " 排除版本控制文件
    -  set wildignore+=*/.git/*,*/.hg/*,*/.svn/*        " Linux/MacOSX
    -  set wildignore+=*\\.git\\*,*\\.hg\\*,*\\.svn\\*  " Windows ('noshellslash')
    -
    -注意 #1: 每个目录设置前的字符 */ 是必须的。
    -
    -注意 #2: wildignore 影响 expand()globpath()glob() 的结果,这些函数被很
    -多插件用来在系统中执行查找。(例如和版本控制系统有关的插件在查找.git/、.hg/等,
    -一些其他插件用来在Windows上查找外部的*.exe工具),所以要修改 wildignore 时请先
    -考虑清楚。
    -
    -                                                      'g:ctrlp_custom_ignore'
    -作为对 'wildignore' 的补充,用来设置你只是想在CtrlP中隐藏的文件和目录。使用正
    -则表达式来指定匹配模式:
    -  let g:ctrlp_custom_ignore = ''
    -
    -例子:
    -  let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
    -  let g:ctrlp_custom_ignore = {
    -    \ 'dir':  '\v[\/]\.(git|hg|svn)$',
    -    \ 'file': '\v\.(exe|so|dll)$',
    -    \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
    -    \ }
    -  let g:ctrlp_custom_ignore = {
    -    \ 'file': '\v(\.cpp|\.h|\.hh|\.cxx)@<!$'
    -    \ }
    -
    -注意 #1: 默认情况下, wildignoreg:ctrlp_custom_ignore 只在 globpath() 被用
    -来扫描文件的情况下使用,这样这些选项在那些使用 g:ctrlp_user_command 定义的命
    -令中不会生效。
    -
    -注意 #2: 当改变选项的变量类型时,记得先 :unlet ,或者重启Vim来避免这个错误:
    -"E706: Variable type mismatch" 。
    -
    -                                                          'g:ctrlp_max_files'
    -扫描文件的最大数量,设置为0时不进行限制:
    -  let g:ctrlp_max_files = 10000
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                          'g:ctrlp_max_depth'
    -目录树递归的最大层数:
    -  let g:ctrlp_max_depth = 40
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                       'g:ctrlp_user_command'
    -指定用来代替Vim的 globpath() 的外部工具来列出文件,使用 %s 代表目标目录:
    -  let g:ctrlp_user_command = ''
    -
    -例子:
    -  let g:ctrlp_user_command = 'find %s -type f'       " MacOSX/Linux
    -  let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
    -
    -你也可以使用 'grep', 'findstr' 或者其它东西来过滤结果集。
    -例子:
    -  let g:ctrlp_user_command =
    -    \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"'          " MacOSX/Linux
    -  let g:ctrlp_user_command =
    -    \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows
    -
    -在扫描一个大型项目时,在仓库目录中使用版本控制系统的列出命令会加快扫描速度:
    -  let g:ctrlp_user_command = [root_marker, listing_command, fallback_command]
    -  let g:ctrlp_user_command = {
    -    \ 'types': {
    -      \ 1: [root_marker_1, listing_command_1],
    -      \ n: [root_marker_n, listing_command_n],
    -      \ },
    -    \ 'fallback': fallback_command,
    -    \ 'ignore': 0 or 1
    -    \ }
    -
    -一些例子:
    -  " 单个版本控制系统,列出命令不会列出没有被追踪的文件:
    -  let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
    -  let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .']
    -
    -  " 多个版本控制系统:
    -  let g:ctrlp_user_command = {
    -    \ 'types': {
    -      \ 1: ['.git', 'cd %s && git ls-files'],
    -      \ 2: ['.hg', 'hg --cwd %s locate -I .'],
    -      \ },
    -    \ 'fallback': 'find %s -type f'
    -    \ }
    -
    -  " 单个版本控制系统,列出命令列出没有被追踪的文件(较慢):
    -  let g:ctrlp_user_command =
    -    \ ['.git', 'cd %s && git ls-files . -co --exclude-standard']
    -
    -  let g:ctrlp_user_command =
    -    \ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux
    -
    -  let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') '
    -    \ . 'do hg --cwd %s status -numac -I . %%a']           " Windows
    -
    -注意 #1: 在 Dictionary 格式, 'fallback''ignore' 是可选的,在 List 格式,
    -备选命令是可选的。
    -
    -注意 #2: 如果备选命令是空的或者属性 'fallback' 没有定义,当扫描仓库之外目录时,
    -globpath() 会被使用。
    -
    -注意 #3: 除非使用了 Dictionary 格式并且 'ignore' 被定义并且设置为1,当这些自
    -定义的命令被使用时 wildignoreg:ctrlp_custom_ignore 选项不会生效。没有出现
    -时,'ignore' 被默认设置为0来保留使用外部命令的性能优势。
    -
    -注意 #4: 当改变了选项的变量类型时,记得先 :unlet ,或者重启Vim来避免这个错误:
    -"E706: Variable type mismatch" 。
    -
    -注意 #5: 你可以在每个缓冲区内使用 b:var 来设置该选项。
    -
    -                                                        'g:ctrlp_max_history'
    -你希望CtrlP记录的用户输入历史的最大数目。默认值是Vim的全局选项 'history' :
    -  let g:ctrlp_max_history = &history
    -
    -设置为0来禁用提示符面板的历史。使用 <c-n><c-p> 来浏览历史。
    -
    -                                                      'g:ctrlp_open_new_file'
    -使用该选项指定当使用 <c-y> 打开新建的文件时,文件的打开方式:
    -  let g:ctrlp_open_new_file = 'v'
    -
    -  t - 在新页签中。
    -  h - 在新的水平分割窗口。
    -  v - 在新的竖直分割窗口。
    -  r - 在当前窗口。
    -
    -                                                'g:ctrlp_open_multiple_files'
    -如果非0, 会启用使用 <c-z><c-o> 打开多个文件:
    -  let g:ctrlp_open_multiple_files = 'v'
    -
    -例子:
    -  let g:ctrlp_open_multiple_files = '2vjr'
    -
    -对于数字:
    -  - 如果指定,会被用来作为打开文件时创建的窗口或者页签的最大数量(剩余的会在隐
    -    藏的缓冲区中打开)。
    -  - 如果没有指定,<c-o> 会打开所有文件,每个在一个新的窗口或者页签中。
    -
    -对于字母:
    -  t - 每个文件在一个新页签中。
    -  h - 每个文件在一个新的水平分割窗口中。
    -  v - 每个文件在一个新的竖直分割窗口中。
    -  i - 所有的文件在隐藏的缓冲区中。
    -  j - 打开以后,跳转到第一个打开的页签或者窗口。
    -  r - 在当前窗口打开第一个文件,其他文件根据同时出现的"h","v"和"t"中的一个,
    -      在新的分割窗口或者页签中打开。
    -
    -                                                            'g:ctrlp_arg_map'
    -当设置为1时, <c-o><c-y> 会接收一个额外的键值作为参数,来覆盖默认行为:
    -  let g:ctrlp_arg_map = 0
    -
    -按下 <c-o> 或者 <c-y> 会提示一次按键。按键可以是:
    -  t - 在新标签页中打开。
    -  h - 每个文件在一个新的水平分割窗口中。
    -  v - 每个文件在一个新的竖直分割窗口中。
    -  i - 所有的文件在隐藏的缓冲区中(只有 <c-o> 生效)。
    -  c - 清楚标记的文件(只有 <c-o> 生效)。
    -  r - 在当前窗口中打开(只有 <c-y> 生效)。
    -  <esc>, <c-c>, <c-u> - 取消并且回到提示符面板。
    -  <cr> - 使用 g:ctrlp_open_new_fileg:ctrlp_open_multiple_files 指定的默
    -         认行为。
    -
    -
    -                                                    'g:ctrlp_follow_symlinks'
    -如果非0,当列出文件时CtrlP会跟随链接:
    -  let g:ctrlp_follow_symlinks = 0
    -
    -  0 - 不要跟随链接。
    -  1 - 跟随但是忽略内部循环的链接,避免重复。
    -  2 - 无差别的跟随所有链接。
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                        'g:ctrlp_lazy_update'
    -设置为1将开启延迟更新特性:只在输入停止一个确定的时间后才更新匹配窗口:
    -  let g:ctrlp_lazy_update = 0
    -
    -如果设置为1,在250毫秒后更新。如果大于1,数字会被作为延迟时间使用。
    -
    -                                                      'g:ctrlp_default_input'
    -设置为1将为提示符面板提供当前文件的相对路径作为种子:
    -  let g:ctrlp_default_input = 0
    -
    -如果不指定1或0,如果选项的值是字符串,会被用来作为默认输入:
    -  let g:ctrlp_default_input = 'anystring'
    -
    -
    -                                                             'g:ctrlp_abbrev'
    -定义可以在提示面包内被扩展(内部的或者可见的)的输入缩写:
    -  let g:ctrlp_abbrev = {}
    -
    -例子:
    -  let g:ctrlp_abbrev = {
    -    \ 'gmode': 'i',
    -    \ 'abbrevs': [
    -      \ {
    -        \ 'pattern': '^cd b',
    -        \ 'expanded': '@cd ~/.vim/bundle',
    -        \ 'mode': 'pfrz',
    -      \ },
    -      \ {
    -        \ 'pattern': '\(^@.\+\|\\\@<!:.\+\)\@<! ',
    -        \ 'expanded': '.\{-}',
    -        \ 'mode': 'pfr',
    -      \ },
    -      \ {
    -        \ 'pattern': '\\\@<!:.\+\zs\\\@<! ',
    -        \ 'expanded': '\ ',
    -        \ 'mode': 'pfz',
    -      \ },
    -      \ ]
    -    \ }
    -
    -字符串 'pattern' 是使用正则表达式来匹配输入的匹配模式。扩展后就像扩展后的字符串
    -在提示符面板中被输入了一样。
    -
    -对于 'gmode' (可选的):
    -  i - 内部扩展(默认)。
    -  t - 插入扩展结果到提示符面板,就像你自己输入的一样。
    -  k - 当非关键字的字符被输入时,插入扩展结果到提示符面板。只在"t"也出现时生效。
    -
    -对于 'mode' (对于每个条目,可选的):
    -  f - 只应用于文件名模式。
    -  p - 只应用于全路径模式。
    -  r - 只应用于正则表达式模式。
    -  z - 只应用于模糊模式。
    -  n - 只应用于使用 <c-y> 创建新文件时(使用扩展后的字符串作为文件名)。
    -  c - 当使用 <tab> 自动补全目录名时(在自动补全之前立即扩展模式)。
    -  <empty> 或者未定义 - 总是启用。
    -
    -注意: 缩写条目按顺序求值,后求值的条目会覆盖先求值的条目;当 'gmode' 为"t"时,
    -包括他自己。
    -
    -                                                           'g:ctrlp_key_loop'
    -一个实验性的特性。设置该选项为1将为多字节字符开启输入事件循环:
    -  let g:ctrlp_key_loop = 0
    -
    -注意 #1: 当设置时,该选项会重置 g:ctrlp_lazy_update 选项。
    -
    -注意 #2: 你可以在提示符面板使用自定义的按键绑定切换这个特性:
    -  let g:ctrlp_prompt_mappings = { 'ToggleKeyLoop()': ['<F3>'] }
    -
    -
    -                                                         'g:ctrlp_use_migemo'
    -设置该选项为1将为日文文件名使用Migemo模式。Migemo搜索只在正则模式下有效。 使
    -用空格分割单词来分离模式:
    -  let g:ctrlp_use_migemo = 0
    -
    -
    -                                                    'g:ctrlp_prompt_mappings'
    -使用该选项来自定义CtrlP的提示窗口内的按键绑定为你喜欢的方式。你只需要保留你改
    -变值(在[]内部)的行:
    -  let g:ctrlp_prompt_mappings = {
    -    \ 'PrtBS()':              ['<bs>', '<c-]>'],
    -    \ 'PrtDelete()':          ['<del>'],
    -    \ 'PrtDeleteWord()':      ['<c-w>'],
    -    \ 'PrtClear()':           ['<c-u>'],
    -    \ 'PrtSelectMove("j")':   ['<c-j>', '<down>'],
    -    \ 'PrtSelectMove("k")':   ['<c-k>', '<up>'],
    -    \ 'PrtSelectMove("t")':   ['<Home>', '<kHome>'],
    -    \ 'PrtSelectMove("b")':   ['<End>', '<kEnd>'],
    -    \ 'PrtSelectMove("u")':   ['<PageUp>', '<kPageUp>'],
    -    \ 'PrtSelectMove("d")':   ['<PageDown>', '<kPageDown>'],
    -    \ 'PrtHistory(-1)':       ['<c-n>'],
    -    \ 'PrtHistory(1)':        ['<c-p>'],
    -    \ 'AcceptSelection("e")': ['<cr>', '<2-LeftMouse>'],
    -    \ 'AcceptSelection("h")': ['<c-x>', '<c-cr>', '<c-s>'],
    -    \ 'AcceptSelection("t")': ['<c-t>'],
    -    \ 'AcceptSelection("v")': ['<c-v>', '<RightMouse>'],
    -    \ 'ToggleFocus()':        ['<s-tab>'],
    -    \ 'ToggleRegex()':        ['<c-r>'],
    -    \ 'ToggleByFname()':      ['<c-d>'],
    -    \ 'ToggleType(1)':        ['<c-f>', '<c-up>'],
    -    \ 'ToggleType(-1)':       ['<c-b>', '<c-down>'],
    -    \ 'PrtExpandDir()':       ['<tab>'],
    -    \ 'PrtInsert("c")':       ['<MiddleMouse>', '<insert>'],
    -    \ 'PrtInsert()':          ['<c-\>'],
    -    \ 'PrtCurStart()':        ['<c-a>'],
    -    \ 'PrtCurEnd()':          ['<c-e>'],
    -    \ 'PrtCurLeft()':         ['<c-h>', '<left>', '<c-^>'],
    -    \ 'PrtCurRight()':        ['<c-l>', '<right>'],
    -    \ 'PrtClearCache()':      ['<F5>'],
    -    \ 'PrtDeleteEnt()':       ['<F7>'],
    -    \ 'CreateNewFile()':      ['<c-y>'],
    -    \ 'MarkToOpen()':         ['<c-z>'],
    -    \ 'OpenMulti()':          ['<c-o>'],
    -    \ 'PrtExit()':            ['<esc>', '<c-c>', '<c-g>'],
    -    \ }
    -
    -注意: 如果按 <bs> 后光标向左移动一个字符而不是删除一个字符,在你的.vimrc中添加
    -下面的设置来禁用插件默认的 <c-h> 绑定:
    -  let g:ctrlp_prompt_mappings = { 'PrtCurLeft()': ['<left>', '<c-^>'] }
    -
    -
    -----------------------------------------
    -MRU mode options:
    -
    -                                                           'g:ctrlp_mruf_max'
    -指定你希望CtrlP记录的最近打开的文件历史的数目:
    -  let g:ctrlp_mruf_max = 250
    -
    -
    -                                                       'g:ctrlp_mruf_exclude'
    -你不希望CtrlP记录的文件。使用正则表达式来指定模式:
    -  let g:ctrlp_mruf_exclude = ''
    -
    -例子:
    -  let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux
    -  let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows
    -
    -
    -                                                       'g:ctrlp_mruf_include'
    -如果你想让CtrlP只记录某些文件,在这里指定:
    -  let g:ctrlp_mruf_include = ''
    -
    -例子:
    -  let g:ctrlp_mruf_include = '\.py$\|\.rb$'
    -
    -
    -                                                      'g:ctrlp_mruf_relative'
    -设置该选项为1将只显示在当前工作目录内的最近最多使用文件:
    -  let g:ctrlp_mruf_relative = 0
    -
    -注意: 你可以在提示符面板使用自定义的按键绑定切换这个特性:
    -  let g:ctrlp_prompt_mappings = { 'ToggleMRURelative()': ['<F2>'] }
    -
    -
    -                                                 'g:ctrlp_mruf_default_order'
    -设置该选项为1将在最近最多使用模式搜索时禁用排序:
    -  let g:ctrlp_mruf_default_order = 0
    -
    -
    -                                                'g:ctrlp_mruf_case_sensitive'
    -将该选项和你的文件系统大小写敏感性保持一致来避免重复的最近最多使用条目:
    -  let g:ctrlp_mruf_case_sensitive = 1
    -
    -
    -                                                'g:ctrlp_mruf_save_on_update'
    -设置该选项为0将不会每当有一个新条目增加就把最近最多使用列表保存到磁盘文件,而
    -是在退出Vim时才保存:
    -  let g:ctrlp_mruf_save_on_update = 1
    -
    -
    -----------------------------------------
    -高级选项:
    -
    -                                                          'g:ctrlp_open_func'
    -使用一个自定义函数来打开选定的文件:
    -  let g:ctrlp_open_func = {}
    -
    -例子:
    -  let g:ctrlp_open_func = {
    -    \ 'files'     : 'Function_Name_1',
    -    \ 'buffers'   : 'Function_Name_2',
    -    \ 'mru files' : 'Function_Name_3',
    -    \ }
    -
    -函数结构:
    -  function! Function_Name(action, line)
    -    " 参数:
    -    " |
    -    " +- a:action : 打开的动作:
    -    " |             + 'e' : 用户按下 <cr>  (默认)
    -    " |             + 'h' : 用户按下 <c-x> (默认)
    -    " |             + 'v' : 用户按下 <c-v> (默认)
    -    " |             + 't' : 用户按下 <c-t> (默认)
    -    " |             + 'x' : 用户使用 <c-o> 终端对话框 (默认) 选择"e[x]ternal"。
    -    " |
    -    " +- a:line   : 选择的文件。
    -
    -  endfunction
    -
    -注意: 当使用<c-z><c-o>打开多个文件时无效。
    -
    -例子: 当 <c-t> 被按下时在默认浏览器中打开HTML文件,否则在Vim中打开
    -  function! HTMLOpenFunc(action, line)
    -    if a:action =~ '^[tx]$' && fnamemodify(a:line, ':e') =~? '^html\?$'
    -
    -      " 获取文件名
    -      let filename = fnameescape(fnamemodify(a:line, ':p'))
    -
    -      " 关闭CtrlP
    -      call ctrlp#exit()
    -
    -      " 打开文件
    -      silent! execute '!xdg-open' filename
    -
    -    elseif a:action == 'x' && fnamemodify(a:line, ':e') !~? '^html\?$'
    -
    -      " 不是HTML文件,再次模拟 <c-o> 按键并且等待新的输入
    -      call feedkeys("\<c-o>")
    -
    -    else
    -
    -      " 使用CtrlP的默认的打开文件的函数
    -      call call('ctrlp#acceptfile', [a:action, a:line])
    -
    -    endif
    -  endfunction
    -
    -  let g:ctrlp_open_func = { 'files': 'HTMLOpenFunc' }
    -
    -
    -                                                        'g:ctrlp_status_func'
    -为CtrlP窗口使用自定义的状态栏:
    -  let g:ctrlp_status_func = {}
    -
    -例子:
    -  let g:ctrlp_status_func = {
    -    \ 'main': 'Function_Name_1',
    -    \ 'prog': 'Function_Name_2',
    -    \ }
    -
    -函数结构:
    -  " 主状态栏
    -  function! Function_Name_1(focus, byfname, regex, prev, item, next, marked)
    -    " 参数:
    -    " |
    -    " +- a:focus   : 提示符面板的焦点: "prt" 或者 "win"。
    -    " |
    -    " +- a:byfname : 在文件名模式还是全路径模式: "file" 或者 "path"。
    -    " |
    -    " +- a:regex   : 是否在正则表达式模式: 1 or 0。
    -    " |
    -    " +- a:prev    : 前一个搜索模式。
    -    " |
    -    " +- a:item    : 当前的搜索模式。
    -    " |
    -    " +- a:next    : 下一个搜索模式。
    -    " |
    -    " +- a:marked  : 被标记文件的数目,或者一个逗号分隔的被标记的文件名列表。
    -
    -    return full_statusline
    -  endfunction
    -
    -  " 状态栏进度条
    -  function! Function_Name_2(str)
    -    " a:str : 一个当前已扫描的文件数,或者一个当前扫描目录和用户命令的字符串。
    -
    -    return full_statusline
    -  endfunction
    -
    -一个可用的例子,参见 https://gist.github.com/1610859 。
    -
    -                                                        'g:ctrlp_buffer_func'
    -指定一个会在启动或者退出CtrlP缓冲区时被调用的函数:
    -  let g:ctrlp_buffer_func = {}
    -
    -例子:
    -  let g:ctrlp_buffer_func = {
    -    \ 'enter': 'Function_Name_1',
    -    \ 'exit':  'Function_Name_2',
    -    \ }
    -
    -
    -                                                         'g:ctrlp_match_func'
    -为CtrlP设置一个额外的模糊匹配函数:
    -  let g:ctrlp_match_func = {}
    -
    -例子:
    -  let g:ctrlp_match_func = { 'match': 'Function_Name' }
    -
    -函数结构:
    -  function! Function_Name(items, str, limit, mmode, ispath, crfile, regex)
    -    " 参数:
    -    " |
    -    " +- a:items  : 搜索条目的全列表。
    -    " |
    -    " +- a:str    : 用户输入的字符串。
    -    " |
    -    " +- a:limit  : 匹配窗口的最大高度。可以用来限制返回的条目数量。
    -    " |
    -    " +- a:mmode  : 在匹配模式。可以是下列字符串之一:
    -    " |             + "full-line": 匹配整行。
    -    " |             + "filename-only": 只匹配文件名。
    -    " |             + "first-non-tab": 匹配到第一个制表符。
    -    " |             + "until-last-tab": 匹配到最后一个制表符。
    -    " |
    -    " +- a:ispath : 搜索文件,缓冲区,最近最多使用,混合,目录和rtscript模.
    -    " |             式时为1。其它为0。
    -    " |
    -    " +- a:crfile : 当前窗口中的文件。当a:ispath为1时应该被搜索结果排除在外
    -    " |
    -    " +- a:regex  : 是否在正则表达式模式: 1 or 0.
    -
    -    return list_of_matched_items
    -  endfunction
    -
    -
    -注意: 你可以通过 { 'arg_type': 'dict' } 扩展上面的任何选项,这样就可以通过
    -一个字典类型的参数来传递所有的函数参数。使用参数名作为字典的键值。
    -
    -例子:
    -  let g:ctrlp_status_func = {
    -    \ 'arg_type' : 'dict',
    -    \ 'enter': 'Function_Name_1',
    -    \ 'exit':  'Function_Name_2',
    -    \ }
    -
    -  function! Function_Name_1(dict)
    -    " where dict == {
    -    " \ 'focus':   value,
    -    " \ 'byfname': value,
    -    " \ 'regex':   value,
    -    " \ ...
    -    " }
    -  endfunction
    -
    -
    -===============================================================================
    -命令                                                           ctrlp-commands
    -
    -                                                                       :CtrlP
    -:CtrlP [起始目录]
    -   用文件搜索模式打开CtrlP。
    -
    -   如果没有给定参数,g:ctrlp_working_path_mode 会被用来决定起始目录。
    -
    -   在输入时你可以使用 <tab> 自动补全[起始目录]。
    -
    -                                                                 :CtrlPBuffer
    -:CtrlPBuffer
    -   用缓冲区搜索模式打开CtrlP。
    -
    -                                                                    :CtrlPMRU
    -:CtrlPMRU
    -   用最近最多使用模式打开CtrlP。
    -
    -                                                               :CtrlPLastMode
    -:CtrlPLastMode [--dir]
    -   用上一次使用的模式打开CtrlP。当提供了"--dir"参数,也重用上一次的工作目录。
    -
    -                                                                   :CtrlPRoot
    -:CtrlPRoot
    -    行为类似使用了 g:ctrlp_working_path_mode = 'r' 并且忽略了该变量的当前值的
    -    :CtrlP 命令。
    -
    -                                                             :CtrlPClearCache
    -:CtrlPClearCache
    -   清除当前工作目录的缓存。和在CtrlP内按 <F5> 效果一样。
    -   使用 g:ctrlp_use_caching 来启用或禁用缓存。
    -
    -                                                         :CtrlPClearAllCaches
    -:CtrlPClearAllCaches
    -   删除在 g:ctrlp_cache_dir 中定义的缓存目录中的所有缓存文件。
    -
    --------------------------------------------------------------------------------
    -由扩展提供的命令参见 ctrlp-extensions 。
    -
    -===============================================================================
    -按键绑定                                                        ctrlp-mappings
    -
    -                                                                'ctrlp-<c-p>'
    -<c-p>
    -   普通模式 Normal 下默认以文件搜索模式打开CtrlP提示符面板。
    -
    -----------------------------------------
    -已经在提示符面板中:
    -
    -  <c-d>
    -    在全路径搜索和文件名搜索间切换。
    -    注意: 在文件名搜索模式,提示符面板的提示符是'>d>',而不是'>>>'
    -
    -  <c-r>                                                    'ctrlp-fullregexp'
    -    在字符串搜索模式和正则表达式模式之间切换。
    -    注意: 在全正则表达式模式,提示符面板的提示符是'r>>',而不是'>>>'
    -
    -    详细参见: input-formats (指引)和 g:ctrlp_regexp_search 选项。
    -
    -  <c-f>, 'forward' 前进
    -  <c-up>
    -    切换到序列里面的 'next' 后一个搜索模式。
    -
    -  <c-b>, 'backward' 后退
    -  <c-down>
    -    切换到序列里面的 'previous' 前一个搜索模式。
    -
    -  <tab>                                                'ctrlp-autocompletion'
    -    自动补全在提示符面板的当前工作路径中的目录名。
    -
    -  <s-tab>
    -    在匹配窗口和提示符面板之间切换焦点。
    -
    -  <esc>,
    -  <c-c>
    -    退出CtrlP。
    -
    -移动:
    -
    -  <c-j>,
    -  <down>
    -    向下移动。
    -
    -  <c-k>,
    -  <up>
    -    向上移动。
    -
    -  <c-a>
    -    移动光标到提示符面板的 'start' 开头。
    -
    -  <c-e>
    -    移动光标到提示符面板的 'end' 末尾。
    -
    -  <c-h>,
    -  <left>,
    -  <c-^>
    -    向左 'left' 移动一个字符。
    -
    -  <c-l>,
    -  <right>
    -    向右 'right' 移动一个字符。
    -
    -编辑:
    -
    -  <c-]>,
    -  <bs>
    -    删除前一个字符。
    -
    -  <del>
    -    删除当前字符。
    -
    -  <c-w>
    -    删除前一个单词。
    -
    -  <c-u>
    -    清除输入。
    -
    -浏览输入历史:
    -
    -  <c-n>
    -    提示符面板历史里的下一个字符串。
    -
    -  <c-p>
    -    提示符面板历史里的上一个字符串。
    -
    -打开/创建文件:
    -
    -  <cr>
    -    如果可能的话在 'current' 当前窗口打开选择的文件。
    -
    -  <c-t>
    -    在 'tab' 新标签打开选择的文件。
    -    Open the selected file in a new 'tab'.
    -
    -  <c-v>
    -    在 'vertical' 竖直分割窗口打开选择的文件。
    -
    -  <c-x>,
    -  <c-cr>,
    -  <c-s>
    -    在 'horizontal' 水平分割窗口打开选择的文件。
    -
    -  <c-y>
    -    创建一个新文件和它的父目录。
    -
    -打开多个文件:
    -
    -  <c-z>
    -    - 标记/取消标记一个被 <c-o> 打开的文件。
    -    - 标记/取消标记一个被 <c-y> 在它的目录被创建的文件。
    -
    -  <c-o>
    -    - 打开被 <c-z> 标记的文件。
    -    - 当没有文件被 <c-z> 标记时,使用下列选项打开一个终端对话框:
    -
    -      打开被选择的文件:
    -        t - 在新标签页中打开。
    -        v - 在一个竖直分割窗口中。
    -        h - 在一个水平分割窗口中。
    -        r - 在当前窗口中打开。
    -        i - 在隐藏的缓冲区中。
    -        x - (可选的)使用 g:ctrlp_open_func 中定义的函数。
    -
    -      其它选项 (未显示):
    -        a - 标记匹配窗口中的所有文件。
    -        d - 改变CtrlP的工作目录到被选择的文件的目录并切换到文件搜索模式。
    -
    -功能按键绑定:
    -
    -  <F5>
    -    - 刷新匹配窗口并且清除当前目录的缓存。
    -    - 从最近最多使用中移除被删除的文件。
    -
    -  <F7>
    -    - 清除最近最多使用列表。
    -    - 删除被 <c-z> 标记的最近最多使用条目。
    -
    -粘贴:
    -
    -  <Insert>,                                                   'ctrlp-pasting'
    -  <MiddleMouse>
    -    将剪贴板中的文本粘贴到提示符窗口中。
    -
    -  <c-\>
    -    打开一个终端对话框来粘贴 <cword><cfile>,搜索寄存器的文本,上一次可视
    -    化模式的选择,剪贴板或者任何寄存器到提示符面板中。
    -
    -使用 g:ctrlp_prompt_mappings 选择你自己的绑定。
    -
    -----------------------------------------
    -当焦点在匹配窗口中时(使用 <s-tab> 来切换):
    -
    -  a-z
    -  0-9
    -  ~^-=;`',.+!@#$%&_(){}[]
    -    在匹配第一个字符的行中循环。
    -
    -===============================================================================
    -输入格式                                                  ctrlp-input-formats
    -
    -提示符面板的输入格式:
    -
    -a)  字符串。
    -
    -    例如: 'abc' 被内部理解为 'a[^a]\{-}b[^b]\{-}c'
    -
    -b)  在正则表达式模式,输入字符串被按照Vim的正则表达式模式 pattern 来对待,不
    -    进行任何修改。
    -
    -    例如: 'abc\d*efg' 会被解读为 'abc\d*efg'。
    -
    -    如何启用正则表达式模式参见 ctrlp-fullregexp (按键绑定)和
    -    g:ctrlp_regexp_search (选项)。
    -
    -c)  字符串末尾使用一个冒号':'跟随一个Vim命令来在打开那个文件后执行该命令。如果
    -    你需要使用':'的字面意思,使用反斜杠转义'\:'。但打开多个文件时,命令会在每
    -    个打开文件上执行。
    -
    -    例如: 使用':45'跳转到第45行。
    -
    -          使用':/any\:string'跳转到'any:string'第一次出现的地方。
    -
    -          使用':+setf\ myfiletype|50'来设置文件类型为 'myfiletype',然后跳转
    -          到第50行。
    -
    -          使用':diffthis'当打开多个文件时在前四个文件上调用 :diffthis 。
    -
    -    参见: Vim的 ++opt+cmd.
    -
    -d)  提交两个点号 '..' 来进入上级目录。如果想进入向上多级目录,每多一级使用一个
    -    额外的点号:
    -
    -         输入         解释为
    -         ..           ../
    -         ...          ../../
    -         ....         ../../../
    -
    -    注意: 如果父目录很大并且没有被缓存,可能会很慢。
    -
    -    你可以使用'@cd path/'来改变CtrlP的工作目录为path/。使用'@cd %:h'来改变为当
    -    前文件的目录。
    -
    -e)  相似的,提交'/'或者'\'来查找或者跳转到项目的根目录。
    -
    -    如果项目很大,使用版本控制系统的列出命令来寻找文件可能会加速初始化扫描。(
    -    更多细节参见 g:ctrlp_user_command )。
    -
    -    注意: d) 和 e) 只在文件,目录和混合模式生效。
    -
    -f)  输入一个不存在的文件名并且按下 <c-y> 来创建文件。如果使用 <c-z> 标记了一个
    -    文件,将会在被标记的文件的目录下创建这个新文件。
    -
    -    例如: 使用 'newdir/newfile.txt' 会创建一个名为'newdir'的目录和一个名为
    -          'newfile.txt'的文件。
    -
    -          如果一个条目'some/old/dirs/oldfile.txt'被 <c-z> 标记,然后 'newdir'
    -          和'newfile.txt'会在'some/old/dirs'下被创建。最终的路径会像下面这样
    -          'some/old/dirs/newdir/newfile.txt'.
    -
    -    注意: 在Windows下使用 '\' 代替 '/' (如果 'shellslash' 选项没有设置)。
    -
    -g)  在文件名模式(使用 <c-d> 切换)下,你可以使用被逗号分隔的一个主要的模式和
    -    一个改善的模式。两个模式在正则表达式模式下像(a)或(b)那样工作。
    -
    -h)  使用?打开帮助文件。
    -
    -===============================================================================
    -扩展                                                         ctrlp-extensions
    -
    -扩展是可选的。把它的名字添加到变量g:ctrlp_extensions中来开启扩展:
    -  let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript',
    -                          \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
    -
    -扩展的名字在变量中出现的顺序会是在使用命令 <c-f><c-b> 切换时扩展在状态栏中出
    -现的顺序。
    -
    -可用的扩展:
    -
    -                                                                    :CtrlPTag
    -  * 标记模式:
    -    - 名称: 'tag'
    -    - 命令: ":CtrlPTag"
    -    - 在一个生成的标记文件中搜索标签,跳转到标签定义。使用Vim的 'tags' 来指定
    -      标签文件的位置和名称。
    -      例如: set tags+=doc/tags
    -
    -                                                                 :CtrlPBufTag
    -                                                              :CtrlPBufTagAll
    -  * 缓冲区标签模式:
    -    - 名称: 'buffertag'
    -    - 命令: ":CtrlPBufTag [缓冲区]",
    -                ":CtrlPBufTagAll"。
    -    - 在当前缓冲区或者所有列出的缓冲区中搜索标签并且跳转到定义。需要
    -      exuberant_ctags 或者兼容的程序。
    -
    -                                                               :CtrlPQuickfix
    -  * 快速修复模式:
    -    - 名称: 'quickfix'
    -    - 命令: ":CtrlPQuickfix"
    -    - 在当前的快速修复错误列表中搜索条目并且跳转过去。
    -
    -                                                                    :CtrlPDir
    -  * 目录模式:
    -    - 名称: 'dir'
    -    - 命令: ":CtrlPDir [起始muu]"
    -    - 搜索目录并且将其作为工作目录。
    -    - 按键绑定:
    -      + <cr> 为CtrlP修改工作目录并且保持打开状态。
    -      + <c-t> 修改全局的工作目录(退出)。
    -      + <c-v> 为当前窗口修改工作目录(退出)。
    -      + <c-x> 修改全局工作目录为CtrlP的当前工作目录(退出)。
    -
    -                                                                    :CtrlPRTS
    -  * 运行时脚本模式:
    -    - 名称: 'rtscript'
    -    - 命令: ":CtrlPRTS"
    -    - 在运行时路径中寻找文件(vimscripts, docs, snippets...)。
    -
    -                                                                   :CtrlPUndo
    -  * 撤销模式:
    -    - 名称: 'undo'
    -    - 命令: ":CtrlPUndo"
    -    - 浏览撤销历史。
    -
    -                                                                   :CtrlPLine
    -  * 行模式:
    -    - 名称: 'line'
    -    - 命令: ":CtrlPLine [缓冲区]"
    -    - 在所有列出的缓冲区或者在指定的 [buffer] 缓冲区内搜索一行内容。
    -
    -                                                                 :CtrlPChange
    -                                                              :CtrlPChangeAll
    -  * 修改列表模式:
    -    - 名称: 'changes'
    -    - 命令: ":CtrlPChange [缓冲区]",
    -                ":CtrlPChangeAll".
    -    - 在当前缓冲区或者在所有列出的缓冲区内搜索最近的修改并跳转。
    -
    -                                                                  :CtrlPMixed
    -  * 混合模式:
    -    - 名称: 'mixed'
    -    - 命令: ":CtrlPMixed"
    -    - 同时在文件,缓冲区和最近最多修改中搜索。
    -
    -                                                            :CtrlPBookmarkDir
    -                                                         :CtrlPBookmarkDirAdd
    -  * 书签目录模式:
    -    - 名称: 'bookmarkdir'
    -    - 命令: ":CtrlPBookmarkDir",
    -                ":CtrlPBookmarkDirAdd [目录]".
    -    - 搜索一个被书签标记的目录并将其作为工作目录。
    -    - 按键绑定:
    -      + <cr> 为CtrlP修改工作目录并且保持打开状态,并且切换到文件搜索模式。
    -      + <c-x> 修改全局的工作目录(退出)。
    -      + <c-v> 为当前窗口修改工作目录(退出)。
    -      + <F7>
    -        - 清除书签列表。
    -        - 删除被 <c-z> 标记的书签条目。
    -
    -----------------------------------------
    -缓冲区标记模式选项:
    -
    -                                                   'g:ctrlp_buftag_ctags_bin'
    -如果ctags没有在环境变量中配置,使用该选项来指定它的位置:
    -  let g:ctrlp_buftag_ctags_bin = ''
    -
    -
    -                                                   'g:ctrlp_buftag_systemenc'
    -将该选项与你的操作系统的编码(非Vim的)保持一致。默认值使用Vim的全局
    -'encoding' 选项:
    -  let g:ctrlp_buftag_systemenc = &encoding
    -
    -
    -                                                       'g:ctrlp_buftag_types'
    -使用该选项来在ctags, jsctags...中为指定的文件格式设置参数:
    -  let g:ctrlp_buftag_types = ''
    -
    -例子:
    -  let g:ctrlp_buftag_types = {
    -    \ 'erlang'     : '--language-force=erlang --erlang-types=drmf',
    -    \ 'javascript' : {
    -      \ 'bin': 'jsctags',
    -      \ 'args': '-f -',
    -      \ },
    -    \ }
    -
    -
    -===============================================================================
    -自定义                                                    ctrlp-customization
    -
    -高亮:
    -  * CtrlP缓冲区的设置:
    -    CtrlPNoEntries : 当没有匹配被发现时的消息(错误)。
    -    CtrlPMatch     : 匹配模式(标识)。
    -    CtrlPLinePre   : 匹配窗口的行前缀'>'。
    -    CtrlPPrtBase   : 提示符窗口的基础(注释)。
    -    CtrlPPrtText   : 提示符窗口的文本 (hl-Normal)。
    -    CtrlPPrtCursor : 提示符窗口的光标在文本上移动时(常量)。
    -
    -  * 在扩展中:
    -    CtrlPTabExtra  : 每一行中不匹配的部分(注释)。
    -    CtrlPBufName   : 条目所属的缓冲区名称(hl-Directory)。
    -    CtrlPTagKind   : 缓冲区标签模式中标签的类型(hl-Title)。
    -    CtrlPqfLineCol : 快速修复模式中行和列的序号(注释)。
    -    CtrlPUndoT     : 撤销模式的流逝时间(hl-Directory)。
    -    CtrlPUndoBr    : 撤销模式的方括号(注释)。
    -    CtrlPUndoNr    : 撤销模式的方括号中的数字(字符串)。
    -    CtrlPUndoSv    : 文件被保存的点(注释)。
    -    CtrlPUndoPo    : 撤销树中的当前位置(hl-Title)。
    -    CtrlPBookmark  : 书签的名称(标识)。
    -
    -状态栏:
    -  * 高亮组:
    -    CtrlPMode1 : 'file''path''line',和当前模式(字符)。
    -    CtrlPMode2 : 'prt''win''regex',工作目录 hl-LineNr 。
    -    CtrlPStats : 扫描状态(函数)。
    -
    -  重新构建状态栏,参见 g:ctrlp_status_func 。
    -
    -===============================================================================
    -其它选项                                          ctrlp-miscellaneous-configs
    -
    -* 为 g:ctrlp_user_command 使用 wildignore :
    -
    -  function! s:wig2cmd()
    -    " 修改wildignore为空格或者|分隔的组
    -    " 例如: .aux .out .toc .jpg .bmp .gif
    -    " 或者  .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$
    -    let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@<!,\|$\)','\\\@<!,']
    -    let subs = has('win32') || has('win64') ? ['\1\3', ' '] : ['\1\2\3', '\\|']
    -    let expr = substitute(&wig, pats[0], subs[0], 'g')
    -    let expr = substitute(expr, pats[1], subs[1], 'g')
    -    let expr = substitute(expr, '\\,', ',', 'g')
    -
    -    " 设置用户命令选项
    -    let g:ctrlp_user_command = has('win32') || has('win64')
    -      \ ? 'dir %s /-n /b /s /a-d | findstr /V /l "'.expr.'"'
    -      \ : 'find %s -type f | grep -v "'.expr .'"'
    -  endfunction
    -
    -  call s:wig2cmd()
    -
    -(由 Rich Alesi <github.com/ralesi> 提交)
    -
    -* 一个独立的函数,设置项目的根目录为工作目录,如果没有找到根目录的话使用当前文
    -* 件的父目录。
    -
    -  function! s:setcwd()
    -    let cph = expand('%:p:h', 1)
    -    if cph =~ '^.\+://' | retu | en
    -    for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects']
    -      let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';'])
    -      if wd != '' | let &acd = 0 | brea | en
    -    endfo
    -    exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', ''))
    -  endfunction
    -
    -  autocmd BufEnter * call s:setcwd()
    -
    -(需要 Vim 7.1.299+)
    -
    -* 使用 count 来使用同样的按键绑定调用不同的命令:
    -
    -  let g:ctrlp_cmd = 'exe "CtrlP".get(["", "Buffer", "MRU"], v:count)'
    -
    -
    -===============================================================================
    -开发人员                                                        ctrlp-credits
    -
    -由 Kien Nguyen <github.com/kien>开发。 在Vim的 license 下发行。
    -
    -项目主页:      http://kien.github.com/ctrlp.vim
    -Git仓库:       https://github.com/kien/ctrlp.vim
    -Mercurial仓库: https://bitbucket.org/kien/ctrlp.vim
    -
    --------------------------------------------------------------------------------
    -感谢所有通过github,bitbucket或电子邮件提供想法,报告bug或者帮助debugging的人。
    -
    -特别感谢:
    -
    -    * Woojong Koh <github.com/wjkoh>
    -    * Simon Ruderich
    -    * Yasuhiro Matsumoto <github.com/mattn>
    -    * Ken Earley <github.com/kenearley>
    -    * Kyo Nagashima <github.com/hail2u>
    -    * Zak Johnson <github.com/zakj>
    -    * Diego Viola <github.com/diegoviola>
    -    * Piet Delport <github.com/pjdelport>
    -    * Thibault Duplessis <github.com/ornicar>
    -    * Kent Sibilev <github.com/datanoise>
    -    * Tacahiroy <github.com/tacahiroy>
    -    * Luca Pette <github.com/lucapette>
    -    * Seth Fowler <github.com/sfowler>
    -    * Lowe Thiderman <github.com/thiderman>
    -    * Christopher Fredén <github.com/icetan>
    -    * Zahary Karadjov <github.com/zah>
    -    * Jo De Boeck <github.com/grimpy>
    -    * Rudi Grinberg <github.com/rgrinberg>
    -    * Timothy Mellor <github.com/mellort>
    -
    -===============================================================================
    -更新日志                                                      ctrlp-changelog
    -
    -    + 结合 g:ctrlp_match_window_bottom g:ctrlp_match_window_reversed 和
    -      g:ctrlp_max_heightg:ctrlp_match_window 。
    -    + 新选项: g:ctrlp_match_window 。
    -
    -在2012/11/30之前
    -
    -    + 新选项: g:ctrlp_abbrev,
    -              g:ctrlp_key_loop,
    -              g:ctrlp_open_func,
    -              g:ctrlp_tabpage_position,
    -              g:ctrlp_mruf_save_on_update
    -    + 重命名:
    -        g:ctrlp_dotfiles -> g:ctrlp_show_hidden 。
    -    + 修改 g:ctrlp_switch_bufferg:ctrlp_working_path_mode的类型
    -      (旧值仍然工作)。
    -    + 当 g:ctrlp_user_command 是一个字典时,为其增加一个新的键: 'ignore'。
    -
    -在2012/06/15之前
    -
    -    + g:ctrlp_follow_symlinks 的新值: 2。
    -    + g:ctrlp_open_multiple_files 的新值: 'j'。
    -    + 允许使用 <c-t>, <c-x>, <c-v> 打开被 <c-z> 标记的文件。
    -    + 扩展 '..' (ctrlp-input-formats (d))
    -    + 新的输入格式: '@cd' (ctrlp-input-formats (d))
    -
    -在2012/04/30之前
    -
    -    + 新选项: g:ctrlp_mruf_default_order
    -    + 新特性: 被书签标记的目录的扩展。
    -    + 新命令: :CtrlPBookmarkDir
    -              :CtrlPBookmarkDirAdd
    -
    -在2012/04/15之前
    -
    -    + 新选项: g:ctrlp_buffer_func,CtrlP缓冲区的回调函数。
    -    + 移除  : g:ctrlp_mruf_last_entered,使其作为最近最多使用的默认行为。
    -    + 新命令: :CtrlPLastMode,以上一次使用的模式打开CtrlP。
    -              :CtrlPMixed,在文件,缓冲区和最近最多使用中搜索。
    -
    -在2012/03/31之前
    -
    -    + 新选项: g:ctrlp_default_input, 进入CtrlP后的默认输入。
    -              g:ctrlp_match_func,允许使用自定义的模糊查找工具。
    -    + 重命名:
    -        ClearCtrlPCache -> CtrlPClearCache
    -        ClearAllCtrlPCaches -> CtrlPClearAllCaches
    -        ResetCtrlP -> CtrlPReload
    -
    -在2012/03/02之前
    -
    -    + 重命名:
    -        g:ctrlp_regexp_search -> g:ctrlp_regexp,
    -        g:ctrlp_dont_split -> g:ctrlp_reuse_window,
    -        g:ctrlp_jump_to_buffer -> g:ctrlp_switch_buffer。
    -    + 重命名和微调:
    -        g:ctrlp_open_multi -> g:ctrlp_open_multiple_files。
    -    + 过时 g:ctrlp_highlight_match
    -    + 扩展 g:ctrlp_user_command 支持多个命令。
    -    + 新选项: g:ctrlp_mruf_last_entered 修改最近最多使用为最近进入。
    -
    -在2012/01/15之前
    -
    -    + 新按键绑定: 交换 <tab><s-tab>. <tab> 现在用来补全在当前工作目录内的目
    -                  录名。
    -    + 新选项: g:ctrlp_arg_map 使 <c-y><c-o> 可以接收一个参数。
    -              g:ctrlp_status_func 自定义状态栏。
    -              g:ctrlp_mruf_relative 在当前工作目录内显示最近最多使用。
    -    + 扩展 g:ctrlp_open_multi 增加新选项值: tr, hr, vr。
    -    + 扩展 g:ctrlp_custom_ignore 指定过滤目录,文件和链接。
    -
    -在2012/01/05之前
    -
    -    + 新特性: 缓冲区标记扩展。
    -    + 新命令: :CtrlPBufTag, :CtrlPBufTagAll。
    -    + 新选项: g:ctrlp_cmd,
    -              g:ctrlp_custom_ignore
    -
    -在2011/11/30之前
    -
    -    + 新特性: 标签,快速修复和目录扩展。
    -    + 新命令: :CtrlPTag, :CtrlPQuickfix, :CtrlPDir。
    -    + 新选项: g:ctrlp_use_migemo,
    -              g:ctrlp_lazy_update,
    -              g:ctrlp_follow_symlinks
    -
    -在2011/11/13之前
    -
    -    + 新的特殊输入: '/' 和 '\' 查找根目录 (ctrlp-input-formats (e))
    -    + 移除 ctrlp#SetWorkingPath()。
    -    + 移除 g:ctrlp_mru_files ,使最近最多使用模式变为永久的。
    -    + 扩展 g:ctrlp_open_multi,添加打开文件的新方式。
    -    + 新选项: g:ctrlp_dont_split,
    -              g:ctrlp_mruf_case_sensitive
    -
    -在2011/10/30之前
    -
    -    + 新特性: 支持自定义扩展。
    -              <F5> 也会从最近最多使用列表中移除不存在的文件。
    -    + 新选项: g:ctrlp_jump_to_buffer
    -
    -在2011/10/12之前
    -
    -    + 新特性: 打开多个文件。
    -              传递Vim的 ++opt+cmd 到新打开的文件
    -              (ctrlp-input-formats (c))
    -              为 :CtrlP [起始目录]自动补全每个目录
    -    + 新按键绑定: <c-z> 标记/取消标记一个被 <c-o> 打开的文件。
    -                  <c-o> 打开所有被标记的文件。
    -    + 新选项: g:ctrlp_open_multi
    -    + 移除 g:ctrlp_persistent_input g:ctrlp_live_update and <c-^>。
    -
    -在2011/09/29之前
    -
    -    + 新按键绑定: <c-n>, <c-p> 输入历史中的前一个/后一个字符串。
    -                  <c-y> 创建一个新的文件和它的父目录。
    -    + 新选项: g:ctrlp_open_new_file,
    -                   g:ctrlp_max_history
    -    + 添加一个新的在横向分割窗口打开的绑定:<c-x>
    -
    -在2011/09/19之前
    -
    -    + 新命令: ResetCtrlP
    -    + 新选项: g:ctrlp_max_files,
    -              g:ctrlp_max_depth,
    -              g:ctrlp_live_update
    -    + 新按键绑定: <c-^>
    -
    -在2011/09/12之前
    -
    -    + 添加在匹配窗口内循环匹配行的功能。
    -    + 扩展 g:ctrlp_persistent_input的行为
    -    + 扩展 :CtrlP 的行为
    -    + 新选项: g:ctrlp_dotfiles,
    -              g:ctrlp_clear_cache_on_exit,
    -              g:ctrlp_highlight_match,
    -              g:ctrlp_user_command
    -    + 新的特殊输入: '..' (ctrlp-input-formats (d))
    -    + 新按键绑定: <F5>。
    -    + 新命令: :CtrlPCurWD,
    -              :CtrlPCurFile,
    -              :CtrlPRoot
    -
    -    + 新特性: 在最近最常使用的文件列表中搜索
    -    + 新按键绑定: <c-b>。
    -    + 扩展 <c-f> 的行为。
    -    + 新选项: g:ctrlp_mru_files,
    -              g:ctrlp_mruf_max,
    -              g:ctrlp_mruf_exclude,
    -              g:ctrlp_mruf_include
    -    + 新命令: :CtrlPMRU
    -
    -第一版发布于: 2011/09/06
    -
    -===============================================================================
    -vim:ft=help:et:ts=2:sw=2:sts=2:norl
    -
    - - - diff --git a/pages/ctrlp-cn.light.html b/pages/ctrlp-cn.light.html deleted file mode 100644 index da04d41..0000000 --- a/pages/ctrlp-cn.light.html +++ /dev/null @@ -1,1445 +0,0 @@ - - - - -~/.vim/bundle/ctrlp.git/doc/ctrlp.cnx.xhtml - - - - - - - - - - -
    -ctrlp.txt       模糊的 文件, 缓冲区, 最近最多使用, 标签, ... 检索. v1.79
    -CtrlP ControlP 'ctrlp' 'ctrl-p'
    -===============================================================================
    -#                                                                             #
    -#          :::::::: ::::::::::: :::::::::  :::             :::::::::          #
    -#         :+:    :+:    :+:     :+:    :+: :+:             :+:    :+:         #
    -#         +:+           +:+     +:+    +:+ +:+             +:+    +:+         #
    -#         +#+           +#+     +#++:++#:  +#+             +#++:++#+          #
    -#         +#+           +#+     +#+    +#+ +#+             +#+                #
    -#         #+#    #+#    #+#     #+#    #+# #+#             #+#                #
    -#          ########     ###     ###    ### ##########      ###                #
    -#                                                                             #
    -===============================================================================
    -名词对照(译注)
    -
    -  buffer:缓冲区                    mapping:按键绑定
    -     mru:最近最多使用               prompt:提示符面板
    -     tag:标签                          tab:页签
    -     tab:制表符
    -
    -===============================================================================
    -内容                                                            ctrlp-content
    -
    -    1. 介绍.............................................ctrlp-intro
    -    2. 选项.............................................ctrlp-options
    -    3. 命令.............................................ctrlp-commands
    -    4. 按键绑定.........................................ctrlp-mappings
    -    5. 输入格式.........................................ctrlp-input-formats
    -    6. 扩展.............................................ctrlp-extensions
    -
    -===============================================================================
    -介绍                                                              ctrlp-intro
    -
    -带有直观接口的全路径模糊文件, 缓冲区, 最近最多使用, 标签, ... 检索。
    -使用纯净的Vimscript编写,可以运行在MacVim,gVim和版本号7.0以上的Vim中。
    -全面支持Vim的正则表达式 regexp 作为搜索模式,内建最近最多使用文件监测,
    -项目根目录定位和更多特性。
    -
    -开启可选的扩展(标记,目录,rtscripts...),参考 ctrlp-extensions 。
    -
    -===============================================================================
    -OPTIONS                                                         ctrlp-options
    -
    -总览:
    -
    -  loaded_ctrlp................禁用插件。
    -  ctrlp_map...................默认按键绑定。
    -  ctrlp_cmd...................默认按键绑定调用的命令。
    -  ctrlp_by_filename...........是否默认开启文件名模式。
    -  ctrlp_regexp................是否默认开启正则表达式模式。
    -  ctrlp_match_window..........匹配窗口的显示位置。
    -  ctrlp_switch_buffer.........如果文件已在缓冲区中打开,跳转到该打开的缓冲区。
    -  ctrlp_reuse_window..........重用特殊窗口(帮助、快速修复 quickfix ,等等)。
    -  ctrlp_tabpage_position......新标签页出现的位置。
    -  ctrlp_working_path_mode.....如何设置CtrlP的本地工作目录。
    -  ctrlp_root_markers..........额外的,高优先级的根目录标识。
    -  ctrlp_use_caching...........针对每个会话,设置是否开启缓存的。
    -  ctrlp_clear_cache_on_exit...退出Vim后是否保留缓存。
    -  ctrlp_cache_dir.............缓存目录的位置。
    -  ctrlp_show_hidden...........是否显示隐藏文件和隐藏文件夹。
    -  ctrlp_custom_ignore.........使用 globpath() 时自定义忽略的文件或目录。
    -  ctrlp_max_files.............扫描文件的最大数目。
    -  ctrlp_max_depth.............扫描目录的最大层数。
    -  ctrlp_user_command..........使用外部的扫描工具。
    -  ctrlp_max_history...........历史提示符面板中保留的最大条目数。
    -  ctrlp_open_new_file.........由<c-y>创建的文件的打开方式。
    -  ctrlp_open_multiple_files...由<c-z>选择的文件的打开方式。
    -  ctrlp_arg_map...............是否拦截<c-y><c-o> 命令。
    -  ctrlp_follow_symlinks.......是否跟随链接。
    -  ctrlp_lazy_update...........停止输入时才更新。
    -  ctrlp_default_input.........为提示符面板提供一个种子。
    -  ctrlp_abbrev................输入缩写。
    -  ctrlp_key_loop..............为多字节输入开启输入事件循环。
    -  ctrlp_use_migemo............为日语文件名启用Migemo模式。
    -  ctrlp_prompt_mappings.......改变提示符面板内部的按键绑定。
    -
    -  最近最常使用模式:
    -  ctrlp_mruf_max..............记录的最近最常最多使用的最大数据。
    -  ctrlp_mruf_exclude..........需要被排除的文件。
    -  ctrlp_mruf_include..........需要被记录的文件。
    -  ctrlp_mruf_relative.........只显示在工作目录内的最近最多使用。
    -  ctrlp_mruf_default_order....禁用排序。
    -  ctrlp_mruf_case_sensitive...最近最多使用文件是否大小写敏感。
    -  ctrlp_mruf_save_on_update...只要有一个新的条目添加,就保存到磁盘。
    -
    -  缓冲区标签模式: (开启此模式,参考 ctrlp-extensions )
    -  g:ctrlp_buftag_ctags_bin....兼容的ctags二进制程序的位置。
    -  g:ctrlp_buftag_systemenc....ctags命令的编码。
    -  g:ctrlp_buftag_types........添加新的文件类型和设置命令行参数。
    -
    -  高级选项:
    -  ctrlp_open_func.............使用自定义的打开文件的函数。
    -  ctrlp_status_func...........改变CtrlP的两个状态栏
    -  ctrlp_buffer_func...........在CtrlP的缓冲区内调用自定义的函数。
    -  ctrlp_match_func............替换内建的匹配算法。
    -
    --------------------------------------------------------------------------------
    -详细描述和默认值:
    -
    -                                                                'g:ctrlp_map'
    -使用该选项来改变普通模式 Normal 下调用CtrlP的按键绑定:
    -  let g:ctrlp_map = '<c-p>'
    -
    -
    -                                                                'g:ctrlp_cmd'
    -
    -设置当按下上面的按键绑定时,使用的默认打开命令:
    -  let g:ctrlp_cmd = 'CtrlP'
    -
    -
    -                                                             'g:loaded_ctrlp'
    -使用该选项完全禁用插件:
    -  let g:loaded_ctrlp = 1
    -
    -
    -                                                        'g:ctrlp_by_filename'
    -修改该选项为1,设置默认为按文件名搜索(否则为全路径):
    -  let g:ctrlp_by_filename = 0
    -
    -在提示符面板内可以使用 <c-d> 来切换。
    -
    -                                                             'g:ctrlp_regexp'
    -修改该选项为1,设置默认为使用正则表达式匹配。:
    -  let g:ctrlp_regexp = 0
    -
    -在提示符面板内可以使用 <c-r> 来切换。
    -
    -                                                       'g:ctrlp_match_window'
    -改变匹配窗口的位置,结果的排列顺序,最小和最大高度:
    -  let g:ctrlp_match_window = ''
    -
    -例子:
    -  let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10'
    -
    -位置: (默认:底部)
    -  top - 在屏幕顶部显示匹配窗口。
    -  bottom - 在屏幕底部显示匹配窗口。
    -
    -结果的排列顺序: (默认: btt)
    -  order:ttb - 从顶部到底部。
    -  order:btt - 从底部到顶部。
    -
    -最小和最大高度:
    -  min:{n} - 最少显示 {n} 行 (默认: 1).
    -  max:{n} - 最多显示 {n} 行 (默认: 10).
    -
    -结果集的最大数目:
    -  results:{n} - 列出最多 {n} 条结果 (默认: 和最大高度同步).
    -
    -注意: 当一个设置项没有被设置时,将会使用默认值。
    -
    -                                                      'g:ctrlp_switch_buffer'
    -当尝试打开一个文件时,如果它已经在某个窗口被打开,CtrlP会尝试跳到那个窗口,而
    -不是新打开一个实例。:
    -  let g:ctrlp_switch_buffer = 'Et'
    -
    -  e - 当 <cr> 被按下时跳转,但是只跳转到当前页签内的窗口内。
    -  t - 当 <c-t> 被按下时跳转, 但是只跳转到其它标签的窗口内。
    -  v - 类似 "e", 但是当 <c-v> 被按下时跳转。
    -  h - 类似 "e", 但是当 <c-x> 被按下时跳转。
    -  E, T, V, H - 行为类似 "e", "t", "v", and "h", 但是跳转到任何地方的窗口中。
    -  0 或者 <empty> - 禁用这项功能。
    -
    -                                                       'g:ctrlp_reuse_window'
    -当使用 <cr> 打开新文件时,CtrlP避免在插件,帮助,快速修复创建的窗口中打开该文
    -件。使用该选项来设置一些例外:
    -  let g:ctrlp_reuse_window = 'netrw'
    -
    -接受的值可以为特殊缓冲区的名字的一部分,文件类型或者缓冲区类型使用正则表达式来
    -指定匹配模式。
    -例子:
    -  let g:ctrlp_reuse_window = 'netrw\|help\|quickfix'
    -
    -
    -                                                   'g:ctrlp_tabpage_position'
    -新打开页签的位置:
    -  let g:ctrlp_tabpage_position = 'ac'
    -
    -  a - 后面。
    -  b - 前面。
    -  c - 当前页签。
    -  l - 最后一个页签。
    -  f - 第一个页签。
    -
    -                                                  'g:ctrlp_working_path_mode'
    -当启动时,CtrlP依据这个变量来设置它的工作目录:
    -  let g:ctrlp_working_path_mode = 'ra'
    -
    -  c - 当前文件所在的目录。
    -  a - 类似 "c", 但是只有在CtrlP之外的当前工作目录不是当前文件所在目录的直接祖
    -      先时才生效。(译注:请参考https://github.com/kien/ctrlp.vim/issues/397)
    -  r - 包含下列文件或者目录的最近的祖先:
    -      .git .hg .svn .bzr _darcs
    -  w - 开始从CtrlP的工作目录之外的目录,而不是当前文件所在的目录(默认)查找根
    -      目录。只有在"r"选项存在的时候才生效。
    -  0 或者 <empty> - 禁用这项功能。
    -
    -注意 #1: 如果 "a" 或者 "c" 和 "r"一起被包含,当无法找到根目录时使用 "a" 或者
    -"c" 的行为(作为备选)。
    -
    -注意 #2: 你可以在每个缓冲区内使用 b:var 来设置该选项。
    -
    -                                                       'g:ctrlp_root_markers'
    -使用该选项来设置自定义的根目录标记作为对默认标记(.hg, .svn, .bzr, and _darcs)
    -的补充。自定义的标记具有优先权:
    -  let g:ctrlp_root_markers = ['']
    -
    -注意: 你可以在每个缓冲区内使用 b:var 来设置该选项。
    -
    -                                                        'g:ctrlp_use_caching'
    -启用/禁用每个会话的缓存:
    -  let g:ctrlp_use_caching = 1
    -
    -  0 - 禁用缓存。
    -  1 - 启用缓存。
    -  n - 当大于1时,禁用缓存,使用该数值作为重新启用缓存的限制条件。
    -
    -注意: 当在CtrlP中时你可以使用 <F5> 来快速的清除缓存。
    -
    -                                                'g:ctrlp_clear_cache_on_exit'
    -设置该选项为0通过退出Vim时不删除缓存文件来启用跨回话的缓存:
    -  let g:ctrlp_clear_cache_on_exit = 1
    -
    -
    -                                                          'g:ctrlp_cache_dir'
    -设置存储缓存文件的目录:
    -  let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
    -
    -
    -                                                        'g:ctrlp_show_hidden'
    -如果你想CtrlP扫描隐藏文件和目录,设置该选项为1:
    -  let g:ctrlp_show_hidden = 0
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                           'ctrlp-wildignore'
    -你可以使用Vim的 'wildignore' 来从结果集中排序文件或目录。
    -例子:
    -  " 排除版本控制文件
    -  set wildignore+=*/.git/*,*/.hg/*,*/.svn/*        " Linux/MacOSX
    -  set wildignore+=*\\.git\\*,*\\.hg\\*,*\\.svn\\*  " Windows ('noshellslash')
    -
    -注意 #1: 每个目录设置前的字符 */ 是必须的。
    -
    -注意 #2: wildignore 影响 expand()globpath()glob() 的结果,这些函数被很
    -多插件用来在系统中执行查找。(例如和版本控制系统有关的插件在查找.git/、.hg/等,
    -一些其他插件用来在Windows上查找外部的*.exe工具),所以要修改 wildignore 时请先
    -考虑清楚。
    -
    -                                                      'g:ctrlp_custom_ignore'
    -作为对 'wildignore' 的补充,用来设置你只是想在CtrlP中隐藏的文件和目录。使用正
    -则表达式来指定匹配模式:
    -  let g:ctrlp_custom_ignore = ''
    -
    -例子:
    -  let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
    -  let g:ctrlp_custom_ignore = {
    -    \ 'dir':  '\v[\/]\.(git|hg|svn)$',
    -    \ 'file': '\v\.(exe|so|dll)$',
    -    \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
    -    \ }
    -  let g:ctrlp_custom_ignore = {
    -    \ 'file': '\v(\.cpp|\.h|\.hh|\.cxx)@<!$'
    -    \ }
    -
    -注意 #1: 默认情况下, wildignoreg:ctrlp_custom_ignore 只在 globpath() 被用
    -来扫描文件的情况下使用,这样这些选项在那些使用 g:ctrlp_user_command 定义的命
    -令中不会生效。
    -
    -注意 #2: 当改变选项的变量类型时,记得先 :unlet ,或者重启Vim来避免这个错误:
    -"E706: Variable type mismatch" 。
    -
    -                                                          'g:ctrlp_max_files'
    -扫描文件的最大数量,设置为0时不进行限制:
    -  let g:ctrlp_max_files = 10000
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                          'g:ctrlp_max_depth'
    -目录树递归的最大层数:
    -  let g:ctrlp_max_depth = 40
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                       'g:ctrlp_user_command'
    -指定用来代替Vim的 globpath() 的外部工具来列出文件,使用 %s 代表目标目录:
    -  let g:ctrlp_user_command = ''
    -
    -例子:
    -  let g:ctrlp_user_command = 'find %s -type f'       " MacOSX/Linux
    -  let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
    -
    -你也可以使用 'grep', 'findstr' 或者其它东西来过滤结果集。
    -例子:
    -  let g:ctrlp_user_command =
    -    \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"'          " MacOSX/Linux
    -  let g:ctrlp_user_command =
    -    \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows
    -
    -在扫描一个大型项目时,在仓库目录中使用版本控制系统的列出命令会加快扫描速度:
    -  let g:ctrlp_user_command = [root_marker, listing_command, fallback_command]
    -  let g:ctrlp_user_command = {
    -    \ 'types': {
    -      \ 1: [root_marker_1, listing_command_1],
    -      \ n: [root_marker_n, listing_command_n],
    -      \ },
    -    \ 'fallback': fallback_command,
    -    \ 'ignore': 0 or 1
    -    \ }
    -
    -一些例子:
    -  " 单个版本控制系统,列出命令不会列出没有被追踪的文件:
    -  let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
    -  let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .']
    -
    -  " 多个版本控制系统:
    -  let g:ctrlp_user_command = {
    -    \ 'types': {
    -      \ 1: ['.git', 'cd %s && git ls-files'],
    -      \ 2: ['.hg', 'hg --cwd %s locate -I .'],
    -      \ },
    -    \ 'fallback': 'find %s -type f'
    -    \ }
    -
    -  " 单个版本控制系统,列出命令列出没有被追踪的文件(较慢):
    -  let g:ctrlp_user_command =
    -    \ ['.git', 'cd %s && git ls-files . -co --exclude-standard']
    -
    -  let g:ctrlp_user_command =
    -    \ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux
    -
    -  let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') '
    -    \ . 'do hg --cwd %s status -numac -I . %%a']           " Windows
    -
    -注意 #1: 在 Dictionary 格式, 'fallback''ignore' 是可选的,在 List 格式,
    -备选命令是可选的。
    -
    -注意 #2: 如果备选命令是空的或者属性 'fallback' 没有定义,当扫描仓库之外目录时,
    -globpath() 会被使用。
    -
    -注意 #3: 除非使用了 Dictionary 格式并且 'ignore' 被定义并且设置为1,当这些自
    -定义的命令被使用时 wildignoreg:ctrlp_custom_ignore 选项不会生效。没有出现
    -时,'ignore' 被默认设置为0来保留使用外部命令的性能优势。
    -
    -注意 #4: 当改变了选项的变量类型时,记得先 :unlet ,或者重启Vim来避免这个错误:
    -"E706: Variable type mismatch" 。
    -
    -注意 #5: 你可以在每个缓冲区内使用 b:var 来设置该选项。
    -
    -                                                        'g:ctrlp_max_history'
    -你希望CtrlP记录的用户输入历史的最大数目。默认值是Vim的全局选项 'history' :
    -  let g:ctrlp_max_history = &history
    -
    -设置为0来禁用提示符面板的历史。使用 <c-n><c-p> 来浏览历史。
    -
    -                                                      'g:ctrlp_open_new_file'
    -使用该选项指定当使用 <c-y> 打开新建的文件时,文件的打开方式:
    -  let g:ctrlp_open_new_file = 'v'
    -
    -  t - 在新页签中。
    -  h - 在新的水平分割窗口。
    -  v - 在新的竖直分割窗口。
    -  r - 在当前窗口。
    -
    -                                                'g:ctrlp_open_multiple_files'
    -如果非0, 会启用使用 <c-z><c-o> 打开多个文件:
    -  let g:ctrlp_open_multiple_files = 'v'
    -
    -例子:
    -  let g:ctrlp_open_multiple_files = '2vjr'
    -
    -对于数字:
    -  - 如果指定,会被用来作为打开文件时创建的窗口或者页签的最大数量(剩余的会在隐
    -    藏的缓冲区中打开)。
    -  - 如果没有指定,<c-o> 会打开所有文件,每个在一个新的窗口或者页签中。
    -
    -对于字母:
    -  t - 每个文件在一个新页签中。
    -  h - 每个文件在一个新的水平分割窗口中。
    -  v - 每个文件在一个新的竖直分割窗口中。
    -  i - 所有的文件在隐藏的缓冲区中。
    -  j - 打开以后,跳转到第一个打开的页签或者窗口。
    -  r - 在当前窗口打开第一个文件,其他文件根据同时出现的"h","v"和"t"中的一个,
    -      在新的分割窗口或者页签中打开。
    -
    -                                                            'g:ctrlp_arg_map'
    -当设置为1时, <c-o><c-y> 会接收一个额外的键值作为参数,来覆盖默认行为:
    -  let g:ctrlp_arg_map = 0
    -
    -按下 <c-o> 或者 <c-y> 会提示一次按键。按键可以是:
    -  t - 在新标签页中打开。
    -  h - 每个文件在一个新的水平分割窗口中。
    -  v - 每个文件在一个新的竖直分割窗口中。
    -  i - 所有的文件在隐藏的缓冲区中(只有 <c-o> 生效)。
    -  c - 清楚标记的文件(只有 <c-o> 生效)。
    -  r - 在当前窗口中打开(只有 <c-y> 生效)。
    -  <esc>, <c-c>, <c-u> - 取消并且回到提示符面板。
    -  <cr> - 使用 g:ctrlp_open_new_fileg:ctrlp_open_multiple_files 指定的默
    -         认行为。
    -
    -
    -                                                    'g:ctrlp_follow_symlinks'
    -如果非0,当列出文件时CtrlP会跟随链接:
    -  let g:ctrlp_follow_symlinks = 0
    -
    -  0 - 不要跟随链接。
    -  1 - 跟随但是忽略内部循环的链接,避免重复。
    -  2 - 无差别的跟随所有链接。
    -
    -注意: 当命令使用 g:ctrlp_user_command 定义时该选项无效。
    -
    -                                                        'g:ctrlp_lazy_update'
    -设置为1将开启延迟更新特性:只在输入停止一个确定的时间后才更新匹配窗口:
    -  let g:ctrlp_lazy_update = 0
    -
    -如果设置为1,在250毫秒后更新。如果大于1,数字会被作为延迟时间使用。
    -
    -                                                      'g:ctrlp_default_input'
    -设置为1将为提示符面板提供当前文件的相对路径作为种子:
    -  let g:ctrlp_default_input = 0
    -
    -如果不指定1或0,如果选项的值是字符串,会被用来作为默认输入:
    -  let g:ctrlp_default_input = 'anystring'
    -
    -
    -                                                             'g:ctrlp_abbrev'
    -定义可以在提示面包内被扩展(内部的或者可见的)的输入缩写:
    -  let g:ctrlp_abbrev = {}
    -
    -例子:
    -  let g:ctrlp_abbrev = {
    -    \ 'gmode': 'i',
    -    \ 'abbrevs': [
    -      \ {
    -        \ 'pattern': '^cd b',
    -        \ 'expanded': '@cd ~/.vim/bundle',
    -        \ 'mode': 'pfrz',
    -      \ },
    -      \ {
    -        \ 'pattern': '\(^@.\+\|\\\@<!:.\+\)\@<! ',
    -        \ 'expanded': '.\{-}',
    -        \ 'mode': 'pfr',
    -      \ },
    -      \ {
    -        \ 'pattern': '\\\@<!:.\+\zs\\\@<! ',
    -        \ 'expanded': '\ ',
    -        \ 'mode': 'pfz',
    -      \ },
    -      \ ]
    -    \ }
    -
    -字符串 'pattern' 是使用正则表达式来匹配输入的匹配模式。扩展后就像扩展后的字符串
    -在提示符面板中被输入了一样。
    -
    -对于 'gmode' (可选的):
    -  i - 内部扩展(默认)。
    -  t - 插入扩展结果到提示符面板,就像你自己输入的一样。
    -  k - 当非关键字的字符被输入时,插入扩展结果到提示符面板。只在"t"也出现时生效。
    -
    -对于 'mode' (对于每个条目,可选的):
    -  f - 只应用于文件名模式。
    -  p - 只应用于全路径模式。
    -  r - 只应用于正则表达式模式。
    -  z - 只应用于模糊模式。
    -  n - 只应用于使用 <c-y> 创建新文件时(使用扩展后的字符串作为文件名)。
    -  c - 当使用 <tab> 自动补全目录名时(在自动补全之前立即扩展模式)。
    -  <empty> 或者未定义 - 总是启用。
    -
    -注意: 缩写条目按顺序求值,后求值的条目会覆盖先求值的条目;当 'gmode' 为"t"时,
    -包括他自己。
    -
    -                                                           'g:ctrlp_key_loop'
    -一个实验性的特性。设置该选项为1将为多字节字符开启输入事件循环:
    -  let g:ctrlp_key_loop = 0
    -
    -注意 #1: 当设置时,该选项会重置 g:ctrlp_lazy_update 选项。
    -
    -注意 #2: 你可以在提示符面板使用自定义的按键绑定切换这个特性:
    -  let g:ctrlp_prompt_mappings = { 'ToggleKeyLoop()': ['<F3>'] }
    -
    -
    -                                                         'g:ctrlp_use_migemo'
    -设置该选项为1将为日文文件名使用Migemo模式。Migemo搜索只在正则模式下有效。 使
    -用空格分割单词来分离模式:
    -  let g:ctrlp_use_migemo = 0
    -
    -
    -                                                    'g:ctrlp_prompt_mappings'
    -使用该选项来自定义CtrlP的提示窗口内的按键绑定为你喜欢的方式。你只需要保留你改
    -变值(在[]内部)的行:
    -  let g:ctrlp_prompt_mappings = {
    -    \ 'PrtBS()':              ['<bs>', '<c-]>'],
    -    \ 'PrtDelete()':          ['<del>'],
    -    \ 'PrtDeleteWord()':      ['<c-w>'],
    -    \ 'PrtClear()':           ['<c-u>'],
    -    \ 'PrtSelectMove("j")':   ['<c-j>', '<down>'],
    -    \ 'PrtSelectMove("k")':   ['<c-k>', '<up>'],
    -    \ 'PrtSelectMove("t")':   ['<Home>', '<kHome>'],
    -    \ 'PrtSelectMove("b")':   ['<End>', '<kEnd>'],
    -    \ 'PrtSelectMove("u")':   ['<PageUp>', '<kPageUp>'],
    -    \ 'PrtSelectMove("d")':   ['<PageDown>', '<kPageDown>'],
    -    \ 'PrtHistory(-1)':       ['<c-n>'],
    -    \ 'PrtHistory(1)':        ['<c-p>'],
    -    \ 'AcceptSelection("e")': ['<cr>', '<2-LeftMouse>'],
    -    \ 'AcceptSelection("h")': ['<c-x>', '<c-cr>', '<c-s>'],
    -    \ 'AcceptSelection("t")': ['<c-t>'],
    -    \ 'AcceptSelection("v")': ['<c-v>', '<RightMouse>'],
    -    \ 'ToggleFocus()':        ['<s-tab>'],
    -    \ 'ToggleRegex()':        ['<c-r>'],
    -    \ 'ToggleByFname()':      ['<c-d>'],
    -    \ 'ToggleType(1)':        ['<c-f>', '<c-up>'],
    -    \ 'ToggleType(-1)':       ['<c-b>', '<c-down>'],
    -    \ 'PrtExpandDir()':       ['<tab>'],
    -    \ 'PrtInsert("c")':       ['<MiddleMouse>', '<insert>'],
    -    \ 'PrtInsert()':          ['<c-\>'],
    -    \ 'PrtCurStart()':        ['<c-a>'],
    -    \ 'PrtCurEnd()':          ['<c-e>'],
    -    \ 'PrtCurLeft()':         ['<c-h>', '<left>', '<c-^>'],
    -    \ 'PrtCurRight()':        ['<c-l>', '<right>'],
    -    \ 'PrtClearCache()':      ['<F5>'],
    -    \ 'PrtDeleteEnt()':       ['<F7>'],
    -    \ 'CreateNewFile()':      ['<c-y>'],
    -    \ 'MarkToOpen()':         ['<c-z>'],
    -    \ 'OpenMulti()':          ['<c-o>'],
    -    \ 'PrtExit()':            ['<esc>', '<c-c>', '<c-g>'],
    -    \ }
    -
    -注意: 如果按 <bs> 后光标向左移动一个字符而不是删除一个字符,在你的.vimrc中添加
    -下面的设置来禁用插件默认的 <c-h> 绑定:
    -  let g:ctrlp_prompt_mappings = { 'PrtCurLeft()': ['<left>', '<c-^>'] }
    -
    -
    -----------------------------------------
    -MRU mode options:
    -
    -                                                           'g:ctrlp_mruf_max'
    -指定你希望CtrlP记录的最近打开的文件历史的数目:
    -  let g:ctrlp_mruf_max = 250
    -
    -
    -                                                       'g:ctrlp_mruf_exclude'
    -你不希望CtrlP记录的文件。使用正则表达式来指定模式:
    -  let g:ctrlp_mruf_exclude = ''
    -
    -例子:
    -  let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux
    -  let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows
    -
    -
    -                                                       'g:ctrlp_mruf_include'
    -如果你想让CtrlP只记录某些文件,在这里指定:
    -  let g:ctrlp_mruf_include = ''
    -
    -例子:
    -  let g:ctrlp_mruf_include = '\.py$\|\.rb$'
    -
    -
    -                                                      'g:ctrlp_mruf_relative'
    -设置该选项为1将只显示在当前工作目录内的最近最多使用文件:
    -  let g:ctrlp_mruf_relative = 0
    -
    -注意: 你可以在提示符面板使用自定义的按键绑定切换这个特性:
    -  let g:ctrlp_prompt_mappings = { 'ToggleMRURelative()': ['<F2>'] }
    -
    -
    -                                                 'g:ctrlp_mruf_default_order'
    -设置该选项为1将在最近最多使用模式搜索时禁用排序:
    -  let g:ctrlp_mruf_default_order = 0
    -
    -
    -                                                'g:ctrlp_mruf_case_sensitive'
    -将该选项和你的文件系统大小写敏感性保持一致来避免重复的最近最多使用条目:
    -  let g:ctrlp_mruf_case_sensitive = 1
    -
    -
    -                                                'g:ctrlp_mruf_save_on_update'
    -设置该选项为0将不会每当有一个新条目增加就把最近最多使用列表保存到磁盘文件,而
    -是在退出Vim时才保存:
    -  let g:ctrlp_mruf_save_on_update = 1
    -
    -
    -----------------------------------------
    -高级选项:
    -
    -                                                          'g:ctrlp_open_func'
    -使用一个自定义函数来打开选定的文件:
    -  let g:ctrlp_open_func = {}
    -
    -例子:
    -  let g:ctrlp_open_func = {
    -    \ 'files'     : 'Function_Name_1',
    -    \ 'buffers'   : 'Function_Name_2',
    -    \ 'mru files' : 'Function_Name_3',
    -    \ }
    -
    -函数结构:
    -  function! Function_Name(action, line)
    -    " 参数:
    -    " |
    -    " +- a:action : 打开的动作:
    -    " |             + 'e' : 用户按下 <cr>  (默认)
    -    " |             + 'h' : 用户按下 <c-x> (默认)
    -    " |             + 'v' : 用户按下 <c-v> (默认)
    -    " |             + 't' : 用户按下 <c-t> (默认)
    -    " |             + 'x' : 用户使用 <c-o> 终端对话框 (默认) 选择"e[x]ternal"。
    -    " |
    -    " +- a:line   : 选择的文件。
    -
    -  endfunction
    -
    -注意: 当使用<c-z><c-o>打开多个文件时无效。
    -
    -例子: 当 <c-t> 被按下时在默认浏览器中打开HTML文件,否则在Vim中打开
    -  function! HTMLOpenFunc(action, line)
    -    if a:action =~ '^[tx]$' && fnamemodify(a:line, ':e') =~? '^html\?$'
    -
    -      " 获取文件名
    -      let filename = fnameescape(fnamemodify(a:line, ':p'))
    -
    -      " 关闭CtrlP
    -      call ctrlp#exit()
    -
    -      " 打开文件
    -      silent! execute '!xdg-open' filename
    -
    -    elseif a:action == 'x' && fnamemodify(a:line, ':e') !~? '^html\?$'
    -
    -      " 不是HTML文件,再次模拟 <c-o> 按键并且等待新的输入
    -      call feedkeys("\<c-o>")
    -
    -    else
    -
    -      " 使用CtrlP的默认的打开文件的函数
    -      call call('ctrlp#acceptfile', [a:action, a:line])
    -
    -    endif
    -  endfunction
    -
    -  let g:ctrlp_open_func = { 'files': 'HTMLOpenFunc' }
    -
    -
    -                                                        'g:ctrlp_status_func'
    -为CtrlP窗口使用自定义的状态栏:
    -  let g:ctrlp_status_func = {}
    -
    -例子:
    -  let g:ctrlp_status_func = {
    -    \ 'main': 'Function_Name_1',
    -    \ 'prog': 'Function_Name_2',
    -    \ }
    -
    -函数结构:
    -  " 主状态栏
    -  function! Function_Name_1(focus, byfname, regex, prev, item, next, marked)
    -    " 参数:
    -    " |
    -    " +- a:focus   : 提示符面板的焦点: "prt" 或者 "win"。
    -    " |
    -    " +- a:byfname : 在文件名模式还是全路径模式: "file" 或者 "path"。
    -    " |
    -    " +- a:regex   : 是否在正则表达式模式: 1 or 0。
    -    " |
    -    " +- a:prev    : 前一个搜索模式。
    -    " |
    -    " +- a:item    : 当前的搜索模式。
    -    " |
    -    " +- a:next    : 下一个搜索模式。
    -    " |
    -    " +- a:marked  : 被标记文件的数目,或者一个逗号分隔的被标记的文件名列表。
    -
    -    return full_statusline
    -  endfunction
    -
    -  " 状态栏进度条
    -  function! Function_Name_2(str)
    -    " a:str : 一个当前已扫描的文件数,或者一个当前扫描目录和用户命令的字符串。
    -
    -    return full_statusline
    -  endfunction
    -
    -一个可用的例子,参见 https://gist.github.com/1610859 。
    -
    -                                                        'g:ctrlp_buffer_func'
    -指定一个会在启动或者退出CtrlP缓冲区时被调用的函数:
    -  let g:ctrlp_buffer_func = {}
    -
    -例子:
    -  let g:ctrlp_buffer_func = {
    -    \ 'enter': 'Function_Name_1',
    -    \ 'exit':  'Function_Name_2',
    -    \ }
    -
    -
    -                                                         'g:ctrlp_match_func'
    -为CtrlP设置一个额外的模糊匹配函数:
    -  let g:ctrlp_match_func = {}
    -
    -例子:
    -  let g:ctrlp_match_func = { 'match': 'Function_Name' }
    -
    -函数结构:
    -  function! Function_Name(items, str, limit, mmode, ispath, crfile, regex)
    -    " 参数:
    -    " |
    -    " +- a:items  : 搜索条目的全列表。
    -    " |
    -    " +- a:str    : 用户输入的字符串。
    -    " |
    -    " +- a:limit  : 匹配窗口的最大高度。可以用来限制返回的条目数量。
    -    " |
    -    " +- a:mmode  : 在匹配模式。可以是下列字符串之一:
    -    " |             + "full-line": 匹配整行。
    -    " |             + "filename-only": 只匹配文件名。
    -    " |             + "first-non-tab": 匹配到第一个制表符。
    -    " |             + "until-last-tab": 匹配到最后一个制表符。
    -    " |
    -    " +- a:ispath : 搜索文件,缓冲区,最近最多使用,混合,目录和rtscript模.
    -    " |             式时为1。其它为0。
    -    " |
    -    " +- a:crfile : 当前窗口中的文件。当a:ispath为1时应该被搜索结果排除在外
    -    " |
    -    " +- a:regex  : 是否在正则表达式模式: 1 or 0.
    -
    -    return list_of_matched_items
    -  endfunction
    -
    -
    -注意: 你可以通过 { 'arg_type': 'dict' } 扩展上面的任何选项,这样就可以通过
    -一个字典类型的参数来传递所有的函数参数。使用参数名作为字典的键值。
    -
    -例子:
    -  let g:ctrlp_status_func = {
    -    \ 'arg_type' : 'dict',
    -    \ 'enter': 'Function_Name_1',
    -    \ 'exit':  'Function_Name_2',
    -    \ }
    -
    -  function! Function_Name_1(dict)
    -    " where dict == {
    -    " \ 'focus':   value,
    -    " \ 'byfname': value,
    -    " \ 'regex':   value,
    -    " \ ...
    -    " }
    -  endfunction
    -
    -
    -===============================================================================
    -命令                                                           ctrlp-commands
    -
    -                                                                       :CtrlP
    -:CtrlP [起始目录]
    -   用文件搜索模式打开CtrlP。
    -
    -   如果没有给定参数,g:ctrlp_working_path_mode 会被用来决定起始目录。
    -
    -   在输入时你可以使用 <tab> 自动补全[起始目录]。
    -
    -                                                                 :CtrlPBuffer
    -:CtrlPBuffer
    -   用缓冲区搜索模式打开CtrlP。
    -
    -                                                                    :CtrlPMRU
    -:CtrlPMRU
    -   用最近最多使用模式打开CtrlP。
    -
    -                                                               :CtrlPLastMode
    -:CtrlPLastMode [--dir]
    -   用上一次使用的模式打开CtrlP。当提供了"--dir"参数,也重用上一次的工作目录。
    -
    -                                                                   :CtrlPRoot
    -:CtrlPRoot
    -    行为类似使用了 g:ctrlp_working_path_mode = 'r' 并且忽略了该变量的当前值的
    -    :CtrlP 命令。
    -
    -                                                             :CtrlPClearCache
    -:CtrlPClearCache
    -   清除当前工作目录的缓存。和在CtrlP内按 <F5> 效果一样。
    -   使用 g:ctrlp_use_caching 来启用或禁用缓存。
    -
    -                                                         :CtrlPClearAllCaches
    -:CtrlPClearAllCaches
    -   删除在 g:ctrlp_cache_dir 中定义的缓存目录中的所有缓存文件。
    -
    --------------------------------------------------------------------------------
    -由扩展提供的命令参见 ctrlp-extensions 。
    -
    -===============================================================================
    -按键绑定                                                        ctrlp-mappings
    -
    -                                                                'ctrlp-<c-p>'
    -<c-p>
    -   普通模式 Normal 下默认以文件搜索模式打开CtrlP提示符面板。
    -
    -----------------------------------------
    -已经在提示符面板中:
    -
    -  <c-d>
    -    在全路径搜索和文件名搜索间切换。
    -    注意: 在文件名搜索模式,提示符面板的提示符是'>d>',而不是'>>>'
    -
    -  <c-r>                                                    'ctrlp-fullregexp'
    -    在字符串搜索模式和正则表达式模式之间切换。
    -    注意: 在全正则表达式模式,提示符面板的提示符是'r>>',而不是'>>>'
    -
    -    详细参见: input-formats (指引)和 g:ctrlp_regexp_search 选项。
    -
    -  <c-f>, 'forward' 前进
    -  <c-up>
    -    切换到序列里面的 'next' 后一个搜索模式。
    -
    -  <c-b>, 'backward' 后退
    -  <c-down>
    -    切换到序列里面的 'previous' 前一个搜索模式。
    -
    -  <tab>                                                'ctrlp-autocompletion'
    -    自动补全在提示符面板的当前工作路径中的目录名。
    -
    -  <s-tab>
    -    在匹配窗口和提示符面板之间切换焦点。
    -
    -  <esc>,
    -  <c-c>
    -    退出CtrlP。
    -
    -移动:
    -
    -  <c-j>,
    -  <down>
    -    向下移动。
    -
    -  <c-k>,
    -  <up>
    -    向上移动。
    -
    -  <c-a>
    -    移动光标到提示符面板的 'start' 开头。
    -
    -  <c-e>
    -    移动光标到提示符面板的 'end' 末尾。
    -
    -  <c-h>,
    -  <left>,
    -  <c-^>
    -    向左 'left' 移动一个字符。
    -
    -  <c-l>,
    -  <right>
    -    向右 'right' 移动一个字符。
    -
    -编辑:
    -
    -  <c-]>,
    -  <bs>
    -    删除前一个字符。
    -
    -  <del>
    -    删除当前字符。
    -
    -  <c-w>
    -    删除前一个单词。
    -
    -  <c-u>
    -    清除输入。
    -
    -浏览输入历史:
    -
    -  <c-n>
    -    提示符面板历史里的下一个字符串。
    -
    -  <c-p>
    -    提示符面板历史里的上一个字符串。
    -
    -打开/创建文件:
    -
    -  <cr>
    -    如果可能的话在 'current' 当前窗口打开选择的文件。
    -
    -  <c-t>
    -    在 'tab' 新标签打开选择的文件。
    -    Open the selected file in a new 'tab'.
    -
    -  <c-v>
    -    在 'vertical' 竖直分割窗口打开选择的文件。
    -
    -  <c-x>,
    -  <c-cr>,
    -  <c-s>
    -    在 'horizontal' 水平分割窗口打开选择的文件。
    -
    -  <c-y>
    -    创建一个新文件和它的父目录。
    -
    -打开多个文件:
    -
    -  <c-z>
    -    - 标记/取消标记一个被 <c-o> 打开的文件。
    -    - 标记/取消标记一个被 <c-y> 在它的目录被创建的文件。
    -
    -  <c-o>
    -    - 打开被 <c-z> 标记的文件。
    -    - 当没有文件被 <c-z> 标记时,使用下列选项打开一个终端对话框:
    -
    -      打开被选择的文件:
    -        t - 在新标签页中打开。
    -        v - 在一个竖直分割窗口中。
    -        h - 在一个水平分割窗口中。
    -        r - 在当前窗口中打开。
    -        i - 在隐藏的缓冲区中。
    -        x - (可选的)使用 g:ctrlp_open_func 中定义的函数。
    -
    -      其它选项 (未显示):
    -        a - 标记匹配窗口中的所有文件。
    -        d - 改变CtrlP的工作目录到被选择的文件的目录并切换到文件搜索模式。
    -
    -功能按键绑定:
    -
    -  <F5>
    -    - 刷新匹配窗口并且清除当前目录的缓存。
    -    - 从最近最多使用中移除被删除的文件。
    -
    -  <F7>
    -    - 清除最近最多使用列表。
    -    - 删除被 <c-z> 标记的最近最多使用条目。
    -
    -粘贴:
    -
    -  <Insert>,                                                   'ctrlp-pasting'
    -  <MiddleMouse>
    -    将剪贴板中的文本粘贴到提示符窗口中。
    -
    -  <c-\>
    -    打开一个终端对话框来粘贴 <cword><cfile>,搜索寄存器的文本,上一次可视
    -    化模式的选择,剪贴板或者任何寄存器到提示符面板中。
    -
    -使用 g:ctrlp_prompt_mappings 选择你自己的绑定。
    -
    -----------------------------------------
    -当焦点在匹配窗口中时(使用 <s-tab> 来切换):
    -
    -  a-z
    -  0-9
    -  ~^-=;`',.+!@#$%&_(){}[]
    -    在匹配第一个字符的行中循环。
    -
    -===============================================================================
    -输入格式                                                  ctrlp-input-formats
    -
    -提示符面板的输入格式:
    -
    -a)  字符串。
    -
    -    例如: 'abc' 被内部理解为 'a[^a]\{-}b[^b]\{-}c'
    -
    -b)  在正则表达式模式,输入字符串被按照Vim的正则表达式模式 pattern 来对待,不
    -    进行任何修改。
    -
    -    例如: 'abc\d*efg' 会被解读为 'abc\d*efg'。
    -
    -    如何启用正则表达式模式参见 ctrlp-fullregexp (按键绑定)和
    -    g:ctrlp_regexp_search (选项)。
    -
    -c)  字符串末尾使用一个冒号':'跟随一个Vim命令来在打开那个文件后执行该命令。如果
    -    你需要使用':'的字面意思,使用反斜杠转义'\:'。但打开多个文件时,命令会在每
    -    个打开文件上执行。
    -
    -    例如: 使用':45'跳转到第45行。
    -
    -          使用':/any\:string'跳转到'any:string'第一次出现的地方。
    -
    -          使用':+setf\ myfiletype|50'来设置文件类型为 'myfiletype',然后跳转
    -          到第50行。
    -
    -          使用':diffthis'当打开多个文件时在前四个文件上调用 :diffthis 。
    -
    -    参见: Vim的 ++opt+cmd.
    -
    -d)  提交两个点号 '..' 来进入上级目录。如果想进入向上多级目录,每多一级使用一个
    -    额外的点号:
    -
    -         输入         解释为
    -         ..           ../
    -         ...          ../../
    -         ....         ../../../
    -
    -    注意: 如果父目录很大并且没有被缓存,可能会很慢。
    -
    -    你可以使用'@cd path/'来改变CtrlP的工作目录为path/。使用'@cd %:h'来改变为当
    -    前文件的目录。
    -
    -e)  相似的,提交'/'或者'\'来查找或者跳转到项目的根目录。
    -
    -    如果项目很大,使用版本控制系统的列出命令来寻找文件可能会加速初始化扫描。(
    -    更多细节参见 g:ctrlp_user_command )。
    -
    -    注意: d) 和 e) 只在文件,目录和混合模式生效。
    -
    -f)  输入一个不存在的文件名并且按下 <c-y> 来创建文件。如果使用 <c-z> 标记了一个
    -    文件,将会在被标记的文件的目录下创建这个新文件。
    -
    -    例如: 使用 'newdir/newfile.txt' 会创建一个名为'newdir'的目录和一个名为
    -          'newfile.txt'的文件。
    -
    -          如果一个条目'some/old/dirs/oldfile.txt'被 <c-z> 标记,然后 'newdir'
    -          和'newfile.txt'会在'some/old/dirs'下被创建。最终的路径会像下面这样
    -          'some/old/dirs/newdir/newfile.txt'.
    -
    -    注意: 在Windows下使用 '\' 代替 '/' (如果 'shellslash' 选项没有设置)。
    -
    -g)  在文件名模式(使用 <c-d> 切换)下,你可以使用被逗号分隔的一个主要的模式和
    -    一个改善的模式。两个模式在正则表达式模式下像(a)或(b)那样工作。
    -
    -h)  使用?打开帮助文件。
    -
    -===============================================================================
    -扩展                                                         ctrlp-extensions
    -
    -扩展是可选的。把它的名字添加到变量g:ctrlp_extensions中来开启扩展:
    -  let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript',
    -                          \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
    -
    -扩展的名字在变量中出现的顺序会是在使用命令 <c-f><c-b> 切换时扩展在状态栏中出
    -现的顺序。
    -
    -可用的扩展:
    -
    -                                                                    :CtrlPTag
    -  * 标记模式:
    -    - 名称: 'tag'
    -    - 命令: ":CtrlPTag"
    -    - 在一个生成的标记文件中搜索标签,跳转到标签定义。使用Vim的 'tags' 来指定
    -      标签文件的位置和名称。
    -      例如: set tags+=doc/tags
    -
    -                                                                 :CtrlPBufTag
    -                                                              :CtrlPBufTagAll
    -  * 缓冲区标签模式:
    -    - 名称: 'buffertag'
    -    - 命令: ":CtrlPBufTag [缓冲区]",
    -                ":CtrlPBufTagAll"。
    -    - 在当前缓冲区或者所有列出的缓冲区中搜索标签并且跳转到定义。需要
    -      exuberant_ctags 或者兼容的程序。
    -
    -                                                               :CtrlPQuickfix
    -  * 快速修复模式:
    -    - 名称: 'quickfix'
    -    - 命令: ":CtrlPQuickfix"
    -    - 在当前的快速修复错误列表中搜索条目并且跳转过去。
    -
    -                                                                    :CtrlPDir
    -  * 目录模式:
    -    - 名称: 'dir'
    -    - 命令: ":CtrlPDir [起始muu]"
    -    - 搜索目录并且将其作为工作目录。
    -    - 按键绑定:
    -      + <cr> 为CtrlP修改工作目录并且保持打开状态。
    -      + <c-t> 修改全局的工作目录(退出)。
    -      + <c-v> 为当前窗口修改工作目录(退出)。
    -      + <c-x> 修改全局工作目录为CtrlP的当前工作目录(退出)。
    -
    -                                                                    :CtrlPRTS
    -  * 运行时脚本模式:
    -    - 名称: 'rtscript'
    -    - 命令: ":CtrlPRTS"
    -    - 在运行时路径中寻找文件(vimscripts, docs, snippets...)。
    -
    -                                                                   :CtrlPUndo
    -  * 撤销模式:
    -    - 名称: 'undo'
    -    - 命令: ":CtrlPUndo"
    -    - 浏览撤销历史。
    -
    -                                                                   :CtrlPLine
    -  * 行模式:
    -    - 名称: 'line'
    -    - 命令: ":CtrlPLine [缓冲区]"
    -    - 在所有列出的缓冲区或者在指定的 [buffer] 缓冲区内搜索一行内容。
    -
    -                                                                 :CtrlPChange
    -                                                              :CtrlPChangeAll
    -  * 修改列表模式:
    -    - 名称: 'changes'
    -    - 命令: ":CtrlPChange [缓冲区]",
    -                ":CtrlPChangeAll".
    -    - 在当前缓冲区或者在所有列出的缓冲区内搜索最近的修改并跳转。
    -
    -                                                                  :CtrlPMixed
    -  * 混合模式:
    -    - 名称: 'mixed'
    -    - 命令: ":CtrlPMixed"
    -    - 同时在文件,缓冲区和最近最多修改中搜索。
    -
    -                                                            :CtrlPBookmarkDir
    -                                                         :CtrlPBookmarkDirAdd
    -  * 书签目录模式:
    -    - 名称: 'bookmarkdir'
    -    - 命令: ":CtrlPBookmarkDir",
    -                ":CtrlPBookmarkDirAdd [目录]".
    -    - 搜索一个被书签标记的目录并将其作为工作目录。
    -    - 按键绑定:
    -      + <cr> 为CtrlP修改工作目录并且保持打开状态,并且切换到文件搜索模式。
    -      + <c-x> 修改全局的工作目录(退出)。
    -      + <c-v> 为当前窗口修改工作目录(退出)。
    -      + <F7>
    -        - 清除书签列表。
    -        - 删除被 <c-z> 标记的书签条目。
    -
    -----------------------------------------
    -缓冲区标记模式选项:
    -
    -                                                   'g:ctrlp_buftag_ctags_bin'
    -如果ctags没有在环境变量中配置,使用该选项来指定它的位置:
    -  let g:ctrlp_buftag_ctags_bin = ''
    -
    -
    -                                                   'g:ctrlp_buftag_systemenc'
    -将该选项与你的操作系统的编码(非Vim的)保持一致。默认值使用Vim的全局
    -'encoding' 选项:
    -  let g:ctrlp_buftag_systemenc = &encoding
    -
    -
    -                                                       'g:ctrlp_buftag_types'
    -使用该选项来在ctags, jsctags...中为指定的文件格式设置参数:
    -  let g:ctrlp_buftag_types = ''
    -
    -例子:
    -  let g:ctrlp_buftag_types = {
    -    \ 'erlang'     : '--language-force=erlang --erlang-types=drmf',
    -    \ 'javascript' : {
    -      \ 'bin': 'jsctags',
    -      \ 'args': '-f -',
    -      \ },
    -    \ }
    -
    -
    -===============================================================================
    -自定义                                                    ctrlp-customization
    -
    -高亮:
    -  * CtrlP缓冲区的设置:
    -    CtrlPNoEntries : 当没有匹配被发现时的消息(错误)。
    -    CtrlPMatch     : 匹配模式(标识)。
    -    CtrlPLinePre   : 匹配窗口的行前缀'>'。
    -    CtrlPPrtBase   : 提示符窗口的基础(注释)。
    -    CtrlPPrtText   : 提示符窗口的文本 (hl-Normal)。
    -    CtrlPPrtCursor : 提示符窗口的光标在文本上移动时(常量)。
    -
    -  * 在扩展中:
    -    CtrlPTabExtra  : 每一行中不匹配的部分(注释)。
    -    CtrlPBufName   : 条目所属的缓冲区名称(hl-Directory)。
    -    CtrlPTagKind   : 缓冲区标签模式中标签的类型(hl-Title)。
    -    CtrlPqfLineCol : 快速修复模式中行和列的序号(注释)。
    -    CtrlPUndoT     : 撤销模式的流逝时间(hl-Directory)。
    -    CtrlPUndoBr    : 撤销模式的方括号(注释)。
    -    CtrlPUndoNr    : 撤销模式的方括号中的数字(字符串)。
    -    CtrlPUndoSv    : 文件被保存的点(注释)。
    -    CtrlPUndoPo    : 撤销树中的当前位置(hl-Title)。
    -    CtrlPBookmark  : 书签的名称(标识)。
    -
    -状态栏:
    -  * 高亮组:
    -    CtrlPMode1 : 'file''path''line',和当前模式(字符)。
    -    CtrlPMode2 : 'prt''win''regex',工作目录 hl-LineNr 。
    -    CtrlPStats : 扫描状态(函数)。
    -
    -  重新构建状态栏,参见 g:ctrlp_status_func 。
    -
    -===============================================================================
    -其它选项                                          ctrlp-miscellaneous-configs
    -
    -* 为 g:ctrlp_user_command 使用 wildignore :
    -
    -  function! s:wig2cmd()
    -    " 修改wildignore为空格或者|分隔的组
    -    " 例如: .aux .out .toc .jpg .bmp .gif
    -    " 或者  .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$
    -    let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@<!,\|$\)','\\\@<!,']
    -    let subs = has('win32') || has('win64') ? ['\1\3', ' '] : ['\1\2\3', '\\|']
    -    let expr = substitute(&wig, pats[0], subs[0], 'g')
    -    let expr = substitute(expr, pats[1], subs[1], 'g')
    -    let expr = substitute(expr, '\\,', ',', 'g')
    -
    -    " 设置用户命令选项
    -    let g:ctrlp_user_command = has('win32') || has('win64')
    -      \ ? 'dir %s /-n /b /s /a-d | findstr /V /l "'.expr.'"'
    -      \ : 'find %s -type f | grep -v "'.expr .'"'
    -  endfunction
    -
    -  call s:wig2cmd()
    -
    -(由 Rich Alesi <github.com/ralesi> 提交)
    -
    -* 一个独立的函数,设置项目的根目录为工作目录,如果没有找到根目录的话使用当前文
    -* 件的父目录。
    -
    -  function! s:setcwd()
    -    let cph = expand('%:p:h', 1)
    -    if cph =~ '^.\+://' | retu | en
    -    for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects']
    -      let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';'])
    -      if wd != '' | let &acd = 0 | brea | en
    -    endfo
    -    exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', ''))
    -  endfunction
    -
    -  autocmd BufEnter * call s:setcwd()
    -
    -(需要 Vim 7.1.299+)
    -
    -* 使用 count 来使用同样的按键绑定调用不同的命令:
    -
    -  let g:ctrlp_cmd = 'exe "CtrlP".get(["", "Buffer", "MRU"], v:count)'
    -
    -
    -===============================================================================
    -开发人员                                                        ctrlp-credits
    -
    -由 Kien Nguyen <github.com/kien>开发。 在Vim的 license 下发行。
    -
    -项目主页:      http://kien.github.com/ctrlp.vim
    -Git仓库:       https://github.com/kien/ctrlp.vim
    -Mercurial仓库: https://bitbucket.org/kien/ctrlp.vim
    -
    --------------------------------------------------------------------------------
    -感谢所有通过github,bitbucket或电子邮件提供想法,报告bug或者帮助debugging的人。
    -
    -特别感谢:
    -
    -    * Woojong Koh <github.com/wjkoh>
    -    * Simon Ruderich
    -    * Yasuhiro Matsumoto <github.com/mattn>
    -    * Ken Earley <github.com/kenearley>
    -    * Kyo Nagashima <github.com/hail2u>
    -    * Zak Johnson <github.com/zakj>
    -    * Diego Viola <github.com/diegoviola>
    -    * Piet Delport <github.com/pjdelport>
    -    * Thibault Duplessis <github.com/ornicar>
    -    * Kent Sibilev <github.com/datanoise>
    -    * Tacahiroy <github.com/tacahiroy>
    -    * Luca Pette <github.com/lucapette>
    -    * Seth Fowler <github.com/sfowler>
    -    * Lowe Thiderman <github.com/thiderman>
    -    * Christopher Fredén <github.com/icetan>
    -    * Zahary Karadjov <github.com/zah>
    -    * Jo De Boeck <github.com/grimpy>
    -    * Rudi Grinberg <github.com/rgrinberg>
    -    * Timothy Mellor <github.com/mellort>
    -
    -===============================================================================
    -更新日志                                                      ctrlp-changelog
    -
    -    + 结合 g:ctrlp_match_window_bottom g:ctrlp_match_window_reversed 和
    -      g:ctrlp_max_heightg:ctrlp_match_window 。
    -    + 新选项: g:ctrlp_match_window 。
    -
    -在2012/11/30之前
    -
    -    + 新选项: g:ctrlp_abbrev,
    -              g:ctrlp_key_loop,
    -              g:ctrlp_open_func,
    -              g:ctrlp_tabpage_position,
    -              g:ctrlp_mruf_save_on_update
    -    + 重命名:
    -        g:ctrlp_dotfiles -> g:ctrlp_show_hidden 。
    -    + 修改 g:ctrlp_switch_bufferg:ctrlp_working_path_mode的类型
    -      (旧值仍然工作)。
    -    + 当 g:ctrlp_user_command 是一个字典时,为其增加一个新的键: 'ignore'。
    -
    -在2012/06/15之前
    -
    -    + g:ctrlp_follow_symlinks 的新值: 2。
    -    + g:ctrlp_open_multiple_files 的新值: 'j'。
    -    + 允许使用 <c-t>, <c-x>, <c-v> 打开被 <c-z> 标记的文件。
    -    + 扩展 '..' (ctrlp-input-formats (d))
    -    + 新的输入格式: '@cd' (ctrlp-input-formats (d))
    -
    -在2012/04/30之前
    -
    -    + 新选项: g:ctrlp_mruf_default_order
    -    + 新特性: 被书签标记的目录的扩展。
    -    + 新命令: :CtrlPBookmarkDir
    -              :CtrlPBookmarkDirAdd
    -
    -在2012/04/15之前
    -
    -    + 新选项: g:ctrlp_buffer_func,CtrlP缓冲区的回调函数。
    -    + 移除  : g:ctrlp_mruf_last_entered,使其作为最近最多使用的默认行为。
    -    + 新命令: :CtrlPLastMode,以上一次使用的模式打开CtrlP。
    -              :CtrlPMixed,在文件,缓冲区和最近最多使用中搜索。
    -
    -在2012/03/31之前
    -
    -    + 新选项: g:ctrlp_default_input, 进入CtrlP后的默认输入。
    -              g:ctrlp_match_func,允许使用自定义的模糊查找工具。
    -    + 重命名:
    -        ClearCtrlPCache -> CtrlPClearCache
    -        ClearAllCtrlPCaches -> CtrlPClearAllCaches
    -        ResetCtrlP -> CtrlPReload
    -
    -在2012/03/02之前
    -
    -    + 重命名:
    -        g:ctrlp_regexp_search -> g:ctrlp_regexp,
    -        g:ctrlp_dont_split -> g:ctrlp_reuse_window,
    -        g:ctrlp_jump_to_buffer -> g:ctrlp_switch_buffer。
    -    + 重命名和微调:
    -        g:ctrlp_open_multi -> g:ctrlp_open_multiple_files。
    -    + 过时 g:ctrlp_highlight_match
    -    + 扩展 g:ctrlp_user_command 支持多个命令。
    -    + 新选项: g:ctrlp_mruf_last_entered 修改最近最多使用为最近进入。
    -
    -在2012/01/15之前
    -
    -    + 新按键绑定: 交换 <tab><s-tab>. <tab> 现在用来补全在当前工作目录内的目
    -                  录名。
    -    + 新选项: g:ctrlp_arg_map 使 <c-y><c-o> 可以接收一个参数。
    -              g:ctrlp_status_func 自定义状态栏。
    -              g:ctrlp_mruf_relative 在当前工作目录内显示最近最多使用。
    -    + 扩展 g:ctrlp_open_multi 增加新选项值: tr, hr, vr。
    -    + 扩展 g:ctrlp_custom_ignore 指定过滤目录,文件和链接。
    -
    -在2012/01/05之前
    -
    -    + 新特性: 缓冲区标记扩展。
    -    + 新命令: :CtrlPBufTag, :CtrlPBufTagAll。
    -    + 新选项: g:ctrlp_cmd,
    -              g:ctrlp_custom_ignore
    -
    -在2011/11/30之前
    -
    -    + 新特性: 标签,快速修复和目录扩展。
    -    + 新命令: :CtrlPTag, :CtrlPQuickfix, :CtrlPDir。
    -    + 新选项: g:ctrlp_use_migemo,
    -              g:ctrlp_lazy_update,
    -              g:ctrlp_follow_symlinks
    -
    -在2011/11/13之前
    -
    -    + 新的特殊输入: '/' 和 '\' 查找根目录 (ctrlp-input-formats (e))
    -    + 移除 ctrlp#SetWorkingPath()。
    -    + 移除 g:ctrlp_mru_files ,使最近最多使用模式变为永久的。
    -    + 扩展 g:ctrlp_open_multi,添加打开文件的新方式。
    -    + 新选项: g:ctrlp_dont_split,
    -              g:ctrlp_mruf_case_sensitive
    -
    -在2011/10/30之前
    -
    -    + 新特性: 支持自定义扩展。
    -              <F5> 也会从最近最多使用列表中移除不存在的文件。
    -    + 新选项: g:ctrlp_jump_to_buffer
    -
    -在2011/10/12之前
    -
    -    + 新特性: 打开多个文件。
    -              传递Vim的 ++opt+cmd 到新打开的文件
    -              (ctrlp-input-formats (c))
    -              为 :CtrlP [起始目录]自动补全每个目录
    -    + 新按键绑定: <c-z> 标记/取消标记一个被 <c-o> 打开的文件。
    -                  <c-o> 打开所有被标记的文件。
    -    + 新选项: g:ctrlp_open_multi
    -    + 移除 g:ctrlp_persistent_input g:ctrlp_live_update and <c-^>。
    -
    -在2011/09/29之前
    -
    -    + 新按键绑定: <c-n>, <c-p> 输入历史中的前一个/后一个字符串。
    -                  <c-y> 创建一个新的文件和它的父目录。
    -    + 新选项: g:ctrlp_open_new_file,
    -                   g:ctrlp_max_history
    -    + 添加一个新的在横向分割窗口打开的绑定:<c-x>
    -
    -在2011/09/19之前
    -
    -    + 新命令: ResetCtrlP
    -    + 新选项: g:ctrlp_max_files,
    -              g:ctrlp_max_depth,
    -              g:ctrlp_live_update
    -    + 新按键绑定: <c-^>
    -
    -在2011/09/12之前
    -
    -    + 添加在匹配窗口内循环匹配行的功能。
    -    + 扩展 g:ctrlp_persistent_input的行为
    -    + 扩展 :CtrlP 的行为
    -    + 新选项: g:ctrlp_dotfiles,
    -              g:ctrlp_clear_cache_on_exit,
    -              g:ctrlp_highlight_match,
    -              g:ctrlp_user_command
    -    + 新的特殊输入: '..' (ctrlp-input-formats (d))
    -    + 新按键绑定: <F5>。
    -    + 新命令: :CtrlPCurWD,
    -              :CtrlPCurFile,
    -              :CtrlPRoot
    -
    -    + 新特性: 在最近最常使用的文件列表中搜索
    -    + 新按键绑定: <c-b>。
    -    + 扩展 <c-f> 的行为。
    -    + 新选项: g:ctrlp_mru_files,
    -              g:ctrlp_mruf_max,
    -              g:ctrlp_mruf_exclude,
    -              g:ctrlp_mruf_include
    -    + 新命令: :CtrlPMRU
    -
    -第一版发布于: 2011/09/06
    -
    -===============================================================================
    -vim:ft=help:et:ts=2:sw=2:sts=2:norl
    -
    - - - diff --git a/pages/jquery-datatables-config-cn.html b/pages/jquery-datatables-config-cn.html deleted file mode 100644 index 630539a..0000000 --- a/pages/jquery-datatables-config-cn.html +++ /dev/null @@ -1,1475 +0,0 @@ - - - - -DataTableConfig.js.html - - - -
    -   1 //@translator codepiano
    -   2 //@blog codepiano 
    -   3 //@email codepiano.li@qq.com
    -   4 //尝试着翻译了一下,难免有错误的地方,欢迎发邮件告知,多谢。
    -   5 /*------------------------------------------------Feature------------------------------------------------*/
    -   6 $(document).ready( function (){
    -   7   $('selector').dataTable( {
    -   8     /*
    -   9      *  默认为true
    -  10      *  是否自动计算列宽,计算列宽会花费一些时间,如果列宽通过aoColumns传递,可以关闭该属性作为优化
    -  11      */
    -  12     "bAutoWidth":true,
    -  13     /*
    -  14      *  默认为false
    -  15      *  是否延迟渲染,当用Ajax或者js方式加载数据时开启延迟渲染会带来很大的速度提升
    -  16      *  当该属性设置为true时,表格每一行新增的元素只有在需要被画出来时才会被DataTable创建出来
    -  17      */
    -  18     "bDeferRender":false,
    -  19     /*
    -  20      * 默认为true
    -  21      * 是否对数据进行过滤,数据过滤是十分灵活的,允许终端用户输入多个用空格分隔开的关键字
    -  22      * 匹配包含这些关键字的行,即使关键字的顺序不是用户输入的顺序,过滤操作会跨列进行匹配,关键字可以分布在一行中不同的列
    -  23      * 要注意的是如果你想在DataTable中使用过滤,该选项必须设置为true,如果想移除默认过滤输入框但是保留过滤功能,请设置为false(API没写,推测是false)
    -  24      */
    -  25     "bFilter":true,
    -  26     /*
    -  27      * 默认为true
    -  28      * 是否显示表格信息,是指当前页面上显示的数据的信息,如果有过滤操作执行,也会显示过滤操作的信息
    -  29      */
    -  30     "bInfo":true,
    -  31     /*
    -  32      * 默认为fasle
    -  33      * 是否开启jQuery UI ThemeRoller支持,需要一些ThemeRoller使用的标记,这些标记有些与DataTable传统使用的有轻微的差异,有些是额外附加的
    -  34      */
    -  35     "bJQueryUI":false,
    -  36     /*
    -  37      * 默认为true
    -  38      * 是否允许终端用户从一个选择列表中选择分页的页数,页数为10,25,50和100,需要分页组件bPaginate的支持
    -  39      */
    -  40     "bLengthChange":false,
    -  41     /*
    -  42      * 默认为true
    -  43      * 是否开启分页功能,即使设置为false,仍然会有一个默认的<前进,后退>分页组件
    -  44      */
    -  45     "bPaginage":true,
    -  46     /*
    -  47      * 默认为false
    -  48      * 当表格在处理的时候(比如排序操作)是否显示“处理中...”
    -  49      * 当表格的数据中的数据过多以至于对其中的记录进行排序时会消耗足以被察觉的时间的时候,该选项会有些用处
    -  50      */
    -  51     "bProcessing":false,
    -  52     /*
    -  53      * 默认为false
    -  54      * 是否开启不限制长度的滚动条(和sScrollY属性结合使用),不限制长度的滚动条意味着当用户拖动滚动条的时候DataTable会不断加载数据
    -  55      * 当数据集十分大的时候会有些用处,该选项无法和分页选项同时使用,分页选项会被自动禁止,注意,额外推荐的滚动条会优先与该选项
    -  56      */
    -  57     "bScrollInfinite":false,
    -  58     /*
    -  59      * 默认为false
    -  60      * 配置DataTable使用服务器端处理,注意,sAjaxSource参数必须指定,以便给DataTable一个为每一行获取数据的数据源
    -  61      */
    -  62     "bServerSide":false,
    -  63     /*
    -  64      * 默认为true
    -  65      * 是否开启列排序,对单独列的设置在每一列的bSortable选项中指定
    -  66      */
    -  67     "bSort":true,
    -  68     /*
    -  69      * 默认为true
    -  70      * 是否在当前被排序的列上额外添加sorting_1,sorting_2,sorting_3三个class,当该列被排序的时候,可以切换其背景颜色
    -  71      * 该选项作为一个来回切换的属性会增加执行时间(当class被移除和添加的时候)
    -  72      * 当对大数据集进行排序的时候你或许希望关闭该选项
    -  73      */
    -  74     "bSortClasses":true,
    -  75     /*
    -  76      * 默认为false
    -  77      * 是否开启状态保存,当选项开启的时候会使用一个cookie保存表格展示的信息的状态,例如分页信息,展示长度,过滤和排序等
    -  78      * 这样当终端用户重新加载这个页面的时候可以使用以前的设置
    -  79      */
    -  80     "bStateSave":false,
    -  81     /*
    -  82      * 默认为空字符串,即:无效
    -  83      * 是否开启水平滚动,当一个表格过于宽以至于无法放入一个布局的时候,或者表格有太多列的时候,你可以开启该选项
    -  84      * 从而在一个可横向滚动的视图里面展示表格,该属性可以是css设置,或者一个数字(作为像素量度来使用)
    -  85      */
    -  86     "sScrollX":"100%",
    -  87     /*
    -  88      * 默认为空字符串,即:无效
    -  89      * 是否开启垂直滚动,垂直滚动会驱使DataTable设置为给定的长度,任何溢出到当前视图之外的数据可以通过垂直滚动进行察看
    -  90      * 当在小范围区域中显示大量数据的时候,可以在分页和垂直滚动中选择一种方式,该属性可以是css设置,或者一个数字(作为像素量度来使用)
    -  91      */
    -  92     "sScrollY":"100%",
    -  93     /*
    -  94      * 自定义语言设置
    -  95      */
    -  96     "oLanguage":{
    -  97         "oAria":{
    -  98         /*
    -  99          * 默认值为activate to sort column ascending
    - 100          * 当一列被按照升序排序的时候添加到表头的ARIA标签,注意列头是这个字符串的前缀(?)
    - 101          */
    - 102             "sSortAscending": " - click/return to sort ascending",
    - 103         /*
    - 104          * 默认值为activate to sort column ascending
    - 105          * 当一列被按照升序降序的时候添加到表头的ARIA标签,注意列头是这个字符串的前缀(?)
    - 106          */
    - 107             "sSortDescending": " - click/return to sort descending"
    - 108         },
    - 109         "oPaginate": {
    - 110             /*
    - 111              * 默认值为First
    - 112              * 当使用全数字类型的分页组件的时候,到第一页按钮上的文字
    - 113              */
    - 114             "sFirst": "First page",
    - 115             /*
    - 116              * 默认值为Last
    - 117              * 当使用全数字类型的分页组件的时候,到最后一页按钮上的文字
    - 118              */
    - 119             "sLast": "Last page",
    - 120             /*
    - 121              * 默认值为Next
    - 122              * 当使用全数字类型的分页组件的时候,到下一页按钮上的文字
    - 123              */
    - 124             "sNext": "Next page",
    - 125             /*
    - 126              * 默认值为Previous
    - 127              * 当使用全数字类型的分页组件的时候,到前一页按钮上的文字
    - 128              */
    - 129             "sPrevious": "Previous page"
    - 130         },
    - 131         /*
    - 132          * 默认值activate to sort column ascending为
    - 133          * 当表格中没有数据(无视因为过滤导致的没有数据)时,该字符串年优先与sZeroRecords显示
    - 134          * 注意这是个可选参数,如果没有指定,sZeroRecrods会被使用(既不是默认值也不是给定的值)
    - 135          */
    - 136         "sEmptyTable": "No data available in table",
    - 137         /*
    - 138          * 默认值为Showing _START_ to _END_ of _TOTAL_ entries 
    - 139          * 该属性给终端用户提供当前页面的展示信息,字符串中的变量会随着表格的更新被动态替换,而且可以被任意移动和删除
    - 140          */
    - 141         "sInfo": "Got a total of _TOTAL_ entries to show (_START_ to _END_)",
    - 142         /*
    - 143          * 默认值为Showing 0 to 0 of 0 entries 
    - 144          * 当表格中没有数据时展示的表格信息,通常情况下格式会符合sInfo的格式
    - 145          */
    - 146         "sInfoEmpty": "No entries to show",
    - 147         /*
    - 148          * 默认值为(filtered from _MAX_ total entries) 
    - 149          * 当用户过滤表格中的信息的时候,该字符串会被附加到信息字符串的后面,从而给出过滤器强度的直观概念
    - 150          */
    - 151         "sInfoFiltered": " - filtering from _MAX_ records",
    - 152         /*
    - 153          * 默认值为空字符串
    - 154          * 使用该属性可以很方便的向表格信息字符串中添加额外的信息,被添加的信息在任何时候都会被附加到表格信息组件的后面
    - 155          * sInfoEmpty和sInfoFiltered可以以任何被使用的方式进行结合
    - 156          */
    - 157         "sInfoPostFix": "All records shown are derived from real information.",
    - 158         /*
    - 159          * 默认值为','
    - 160          * DataTable有内建的格式化数字的工具,可以用来格式化表格信息中较大的数字
    - 161          * 默认情况下会自动调用,可以使用该选项来自定义分割的字符 
    - 162          */
    - 163         "sInfoThousands": "'",
    - 164         /*
    - 165          * 默认值为Show _MENU_ entries 
    - 166          * 描述当分页组件的下拉菜单的选项被改变的时候发生的动作,'_MENU_'变量会被替换为默认的10,25,50,100
    - 167          * 如果需要的话可以被自定义的下拉组件替换
    - 168          */
    - 169         "sLengthMenu": "Display _MENU_ records",
    - 170         /*
    - 171          * 默认值为Loading...
    - 172          * 当使用Ajax数据源和表格在第一次被加载搜集数据的时候显示的字符串,该信息在一个空行显示
    - 173          * 向终端用户指明数据正在被加载,注意该参数在从服务器加载的时候无效,只有Ajax和客户端处理的时候有效
    - 174          */
    - 175         "sLoadingRecords": "Please wait - loading...",
    - 176         /*
    - 177          * 默认值为Processing...
    - 178          * 当表格处理用户动作(例如排序或者类似行为)的时候显示的字符串
    - 179          */
    - 180         "sProcessing": "DataTables is currently busy",
    - 181         /*
    - 182          * 默认为Search:
    - 183          * 描述用户在输入框输入过滤条件时的动作,变量'_INPUT_',如果用在字符串中
    - 184          * DataTable会使用用户输入的过滤条件替换_INPUT_为HTML文本组件,从而可以支配它(即用户输入的过滤条件)出现在信息字符串中的位置 
    - 185          * 如果变量没有指定,用户输入会自动添加到字符串后面
    - 186          */
    - 187         "sSearch": "Apply filter _INPUT_ to table",
    - 188         /*
    - 189          * 默认值为空字符串,即:无效
    - 190          * 所有语言信息可以被存储在服务器端的文件中,DataTable可以根据该参数指定的URL去寻找
    - 191          * 必须保存语言文件的URL信息,必须是JSON格式,对象和初始化中使用的oLanguage对象具有相同的属性
    - 192          * 请参考示例文件来了解该参数是如何工作的
    - 193          */
    - 194         "sUrl": "http://www.sprymedia.co.uk/dataTables/lang.txt",
    - 195         /*
    - 196          * 默认值为No matching records found
    - 197          * 当对数据进行过滤操作后,如果没有要显示的数据,会在表格记录中显示该字符串
    - 198          * sEmptyTable只在表格中没有数据的时候显示,忽略过滤操作
    - 199          */
    - 200         "sZeroRecords": "No records to display"
    - 201     }
    - 202   });
    - 203 });
    - 204 
    - 205 /*------------------------------------------------Options------------------------------------------------*/
    - 206 /*
    - 207  * bDestroy
    - 208  * 默认为false
    - 209  * 使用传递的新的初始化对象中的属性构造一个新的表格,并替换一个匹配指定的选择器的表格
    - 210  * 如果没有匹配到表格,新的表格会被作为一个普通表格被构建
    - 211  */
    - 212 $('selector').dataTable({
    - 213     "bFilter": false,
    - 214     "bDestroy": true
    - 215 });
    - 216 
    - 217 /*
    - 218  * bRetrieve
    - 219  * 默认为false
    - 220  * 使用指定的选择器检索表格,注意,如果表格已经被初始化,该参数会直接返回已经被创建的对象
    - 221  * 并不会顾及你传递进来的初始化参数对象的变化,将该参数设置为true说明你确认已经明白这一点
    - 222  * 如果你需要的话,bDestroy可以用来重新初始化表格
    - 223  */
    - 224 $(document).ready(function(){
    - 225   initTable();
    - 226   tableActions();
    - 227 });
    - 228 
    - 229 function initTable()
    - 230 {
    - 231   return $('#example').dataTable( {
    - 232     "sScrollY": "200px",
    - 233     "bPaginate": false,
    - 234     "bRetrieve": true
    - 235   });
    - 236 }
    - 237 
    - 238 function tableActions()
    - 239 {
    - 240   var oTable = initTable();
    - 241   // perform API operations with oTable 
    - 242 }
    - 243 
    - 244 /*
    - 245  * bScrollAutoCss
    - 246  * 默认为true
    - 247  * 指明DataTable中滚动的标题元素是否被允许设置内边距和外边距等
    - 248  */
    - 249 $(document).ready(function(){
    - 250   $('#example').dataTable( {
    - 251     "bScrollAutoCss": false,
    - 252     "sScrollY": "200px"
    - 253   });
    - 254 });
    - 255 
    - 256 /*
    - 257  * bScrollCollapse
    - 258  * 默认为false
    - 259  * 当垂直滚动被允许的时候,DataTable会强制表格视图在任何时候都是给定的高度(对布局有利)
    - 260  * 不过,当把数据集过滤到十分小的时候看起来会很古怪,而且页脚会留在最下面
    - 261  * 当结果集的高度比给定的高度小时该参数会使表格高度自适应
    - 262  */
    - 263 $(document).ready(function(){
    - 264   $('#example').dataTable( {
    - 265     "sScrollY": "200",
    - 266     "bScrollCollapse": true
    - 267   });
    - 268 });
    - 269 
    - 270 /*
    - 271  * bSortCellsTop
    - 272  * 默认为false
    - 273  * 是否允许DataTable使用顶部(默认为true)的单元格,或者底部(默认为false)的单元格,当使用复合表头的时候会有些用处
    - 274  */
    - 275 $(document).ready(function(){
    - 276   $('#example').dataTable( {
    - 277     "bSortCellsTop": true
    - 278   });
    - 279 });
    - 280 
    - 281 /*
    - 282  * iCookieDuration
    - 283  * 默认为7200秒(2个小时)
    - 284  * 设置用来存储会话信息的cookie的持续时间,单位是秒
    - 285  */
    - 286 $(document).ready(function(){
    - 287   $('#example').dataTable( {
    - 288     "iCookieDuration": 60*60*24 // 1 day
    - 289   });
    - 290 })
    - 291 
    - 292 /*
    - 293  * iDeferLoading
    - 294  * 默认为null
    - 295  * 当选项被开启的时候,DataTable在非加载第一次的时候不会向服务器请求数据,而是会使用页面上的已有数据(不会应用排序等)
    - 296  * 因此在加载的时候保留一个XmlHttpRequest,iDeferLoading被用来指明需要延迟加载,而且也用来通知DataTable一个满的表格有多少条数据
    - 297  * 信息元素和分页会被正确保留
    - 298  */
    - 299 $(document).ready(function(){
    - 300   $('#example').dataTable( {
    - 301     "bServerSide": true,
    - 302     "sAjaxSource": "scripts/server_processing.php",
    - 303     "iDeferLoading": 57
    - 304   });
    - 305 });
    - 306 
    - 307 /*
    - 308  * iDisplayLength
    - 309  * 默认为10
    - 310  * 单页显示的数据的条数,如果bLengthChange属性被开启,终端用户可以通过一个弹出菜单重写该数值
    - 311  */
    - 312 $(document).ready(function(){
    - 313   $('#example').dataTable( {
    - 314     "bServerSide": true,
    - 315     "sAjaxSource": "scripts/server_processing.php",
    - 316     "iDeferLoading": 57
    - 317   });
    - 318 });
    - 319 
    - 320 /*
    - 321  * iDisplayStart
    - 322  * 默认为0
    - 323  * 当开启分页的时候,定义展示的记录的起始序号,不是页数,因此如果你每个分页有10条记录而且想从第三页开始
    - 324  * 需要把该参数指定为20
    - 325  */
    - 326 $(document).ready(function(){
    - 327   $('#example').dataTable( {
    - 328     "iDisplayStart": 20
    - 329   });
    - 330 })
    - 331 
    - 332 /*
    - 333  * iScrollLoadGap
    - 334  * 默认为100
    - 335  * 滚动余界是指DataTable在当前页面还有多少条数据可供滚动时自动加载新的数据,你可能希望指定一个足够大的余界
    - 336  * 以便滚动加载数据的操作对用户来说是平滑的,同时也不会大到加载比需要的多的多的数据
    - 337  */
    - 338 $(document).ready(function(){
    - 339   $('#example').dataTable( {
    - 340     "bScrollInfinite": true,
    - 341     "bScrollCollapse": true,
    - 342     "sScrollY": "200px",
    - 343     "iScrollLoadGap": 50
    - 344   });
    - 345 });
    - 346 
    - 347 /*
    - 348  * iTabIndex
    - 349  * 默认为0
    - 350  * 默认情况下DataTable允许通过为需要键盘导航的元素添加tabindex属性来进行导航(排序、分页、过滤)
    - 351  * 允许你通过tab键切换控制组件,使用回车键去激活他们,默认为0表示按照文档流来切换
    - 352  * 如果需要的话,你可以使用该参数重写切换顺序,使用-1来禁止内建的键盘导航
    - 353  */
    - 354 $(document).ready(function(){
    - 355   $('#example').dataTable( {
    - 356     "iTabIndex": 1
    - 357   });
    - 358 });
    - 359 
    - 360 /*
    - 361  * oSearch
    - 362  * 无默认值
    - 363  * 该参数允许你在初始化的时候使用已经定义的全局过滤状态,sSearch对象必须被定义,但是所有的其它选项都是可选的
    - 364  * 当bRegex为true的时候,搜索字符串会被当作正则表达式,当为false(默认)的时候,会被直接当作一个字符串
    - 365  * 当bSmart为true的时候,DataTable会使用使用灵活过滤策略(匹配任何可能的数据),为false的时候不会这样做
    - 366  */
    - 367 $(document).ready(function(){
    - 368     $('#example').dataTable( {
    - 369         "oSearch": {"sSearch": "Initial search"}
    - 370     });
    - 371 })
    - 372 
    - 373 /*
    - 374  * sAjaxDataProp
    - 375  * 默认为aaData
    - 376  * 当使用Ajax数据源或者服务器端处理的时候,DataTable会默认搜索aaData属性作为数据源
    - 377  * 该选项允许变更数据源的名称,你可以使用JavaScript的点号对象表示法去访问多级网状数据源
    - 378  */
    - 379 // Get data from { "data": [...] }
    - 380 $(document).ready(function(){
    - 381   var oTable = $('#example').dataTable( {
    - 382     "sAjaxSource": "sources/data.txt",
    - 383     "sAjaxDataProp": "data"
    - 384   });
    - 385 });
    - 386 
    - 387 // Get data from { "data": { "inner": [...] } }
    - 388 $(document).ready(function(){
    - 389   var oTable = $('#example').dataTable( {
    - 390     "sAjaxSource": "sources/data.txt",
    - 391     "sAjaxDataProp": "data.inner"
    - 392   });
    - 393 });
    - 394 
    - 395 /*
    - 396  * sAjaxSource
    - 397  * 默认为null
    - 398  * 该参数用来向DataTable指定加载的外部数据源(如果想使用现有的数据,请使用aData)
    - 399  * 可以简单的提供一个可以用来获得数据url或者JSON对象,该对象必须包含aaData,作为表格的数据源
    - 400  */
    - 401 $(document).ready(function(){
    - 402   $('#example').dataTable( {
    - 403     "sAjaxSource": "http://www.sprymedia.co.uk/dataTables/json.php"
    - 404   });
    - 405 })
    - 406 
    - 407 /*
    - 408  * sCookiePrefix
    - 409  * 默认为SpryMedia_DataTables_
    - 410  * 该参数可以用来重写DataTable默认指定的用来存储状态信息的cookie的前缀
    - 411 */
    - 412 $(document).ready(function(){
    - 413   $('#example').dataTable( {
    - 414     "sCookiePrefix": "my_datatable_",
    - 415   });
    - 416 });
    - 417 
    - 418 /*
    - 419  * sDom
    - 420  * 默认值为lfrtip (when bJQueryUI is false) or <"H"lfr>t<"F"ip> (when bJQueryUI is true)
    - 421  * 该初始化属性用来指定你想把各种控制组件注入到dom节点的位置(比如你想把分页组件放到表格的顶部)
    - 422  * DIV元素(带或者不带自定的class)可以添加目标样式,下列语法被使用
    - 423  *  可供使用的选项
    - 424  *      'l' - 长度改变
    - 425  *      'f' - 过滤输入
    - 426  *      't' - 表格
    - 427  *      'i' - 信息
    - 428  *      'p' - 分页
    - 429  *      'r' - 处理
    - 430  *  可供使用的常量
    - 431  *      'H' - jQueryUI theme "header" classes('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')
    - 432  *      'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')
    - 433  *  需要的语法
    - 434  *      '<' 和 '>' - div元素
    - 435  *      '<"class" and '>' - 带有class属性的div元素
    - 436  *      '<"#id" and '>' - 带有id属性的div元素
    - 437  *  例子
    - 438  *      '<"wrapper"flipt>'
    - 439  *      '<lf<t>ip>'
    - 440  */
    - 441 $(document).ready(function(){
    - 442   $('#example').dataTable( {
    - 443     "sDom": '<"top"i>rt<"bottom"flp><"clear"&lgt;'
    - 444   });
    - 445 });
    - 446 
    - 447 /*
    - 448  * sPaginationType
    - 449  * 默认为two_button
    - 450  * DataTable内建了两种交互式分页策略,两个按钮和全页数,展现给终端用户不同的控制方式
    - 451  * 可以通过API增加策略
    - 452  */
    - 453 $(document).ready(function(){
    - 454     $('#example').dataTable( {
    - 455         "sPaginationType": "full_numbers"
    - 456     });
    - 457 })
    - 458 
    - 459 /*
    - 460  * sScrollXInner
    - 461  * 默认为空字符串,即:无效
    - 462  * 当横向滚动可用的时候,该属性可以用来强制DataTable的宽度比需要的更长
    - 463  * 比如你需要表格彼此相隔适宜,该变量可以用来使表格变大,而且强制滚动
    - 464  * 该该属性可以是css设置,或者一个数字(作为像素量度来使用)
    - 465  */
    - 466 $(document).ready(function(){
    - 467     $('#example').dataTable( {
    - 468         "sScrollX": "100%",
    - 469         "sScrollXInner": "110%"
    - 470     });
    - 471 });
    - 472 
    - 473 /*
    - 474  * sServerMethod
    - 475  * 默认值为GET
    - 476  * 设置使用Ajax方式调用的服务器端的处理方法或者Ajax数据源的HTTP请求方式
    - 477  */
    - 478 $(document).ready(function(){
    - 479     $('#example').dataTable({
    - 480         "bServerSide": true,
    - 481         "sAjaxSource": "scripts/post.php",
    - 482         "sServerMethod": "POST"
    - 483     });
    - 484 });
    - 485 /*------------------------------------------------Callback------------------------------------------------*/
    - 486 /*
    - 487  * fnCookieCallback
    - 488  * 无默认值
    - 489  * 当DataTable的状态保留可用时,自定义被保存的cookie和参数。只要cookie被修改就会调用此方法
    - 490  * 该方法需要返回一个格式良好的cookie字符串,注意数据对象是以Javascript对象的形式传递进来的,必须转换成字符串,例如JSON格式
    - 491  */
    - 492 $(document).ready(function (){
    - 493   $('#example').dataTable({
    - 494     "fnCookieCallback": function (sName, oData, sExpires, sPath) {
    - 495       // Customise oData or sName or whatever else here
    - 496       return sName + "="+JSON.stringify(oData)+"; expires=" + sExpires +"; path=" + sPath;
    - 497     }
    - 498   });
    - 499 });
    - 500 
    - 501 /*
    - 502  * fnCreatedRow
    - 503  * 无默认值
    - 504  * 当一个新的TR元素(并且所有TD子元素被插入)被创建或者被作为一个DOM资源被注册时调用该函数
    - 505  * 允许操作该TR元素
    - 506  */
    - 507 $(document).ready(function(){
    - 508     $('#example').dataTable({
    - 509         "fnCreatedRow": function( nRow, aData, iDataIndex ){
    - 510             // Bold the grade for all 'A' grade browsers
    - 511             if ( aData[4] == "A" )
    - 512     {
    - 513         $('td:eq(4)', nRow).html( '<b>A</b>' );
    - 514     }
    - 515         }
    - 516     });
    - 517 });
    - 518 
    - 519 /*
    - 520  * fnDrawCallback
    - 521  * 无默认值
    - 522  * 每当draw事件发生时调用该函数,允许你动态编辑新建的dom对象的任何属性
    - 523  */
    - 524 $(document).ready( function(){
    - 525     $('#example').dataTable({
    - 526         "fnDrawCallback": function(){
    - 527             alert( 'DataTables has redrawn the table' );
    - 528         }
    - 529     });
    - 530 });
    - 531 
    - 532 /*
    - 533  * fnFooterCallback
    - 534  * 无默认值
    - 535  * 与fnHeaderCallback()完全相同,只是该函数允许你在每一个draw时间发生时修改页脚
    - 536  */
    - 537 $(document).ready( function(){
    - 538     $('#example').dataTable({
    - 539         "fnDrawCallback": function() {
    - 540             alert( 'DataTables has redrawn the table' );
    - 541         }
    - 542     });
    - 543 });
    - 544 
    - 545 /*
    - 546  * fnFormatNumber
    - 547  * 无默认值
    - 548  * 当渲染表格信息(例如:显示57条记录中的1-10条)中大的数字时
    - 549  * 为了方便用户,DataTable会使用逗号分割每千单位(例如1000000会被渲染为1,000,000)
    - 550  * 该函数会重写DataTable默认使用的策略
    - 551  */
    - 552 $(document).ready(function(){
    - 553   $('#example').dataTable({
    - 554     "fnFormatNumber": function ( iIn ) {
    - 555       if ( iIn < 1000 ) {
    - 556         return iIn;
    - 557       } else {
    - 558         var
    - 559           s=(iIn+""),
    - 560           a=s.split(""), out="",
    - 561           iLen=s.length;
    - 562 
    - 563         for ( var i=0 ; i<iLen ; i++ ) {
    - 564           if ( i%3 === 0 && i !== 0 ) {
    - 565             out = "'"+out;
    - 566           }
    - 567           out = a[iLen-i-1]+out;
    - 568         }
    - 569       }
    - 570       return out;
    - 571     };
    - 572   });
    - 573 });
    - 574 
    - 575 /*
    - 576  * fnHeaderCallback
    - 577  * 无默认值
    - 578  * 每当draw事件发生时调用该函数,允许你动态编辑表头行,可以用来计算和展示关于表格的有用的信息
    - 579  */
    - 580 $(document).ready(function(){
    - 581     $('#example').dataTable({
    - 582         "fnFormatNumber": function ( iIn ) {
    - 583             if ( iIn < 1000 ) {
    - 584                 return iIn;
    - 585             } else {
    - 586                 var
    - 587         s=(iIn+""),
    - 588         a=s.split(""), out="",
    - 589         iLen=s.length;
    - 590 
    - 591     for ( var i=0 ; i<iLen ; i++ ) {
    - 592         if ( i%3 === 0 && i !== 0 ) {
    - 593             out = "'"+out;
    - 594         }
    - 595         out = a[iLen-i-1]+out;
    - 596     }
    - 597             }
    - 598             return out;
    - 599         };
    - 600     });
    - 601 });
    - 602 
    - 603 /*
    - 604  * fnInfoCallback
    - 605  * 无默认值
    - 606  * 信息元素可以用来传输表格当前状态的信息,尽管DataTable提供的国际化的选项在处理大多数自定义情况时已经相当方便了
    - 607  * 或许你有时仍然希望自定义深层的字符串,该函数会满足你的需要
    - 608  */
    - 609 $('#example').dataTable( {
    - 610     "fnInfoCallback": function( oSettings, iStart, iEnd, iMax, iTotal, sPre ) {
    - 611         return iStart +" to "+ iEnd;
    - 612     }
    - 613 });
    - 614 
    - 615 /*
    - 616  * fnInitComplete
    - 617  * 无默认值
    - 618  * 当表格被初始化后调用该函数,通常DataTable会被持续初始化,并不需要该函数
    - 619  * 可是,当使用异步的XmlHttpRequest从外部获得语言信息时,初始化并不是持续的
    - 620  */
    - 621 $(document).ready( function(){
    - 622     $('#example').dataTable({
    - 623         "fnInitComplete": function(oSettings, json) {
    - 624             alert( 'DataTables has finished its initialisation.' );
    - 625         }
    - 626     });
    - 627 })
    - 628 
    - 629 /*
    - 630  * fnPreDrawCallback
    - 631  * 无默认值
    - 632  * 在每一个表格draw事件发生前调用该函数,通过返回false来取消draw事件
    - 633  * 其它任何的返回值,包括undefined都会导致draw事件的发生
    - 634  */
    - 635 $(document).ready( function(){
    - 636     $('#example').dataTable({
    - 637         "fnPreDrawCallback": function( oSettings ) {
    - 638             if ( $('#test').val() == 1 ) {
    - 639                 return false;
    - 640             }
    - 641         }
    - 642     });
    - 643 });
    - 644 
    - 645 /*
    - 646  * fnRowCallback
    - 647  * 无默认值
    - 648  * 你可以通过该函数在每一个表格绘制事件发生之后,渲染到屏幕上之前,向表格里的每一行传递'处理过程'
    - 649  * 该函数可以用来设置行的class名字等
    - 650  */
    - 651 $(document).ready(function(){
    - 652     $('#example').dataTable({
    - 653         "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
    - 654             // Bold the grade for all 'A' grade browsers
    - 655             if ( aData[4] == "A" )
    - 656     {
    - 657         $('td:eq(4)', nRow).html( '<b>A</b>' );
    - 658     }
    - 659         }
    - 660     });
    - 661 });
    - 662 
    - 663 /*
    - 664  * fnServerData
    - 665  * 无默认值
    - 666  * 你可以使用该参数重写从服务器获取数据的方法($.getJSON),从而使其更适合你的应用
    - 667  * 例如你可以使用POST方式提交,或者从Google Gears或者AIR数据库获取数据
    - 668  */
    - 669 // POST data to server
    - 670 $(document).ready(function(){
    - 671     $('#example').dataTable( {
    - 672         "bProcessing": true,
    - 673         "bServerSide": true,
    - 674         "sAjaxSource": "xhr.php",
    - 675         "fnServerData": function ( sSource, aoData, fnCallback ) {
    - 676             $.ajax( {
    - 677                 "dataType": 'json',
    - 678             "type": "POST",
    - 679             "url": sSource,
    - 680             "data": aoData,
    - 681             "success": fnCallback
    - 682             } );
    - 683         }
    - 684     });
    - 685 });
    - 686 
    - 687 /*
    - 688  * fnServerParams
    - 689  * 无默认值
    - 690  * 用来在向服务器发送Ajax请求时发送额外的数据,例如自定义的过滤信息,该函数使向服务器发送额外参数变得简单
    - 691  * 传递进来的参数是DataTable建立的数据集合,你可以根据需要添加或者修改该集合
    - 692  */
    - 693 $(document).ready(function(){
    - 694     $('#example').dataTable( {
    - 695         "bProcessing": true,
    - 696         "bServerSide": true,
    - 697         "sAjaxSource": "scripts/server_processing.php",
    - 698         "fnServerParams": function ( aoData ) {
    - 699             aoData.push( { "name": "more_data", "value": "my_value" } );
    - 700         }
    - 701     });
    - 702 });
    - 703 
    - 704 /*
    - 705  * fnStateLoad
    - 706  * 无默认值
    - 707  * 加载表格状态,使用该函数你可以定义状态信息加载的位置和方式,默认情况下DataTable会从cookie中加载
    - 708  * 不过你或许希望使用本地存储(HTML5支持),或者服务端数据库
    - 709  */
    - 710 $(document).ready(function(){
    - 711     $('#example').dataTable({
    - 712         "bStateSave": true,
    - 713         "fnStateSave": function (oSettings, oData) {
    - 714             var o;
    - 715 
    - 716             // Send an Ajax request to the server to get the data. Note that
    - 717             // this is a synchronous request.
    - 718             $.ajax( {
    - 719                 "url": "/state_load",
    - 720                 "async": false,
    - 721                 "dataType": "json",
    - 722                 "success": function (json) {
    - 723                     o = json;
    - 724                 }
    - 725             } );
    - 726             return o;
    - 727         }
    - 728     });
    - 729 });
    - 730 
    - 731 /*
    - 732  * fnStateLoadParams
    - 733  * 无默认值
    - 734  * 该回调可以用来在加载状态信息之前编辑状态信息
    - 735  * 函数在表格从存储的数据加载状态信息时调用,在表格<当前使用的设置对象>被<从保存信息中加载的设置对象>修改以前调用
    - 736  * 注意作为插件开发者,你应该使用'stateLoadParams'事件去加载plug-in的参数
    - 737  */
    - 738 // Remove a saved filter, so filtering is never loaded
    - 739 $(document).ready(function(){
    - 740     $('#example').dataTable({
    - 741         "bStateSave": true,
    - 742         "fnStateLoadParams": function (oSettings, oData) {
    - 743             oData.oFilter.sSearch = "";
    - 744         });
    - 745     });
    - 746 
    - 747 
    - 748 // Disallow state loading by returning false
    - 749 $(document).ready(function(){
    - 750     $('#example').dataTable({
    - 751         "bStateSave": true,
    - 752         "fnStateLoadParams": function (oSettings, oData) {
    - 753             return false;
    - 754         });
    - 755     });
    - 756 
    - 757 /*
    - 758  * fnStateLoaded
    - 759  * 无默认值
    - 760  * 在表格状态被状态存储方法读取和DataTable设置对象被修改时调用,作为被状态信息被加载的结果
    - 761  */
    - 762 // Show an alert with the filtering value that was saved
    - 763 $(document).ready(function(){
    - 764     $('#example').dataTable({
    - 765         "bStateSave": true,
    - 766         "fnStateLoaded": function (oSettings, oData) {
    - 767             alert( 'Saved filter was: '+oData.oFilter.sSearch );
    - 768         });
    - 769     });
    - 770 
    - 771 /*
    - 772  * fnStateSave
    - 773  * 无默认值
    - 774  * 保存表格状态,使用该函数你可以定义状态信息保存的位置和方式,默认情况下DataTable会保存在cookie中
    - 775  * 不过你或许希望使用本地存储(HTML5支持),或者服务端数据库
    - 776  */
    - 777 $(document).ready(function(){
    - 778     $('#example').dataTable({
    - 779         "bStateSave": true,
    - 780         "fnStateSave": function (oSettings, oData) {
    - 781             // Send an Ajax request to the server with the state object
    - 782             $.ajax( {
    - 783                 "url": "/state_save",
    - 784             "data": oData,
    - 785             "dataType": "json",
    - 786             "method": "POST"
    - 787                 "success": function () {}
    - 788             });
    - 789         }
    - 790     });
    - 791 });
    - 792 
    - 793 /*
    - 794  * fnStateSaveParams
    - 795  * 无默认值
    - 796  * 该回调允许你编辑被保存的状态信息,在表格改变了状态信息需要保存的时候调用
    - 797  * 可以使用该回调在保存状态信息的对象被保存以前对其进行修改,包括添加或者其它状态属性或者修改
    - 798  */
    - 799 // Remove a saved filter, so filtering is never saved
    - 800 $(document).ready(function(){
    - 801     $('#example').dataTable({
    - 802         "bStateSave": true,
    - 803         "fnStateLoadParams": function (oSettings, oData) {
    - 804             oData.oFilter.sSearch = "";
    - 805         });
    - 806     });
    - 807 /*------------------------------------------------Columns------------------------------------------------*/
    - 808 /*
    - 809  * aDataSort
    - 810  * 默认为null,自动使用列序号作为默认
    - 811  * 在排序一列的时候同时将其它几列也排序,例如名和姓作为多列排序
    - 812  */
    - 813 // Using aoColumnDefs
    - 814 $(document).ready(function(){
    - 815     $('#example').dataTable({
    - 816         "aoColumnDefs": [
    - 817     { "aDataSort": [ 0, 1 ], "aTargets": [ 0 ] },
    - 818         { "aDataSort": [ 1, 0 ], "aTargets": [ 1 ] },
    - 819         { "aDataSort": [ 2, 3, 4 ], "aTargets": [ 2 ] }
    - 820     ]
    - 821     });
    - 822 });
    - 823 
    - 824 
    - 825 // Using aoColumns
    - 826 $(document).ready(function(){
    - 827     $('#example').dataTable({
    - 828         "aoColumns": [
    - 829     { "aDataSort": [ 0, 1 ] },
    - 830         { "aDataSort": [ 1, 0 ] },
    - 831         { "aDataSort": [ 2, 3, 4 ] },
    - 832         null,
    - 833         null
    - 834         ]
    - 835     });
    - 836 });
    - 837 
    - 838 /*
    - 839  * asSorting
    - 840  * 默认为[ 'asc', 'desc' ] 
    - 841  * 你可以通过该参数控制默认排序的方向,甚至改变排序处理器的行为(例如:只允许升序排序)
    - 842  */
    - 843 // Using aoColumnDefs
    - 844 $(document).ready(function(){
    - 845     $('#example').dataTable({
    - 846         "aoColumnDefs": [
    - 847     { "asSorting": [ "asc" ], "aTargets": [ 1 ] },
    - 848         { "asSorting": [ "desc", "asc", "asc" ], "aTargets": [ 2 ] },
    - 849         { "asSorting": [ "desc" ], "aTargets": [ 3 ] }
    - 850     ]
    - 851     });
    - 852 });
    - 853 
    - 854 
    - 855 // Using aoColumns
    - 856 $(document).ready(function(){
    - 857     $('#example').dataTable( {
    - 858         "aoColumns": [
    - 859         null,
    - 860         { "asSorting": [ "asc" ] },
    - 861         { "asSorting": [ "desc", "asc", "asc" ] },
    - 862         { "asSorting": [ "desc" ] },
    - 863         null
    - 864         ]
    - 865     });
    - 866 });
    - 867 
    - 868 /*
    - 869  * bSearchable
    - 870  * 默认为true
    - 871  * 是否在列上应用过滤
    - 872  */
    - 873 // Using aoColumnDefs
    - 874 $(document).ready(function(){
    - 875     $('#example').dataTable({
    - 876         "aoColumnDefs": [
    - 877     { "bSearchable": false, "aTargets": [ 0 ] }
    - 878     ]} );
    - 879 });
    - 880 
    - 881 
    - 882 // Using aoColumns
    - 883 $(document).ready(function(){
    - 884     $('#example').dataTable({
    - 885         "aoColumns": [
    - 886     { "bSearchable": false },
    - 887         null,
    - 888         null,
    - 889         null,
    - 890         null
    - 891         ] });
    - 892 });
    - 893 
    - 894 /*
    - 895  * bSortable
    - 896  * 默认为true
    - 897  * 是否在某一列上开启排序
    - 898  */
    - 899 // Using aoColumnDefs
    - 900 $(document).ready(function(){
    - 901     $('#example').dataTable({
    - 902         "aoColumnDefs": [
    - 903     { "bSortable": false, "aTargets": [ 0 ] }
    - 904     ] });
    - 905 });
    - 906 
    - 907 
    - 908 // Using aoColumns
    - 909 $(document).ready(function(){
    - 910     $('#example').dataTable( {
    - 911         "aoColumns": [
    - 912     { "bSortable": false },
    - 913         null,
    - 914         null,
    - 915         null,
    - 916         null
    - 917         ] });
    - 918 });
    - 919 
    - 920 /*
    - 921  * bUseRendered
    - 922  * 默认为true
    - 923  * 当对一列使用使用fnRender时,你或许希望使用原始的数据(渲染以前)去排序或者过滤(默认是使用用户看到的渲染过的数据)
    - 924  * 或许对日期类型有些用处,注意,现在建议使用mDataProp作为函数并且使用该函数提供的type参数,来允许不同的数据被用来排序,过滤,展现和类型检测
    - 925  */
    - 926 // Using aoColumnDefs
    - 927 $(document).ready(function() {
    - 928     $('#example').dataTable( {
    - 929         "aoColumnDefs": [
    - 930     {
    - 931         "fnRender": function ( oObj ) {
    - 932             return oObj.aData[0] +' '+ oObj.aData[3];
    - 933         },
    - 934         "bUseRendered": false,
    - 935         "aTargets": [ 0 ]
    - 936     }
    - 937     ]
    - 938     } );
    - 939 } );
    - 940 
    - 941 // Using aoColumns
    - 942 $(document).ready(function() {
    - 943     $('#example').dataTable( {
    - 944         "aoColumns": [
    - 945     {
    - 946         "fnRender": function ( oObj ) {
    - 947             return oObj.aData[0] +' '+ oObj.aData[3];
    - 948         },
    - 949         "bUseRendered": false
    - 950     },
    - 951         null,
    - 952         null,
    - 953         null,
    - 954         null
    - 955         ]
    - 956     } );
    - 957 } );
    - 958 
    - 959 /*
    - 960  * bVisible
    - 961  * 默认值为true
    - 962  * 是否展示某一列
    - 963  */
    - 964 // Using aoColumnDefs
    - 965 $(document).ready(function() {
    - 966     $('#example').dataTable( {
    - 967         "aoColumnDefs": [
    - 968     { "bVisible": false, "aTargets": [ 0 ] }
    - 969     ] } );
    - 970 } );
    - 971 
    - 972 
    - 973 // Using aoColumns
    - 974 $(document).ready(function() {
    - 975     $('#example').dataTable( {
    - 976         "aoColumns": [
    - 977     { "bVisible": false },
    - 978         null,
    - 979         null,
    - 980         null,
    - 981         null
    - 982         ] } );
    - 983 } );
    - 984 
    - 985 /*
    - 986  * fnCreatedCell
    - 987  * 无默认值
    - 988  * 每当新的单元格被建立(Ajax源等)或者处理输入(DOM源)时,开发者可定义的函数会被调用
    - 989  * 该属性用作fnRender的补充来允许你修改在fnRender函数调用之后新建的DOM元素(例如增加背景颜色)
    - 990  */
    - 991 $(document).ready(function() {
    - 992     $('#example').dataTable( {
    - 993         "aoColumnDefs": [ {
    - 994             "aTargets": [3],
    - 995         "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
    - 996             if ( sData == "1.7" ) {
    - 997                 $(nTd).css('color', 'blue')
    - 998             }
    - 999         }
    -1000         } ]
    -1001     });
    -1002 } );
    -1003 
    -1004 /*
    -1005  * fnRender
    -1006  * 无默认值
    -1007  * 自定义列中每个单元格被展示的时候调用的展示函数
    -1008  */
    -1009 // Using aoColumnDefs
    -1010 $(document).ready(function() {
    -1011     $('#example').dataTable( {
    -1012         "aoColumnDefs": [
    -1013     {
    -1014         "fnRender": function ( o, val ) {
    -1015             return o.aData[0] +' '+ o.aData[3];
    -1016         },
    -1017         "aTargets": [ 0 ]
    -1018     }
    -1019     ]
    -1020     } );
    -1021 } );
    -1022 
    -1023 
    -1024 // Using aoColumns
    -1025 $(document).ready(function() {
    -1026     $('#example').dataTable( {
    -1027         "aoColumns": [
    -1028     { "fnRender": function ( o, val ) {
    -1029                                           return o.aData[0] +' '+ o.aData[3];
    -1030                                       } },
    -1031         null,
    -1032         null,
    -1033         null,
    -1034         null
    -1035         ]
    -1036     } );
    -1037 } );
    -1038 
    -1039 /*
    -1040  * iDataSort
    -1041  * 默认值为-1,使用自动计算的列标
    -1042  * 当选择该列进行排序的时候,你希望调用排序操作的列的列号,该参数可以用来按隐藏列排序
    -1043  */
    -1044 // Using aoColumnDefs
    -1045 $(document).ready(function() {
    -1046     $('#example').dataTable( {
    -1047         "aoColumnDefs": [
    -1048     { "iDataSort": 1, "aTargets": [ 0 ] }
    -1049     ]
    -1050     } );
    -1051 } );
    -1052 
    -1053 // Using aoColumns
    -1054 $(document).ready(function() {
    -1055     $('#example').dataTable( {
    -1056         "aoColumns": [
    -1057     { "iDataSort": 1 },
    -1058         null,
    -1059         null,
    -1060         null,
    -1061         null
    -1062         ]
    -1063     } );
    -1064 } );
    -1065 
    -1066 /*
    -1067  * mDataProp
    -1068  * 默认为null,使用自动计算的列标
    -1069  * 该属性可以从任何JSON格式数据源读取属性,包括深层网状的对象和属性,
    -1070  * 有几种不同的传递方式可以影响mDataProp的行为
    -1071  * 整型:被当作数据源的数组下表,是DataTable使用的默认行为(每列递增)
    -1072  * 字符串类型:被当作从数据源获取的对象的属性名,注意你可以使用Javascript点号访问符去访问深层次的属性或数组
    -1073  * null:sDafaultContent选项会被使用到单元格上,(默认是空字符串,当生成可编辑列、可删除列的时候可以使用该属性)
    -1074  * 函数:当表格获取或者设置单元格时被调用的函数,函数有三个参数
    -1075  *      {array|object}:该行的数据源
    -1076  *      {string}:调用数据请求的类型,设置数据时是'set',收集数据时是'filter','display','type','sort'
    -1077  *      {*}:当第二个参数是set的时候,要被设置的数据
    -1078  *      当类型是'set'的时候,该函数不需要返回一个值,除此之外,返回值是可以用来请求数据的
    -1079  */
    -1080 // Read table data from objects
    -1081 $(document).ready(function() {
    -1082     var oTable = $('#example').dataTable( {
    -1083         "sAjaxSource": "sources/deep.txt",
    -1084         "aoColumns": [
    -1085     { "mDataProp": "engine" },
    -1086         { "mDataProp": "browser" },
    -1087         { "mDataProp": "platform.inner" },
    -1088         { "mDataProp": "platform.details.0" },
    -1089         { "mDataProp": "platform.details.1" }
    -1090     ]
    -1091     } );
    -1092 } );
    -1093 
    -1094 
    -1095 // Using mDataProp as a function to provide different information for
    -1096 // sorting, filtering and display. In this case, currency (price)
    -1097 $(document).ready(function() {
    -1098     var oTable = $('#example').dataTable( {
    -1099         "aoColumnDefs": [
    -1100     {
    -1101         "aTargets": [ 0 ],
    -1102         "mDataProp": function ( source, type, val ) {
    -1103             if (type === 'set') {
    -1104                 source.price = val;
    -1105                 // Store the computed dislay and filter values for efficiency
    -1106                 source.price_display = val=="" ? "" : "$"+numberFormat(val);
    -1107                 source.price_filter  = val=="" ? "" : "$"+numberFormat(val)+" "+val;
    -1108                 return;
    -1109             }
    -1110             else if (type === 'display') {
    -1111                 return source.price_display;
    -1112             }
    -1113             else if (type === 'filter') {
    -1114                 return source.price_filter;
    -1115             }
    -1116     // 'sort' and 'type' both just use the integer
    -1117     return source.price;
    -1118         }
    -1119     ]
    -1120     } );
    -1121     } );
    -1122 
    -1123 /*
    -1124  * sClass
    -1125  * 默认值为空字符串
    -1126  * 该列的每一个单元格被赋予的class
    -1127  */
    -1128 // Using aoColumnDefs
    -1129 $(document).ready(function() {
    -1130     $('#example').dataTable( {
    -1131         "aoColumnDefs": [
    -1132     { "sClass": "my_class", "aTargets": [ 0 ] }
    -1133     ]
    -1134     } );
    -1135 } );
    -1136 
    -1137 // Using aoColumns
    -1138 $(document).ready(function() {
    -1139     $('#example').dataTable( {
    -1140         "aoColumns": [
    -1141     { "sClass": "my_class" },
    -1142         null,
    -1143         null,
    -1144         null,
    -1145         null
    -1146         ]
    -1147     } );
    -1148 } );
    -1149 
    -1150 /*
    -1151  * sContentPadding
    -1152  * 默认值为空字符串
    -1153  * 当DataTable计算分配给每一列的列宽的时候,会寻找每一列中最长的字符串,然后构建一个临时表
    -1154  * 从临时表中读取宽度,这样带来的问题是'mmm'会比'iiii'的长度长很多,但是后者的长度要大
    -1155  * 这样计算值会出现偏差(正确的处理然后放入DOM对象再测量长度会相当的慢),我们提供了这个选项作为一个解决方法
    -1156  * 它会把他的值添加到该列最长的值的后面来计算列宽,通常你不需要该属性,该属性也没有被写到DataTables.net的文档中
    -1157  */
    -1158 // Using aoColumns
    -1159 $(document).ready(function() {
    -1160   $('#example').dataTable( {
    -1161     "aoColumns": [
    -1162       null,
    -1163       null,
    -1164       null,
    -1165       {
    -1166         "sContentPadding": "mmm"
    -1167       }
    -1168     ]
    -1169   } );
    -1170 } );
    -1171 
    -1172 /*
    -1173  * sDefaultContent
    -1174  * 默认为空字符串
    -1175  * 允许给列值一个默认值,只要发现null值就会显示默认值
    -1176  * 可以由mDataProp设置为null或者数据源是null引起
    -1177  */
    -1178 // Using aoColumnDefs
    -1179 $(document).ready(function() {
    -1180     $('#example').dataTable( {
    -1181         "aoColumnDefs": [
    -1182     {
    -1183         "mDataProp": null,
    -1184         "sDefaultContent": "Edit",
    -1185         "aTargets": [ -1 ]
    -1186     }
    -1187     ]
    -1188     } );
    -1189 } );
    -1190 
    -1191 
    -1192 // Using aoColumns
    -1193 $(document).ready(function() {
    -1194     $('#example').dataTable( {
    -1195         "aoColumns": [
    -1196         null,
    -1197         null,
    -1198         null,
    -1199         {
    -1200             "mDataProp": null,
    -1201         "sDefaultContent": "Edit"
    -1202         }
    -1203     ]
    -1204     } );
    -1205 } );
    -1206 
    -1207 /*
    -1208  * sName
    -1209  * 默认值为空字符串
    -1210  * 该参数只有使用在服务器端处理的时候调用,在了解客户端展示了哪些列的时候十分有用
    -1211  * 然后与数据库字段建立映射,当被定义时,如果服务器端返回的信息的顺序不是期望的顺序,也可以使用名字去区分
    -1212  * 使用这种方式的好处是:用户在客户端交换了列,你的服务器端代码不用更新
    -1213  */
    -1214 // Using aoColumnDefs
    -1215 $(document).ready(function() {
    -1216     $('#example').dataTable( {
    -1217         "aoColumnDefs": [
    -1218     { "sName": "engine", "aTargets": [ 0 ] },
    -1219         { "sName": "browser", "aTargets": [ 1 ] },
    -1220         { "sName": "platform", "aTargets": [ 2 ] },
    -1221         { "sName": "version", "aTargets": [ 3 ] },
    -1222         { "sName": "grade", "aTargets": [ 4 ] }
    -1223     ]
    -1224     } );
    -1225 } );
    -1226 
    -1227 
    -1228 // Using aoColumns
    -1229 $(document).ready(function() {
    -1230     $('#example').dataTable( {
    -1231         "aoColumns": [
    -1232     { "sName": "engine" },
    -1233         { "sName": "browser" },
    -1234         { "sName": "platform" },
    -1235         { "sName": "version" },
    -1236         { "sName": "grade" }
    -1237     ]
    -1238     } );
    -1239 } );
    -1240 
    -1241 /*
    -1242  * sSortDataType
    -1243  * 默认值为std
    -1244  * 为排序操作定义可以用来在排序前读取实时表格信息(更新内部缓存版本)的数据源的类型
    -1245  * 允许排序事件发生在用户可编辑的元素上,例如输入框
    -1246  */
    -1247 // Using aoColumnDefs
    -1248 $(document).ready(function() {
    -1249     $('#example').dataTable( {
    -1250         "aoColumnDefs": [
    -1251     { "sSortDataType": "dom-text", "aTargets": [ 2, 3 ] },
    -1252         { "sType": "numeric", "aTargets": [ 3 ] },
    -1253         { "sSortDataType": "dom-select", "aTargets": [ 4 ] },
    -1254         { "sSortDataType": "dom-checkbox", "aTargets": [ 5 ] }
    -1255     ]
    -1256     } );
    -1257 } );
    -1258 
    -1259 
    -1260 // Using aoColumns
    -1261 $(document).ready(function() {
    -1262     $('#example').dataTable( {
    -1263         "aoColumns": [
    -1264         null,
    -1265         null,
    -1266         { "sSortDataType": "dom-text" },
    -1267         { "sSortDataType": "dom-text", "sType": "numeric" },
    -1268         { "sSortDataType": "dom-select" },
    -1269         { "sSortDataType": "dom-checkbox" }
    -1270     ]
    -1271     } );
    -1272 } );
    -1273 
    -1274 /*
    -1275  * sTitle
    -1276  * 默认值为null,从TH标签读取
    -1277  * 列名
    -1278  */
    -1279 // Using aoColumnDefs
    -1280 $(document).ready(function() {
    -1281     $('#example').dataTable( {
    -1282         "aoColumnDefs": [
    -1283     { "sTitle": "My column title", "aTargets": [ 0 ] }
    -1284     ]
    -1285     } );
    -1286 } );
    -1287 
    -1288 
    -1289 // Using aoColumns
    -1290 $(document).ready(function() {
    -1291     $('#example').dataTable( {
    -1292         "aoColumns": [
    -1293     { "sTitle": "My column title" },
    -1294         null,
    -1295         null,
    -1296         null,
    -1297         null
    -1298         ]
    -1299     } );
    -1300 } );
    -1301 
    -1302 /*
    -1303  * sType
    -1304  * 默认值为null,从弱引用数据中自动判断
    -1305  * 允许你指定该列数据按什么类型来排序,目前有四种类型(字符串,数字,日期和html(在排序前会自动除去HTML标记))可选
    -1306  * 注意只有能够被Javascript的Date对象接受的格式化日期字符串才会被当作日期类型接受,例如"Mar 26, 2008 5:03 PM"
    -1307  * 默认是使用html类型,更多类型可以通过插件添加
    -1308  */
    -1309 // Using aoColumnDefs
    -1310 $(document).ready(function() {
    -1311     $('#example').dataTable( {
    -1312         "aoColumnDefs": [
    -1313     { "sType": "html", "aTargets": [ 0 ] }
    -1314     ]
    -1315     } );
    -1316 } );
    -1317 
    -1318 
    -1319 // Using aoColumns
    -1320 $(document).ready(function() {
    -1321     $('#example').dataTable( {
    -1322         "aoColumns": [
    -1323     { "sType": "html" },
    -1324         null,
    -1325         null,
    -1326         null,
    -1327         null
    -1328         ]
    -1329     } );
    -1330 } );
    -1331 
    -1332 /*
    -1333  * sWidth
    -1334  * 默认值为null,自动的
    -1335  * 定义列的宽度,该参数可以接受CSS定义(3em,20px等),DataTable对没有通过该接口指定宽度的列使用灵活宽度
    -1336  * 从而保证表格是可被读的
    -1337  */
    -1338 // Using aoColumnDefs
    -1339 $(document).ready(function() {
    -1340     $('#example').dataTable( {
    -1341         "aoColumnDefs": [
    -1342     { "sWidth": "20%", "aTargets": [ 0 ] }
    -1343     ]
    -1344     } );
    -1345 } );
    -1346 
    -1347 
    -1348 // Using aoColumns
    -1349 $(document).ready(function() {
    -1350     $('#example').dataTable( {
    -1351         "aoColumns": [
    -1352     { "sWidth": "20%" },
    -1353         null,
    -1354         null,
    -1355         null,
    -1356         null
    -1357         ]
    -1358     } );
    -1359 } );
    -1360 /*------------------------------------------------ServerSide------------------------------------------------*/
    -1361 /*
    -1362  * bServerSide
    -1363  * 默认值false
    -1364  * 配置使用服务器端处理的DataTable,注意sAjaxSource参数必须指定,以便给DataTable一个获取每行数据的数据源
    -1365  */
    -1366 $(document).ready( function () {
    -1367     $('#example').dataTable( {
    -1368         "bServerSide": true,
    -1369         "sAjaxSource": "xhr.php"
    -1370     } );
    -1371 } );
    -1372 /*
    -1373  * fnServerData
    -1374  * 无默认值
    -1375  * 你可以使用该参数重写从服务器获取数据的方法($.getJSON),从而使其更适合你的应用
    -1376  * 例如你可以使用POST方式提交,或者从Google Gears或者AIR数据库获取数据
    -1377  */
    -1378 // POST data to server
    -1379 $(document).ready(function() {
    -1380     $('#example').dataTable( {
    -1381         "bProcessing": true,
    -1382         "bServerSide": true,
    -1383         "sAjaxSource": "xhr.php",
    -1384         "fnServerData": function ( sSource, aoData, fnCallback ) {
    -1385             $.ajax( {
    -1386                 "dataType": 'json',
    -1387             "type": "POST",
    -1388             "url": sSource,
    -1389             "data": aoData,
    -1390             "success": fnCallback
    -1391             } );
    -1392         }
    -1393     } );
    -1394 } );
    -1395 /*
    -1396  * fnServerParams
    -1397  * 无默认值
    -1398  * 用来在向服务器发送Ajax请求时发送额外的数据,例如自定义的过滤信息,该函数使向服务器发送额外参数变得简单
    -1399  * 传递进来的参数是DataTable建立的数据集合,你可以根据需要添加或者修改该集合
    -1400  */
    -1401 $(document).ready(function() {
    -1402     $('#example').dataTable( {
    -1403         "bProcessing": true,
    -1404         "bServerSide": true,
    -1405         "sAjaxSource": "scripts/server_processing.php",
    -1406         "fnServerParams": function ( aoData ) {
    -1407             aoData.push( { "name": "more_data", "value": "my_value" } );
    -1408         }
    -1409     } );
    -1410 } );
    -1411 /*
    -1412  * sAjaxDataProp
    -1413  * 默认为aaData
    -1414  * 当使用Ajax数据源或者服务器端处理的时候,DataTable会默认搜索aaData属性作为数据源
    -1415  * 该选项允许变更数据源的名称,你可以使用JavaScript的点号对象表示法去访问多级网状数据源
    -1416  */
    -1417 // Get data from { "data": [...] }
    -1418 $(document).ready(function() {
    -1419     var oTable = $('#example').dataTable( {
    -1420         "sAjaxSource": "sources/data.txt",
    -1421         "sAjaxDataProp": "data"
    -1422     } );
    -1423 } );
    -1424 
    -1425 
    -1426 // Get data from { "data": { "inner": [...] } }
    -1427 $(document).ready(function() {
    -1428     var oTable = $('#example').dataTable( {
    -1429         "sAjaxSource": "sources/data.txt",
    -1430         "sAjaxDataProp": "data.inner"
    -1431     } );
    -1432 } );
    -1433 /*
    -1434  * sAjaxSource
    -1435  * 默认为null
    -1436  * 该参数用来向DataTable指定加载的外部数据源(如果想使用现有的数据,请使用aData)
    -1437  * 可以简单的提供一个可以用来获得数据url或者JSON对象,该对象必须包含aaData,作为表格的数据源
    -1438  */
    -1439 $(document).ready(function(){
    -1440   $('#example').dataTable( {
    -1441     "sAjaxSource": "http://www.sprymedia.co.uk/dataTables/json.php"
    -1442   });
    -1443 })
    -1444 /*
    -1445  * sServerMethod
    -1446  * 默认值为GET
    -1447  * 设置使用Ajax方式调用的服务器端的处理方法或者Ajax数据源的HTTP请求方式
    -1448  */
    -1449 $(document).ready(function(){
    -1450     $('#example').dataTable({
    -1451         "bServerSide": true,
    -1452         "sAjaxSource": "scripts/post.php",
    -1453         "sServerMethod": "POST"
    -1454     });
    -1455 });
    -
    - - diff --git a/posts.html b/posts.html index c709aa2..d21b817 100644 --- a/posts.html +++ b/posts.html @@ -5,7 +5,7 @@ group: navigation index: 1 --- -{% include codepiano/setup %} +{% include site/setup %} @@ -14,5 +14,5 @@ {% assign posts_list = site.posts %} - {% include codepiano/posts_table %} + {% include site/posts_table %}
    diff --git a/timeline.html b/timeline.html index 8d96d61..492cb0c 100644 --- a/timeline.html +++ b/timeline.html @@ -5,16 +5,16 @@ group: navigation index: 2 --- -{% include codepiano/setup %} +{% include site/setup %}
    {% assign posts_list = site.posts %} - {% include codepiano/timeline %} + {% include site/timeline %}
    From 205c240f318dec8c4cdd39c991b68548759ecfd9 Mon Sep 17 00:00:00 2001 From: codepiano Date: Tue, 10 Dec 2013 21:25:25 +0800 Subject: [PATCH 2/5] clean for new user --- _includes/site/analytics | 14 ++ _includes/site/analytics-providers/google | 11 + _includes/site/anchor_of_categories | 11 + _includes/site/comments | 10 + _includes/site/comments-providers/disqus | 14 ++ _includes/site/liquid_raw | 6 + _includes/site/navigation_list | 10 + _includes/site/post_categories_info | 14 ++ _includes/site/posts_of_category | 15 ++ _includes/site/posts_table | 12 + _includes/site/setup | 22 ++ _includes/site/sharing | 8 + _includes/site/tags_list | 10 + _includes/site/time_list | 14 ++ _includes/site/timeline | 36 +++ css/site.css | 292 ++++++++++++++++++++++ js/site.js | 84 +++++++ 17 files changed, 583 insertions(+) create mode 100644 _includes/site/analytics create mode 100644 _includes/site/analytics-providers/google create mode 100644 _includes/site/anchor_of_categories create mode 100644 _includes/site/comments create mode 100644 _includes/site/comments-providers/disqus create mode 100644 _includes/site/liquid_raw create mode 100644 _includes/site/navigation_list create mode 100644 _includes/site/post_categories_info create mode 100644 _includes/site/posts_of_category create mode 100644 _includes/site/posts_table create mode 100644 _includes/site/setup create mode 100644 _includes/site/sharing create mode 100644 _includes/site/tags_list create mode 100644 _includes/site/time_list create mode 100644 _includes/site/timeline create mode 100644 css/site.css create mode 100644 js/site.js diff --git a/_includes/site/analytics b/_includes/site/analytics new file mode 100644 index 0000000..b458f86 --- /dev/null +++ b/_includes/site/analytics @@ -0,0 +1,14 @@ +{% if site.safe and site.site.analytics.provider and page.site.analytics != false %} + +{% case site.site.analytics.provider %} +{% when "google" %} + {% include site/analytics-providers/google %} +{% when "getclicky" %} + {% include site/analytics-providers/getclicky %} +{% when "mixpanel" %} + {% include site/analytics-providers/mixpanel %} +{% when "custom" %} + {% include custom/analytics %} +{% endcase %} + +{% endif %} diff --git a/_includes/site/analytics-providers/google b/_includes/site/analytics-providers/google new file mode 100644 index 0000000..bac880b --- /dev/null +++ b/_includes/site/analytics-providers/google @@ -0,0 +1,11 @@ + diff --git a/_includes/site/anchor_of_categories b/_includes/site/anchor_of_categories new file mode 100644 index 0000000..93b0847 --- /dev/null +++ b/_includes/site/anchor_of_categories @@ -0,0 +1,11 @@ +{% comment %} categories.html页面中的锚点列表 {% endcomment %} + +{% for category in site_categories %} +
  • + + {{ category[0] | join: "/" }} + +
  • +{% endfor %} + +{% assign site_categories = nil %} diff --git a/_includes/site/comments b/_includes/site/comments new file mode 100644 index 0000000..237d6dc --- /dev/null +++ b/_includes/site/comments @@ -0,0 +1,10 @@ +{% if site.site.comments.provider and page.comments != false %} + +{% case site.site.comments.provider %} +{% when "disqus" %} + {% include site/comments-providers/disqus %} +{% when "custom" %} + {% include custom/comments %} +{% endcase %} + +{% endif %} diff --git a/_includes/site/comments-providers/disqus b/_includes/site/comments-providers/disqus new file mode 100644 index 0000000..654c234 --- /dev/null +++ b/_includes/site/comments-providers/disqus @@ -0,0 +1,14 @@ +
    + + +blog comments powered by Disqus diff --git a/_includes/site/liquid_raw b/_includes/site/liquid_raw new file mode 100644 index 0000000..3852627 --- /dev/null +++ b/_includes/site/liquid_raw @@ -0,0 +1,6 @@ +{% if site.site.liquid_raw.provider == "custom" %} + {% include custom/liquid_raw %} +{% else %} +
    {{text | replace:"|.", "{" | replace:".|", "}" | replace:">", ">" | replace:"<", "<" }}
    +{% endif %} +{% assign text = nil %} diff --git a/_includes/site/navigation_list b/_includes/site/navigation_list new file mode 100644 index 0000000..1e3f819 --- /dev/null +++ b/_includes/site/navigation_list @@ -0,0 +1,10 @@ +{% comment %} index.html页面中的导航 {% endcomment %} +{% assign color_hack = 'posts timeline categories about' %} +{% assign current_nav = page.url | remove:'/' | remove:'.html' %} +{% assign color_hack = color_hack | replace:{{current_nav}},'active' %} +{% assign color_hack = color_hack | split:' ' %} + +
  • 文章
  • +
  • 归档
  • +
  • 目录
  • +
  • 关于
  • diff --git a/_includes/site/post_categories_info b/_includes/site/post_categories_info new file mode 100644 index 0000000..dce087d --- /dev/null +++ b/_includes/site/post_categories_info @@ -0,0 +1,14 @@ +{% comment %} 主页中生成post的categories信息 {% endcomment %} +{% for category in post_categories %} +
  • + + {{ category | join: "/" }} + +
  • + {% unless forloop.last %} +
  • + +
  • + {% endunless %} +{% endfor %} +{% assign post_categories = nil %} diff --git a/_includes/site/posts_of_category b/_includes/site/posts_of_category new file mode 100644 index 0000000..a705a42 --- /dev/null +++ b/_includes/site/posts_of_category @@ -0,0 +1,15 @@ +{% comment %} categories.html页面中的div内容 {% endcomment %} + +{% for post in posts_list %} + {% if post.title != null %} +
  • + + {{ post.title }} + + + {{ post.date | date: " %Y 年 %m 月 %d 日" }} + +
  • + {% endif %} +{% endfor %} +{% assign posts_list = nil %} diff --git a/_includes/site/posts_table b/_includes/site/posts_table new file mode 100644 index 0000000..a859817 --- /dev/null +++ b/_includes/site/posts_table @@ -0,0 +1,12 @@ +{% comment %} posts.html页面table中的tr {% endcomment %} +{% for post in posts_list %} + + {{ post.date | date: "%Y 年 %m 月 %d 日" }} + + {{ post.title }} + + {{ post.tags | join:', ' }} + +{% endfor %} + +{% assign posts_list = nil %} diff --git a/_includes/site/setup b/_includes/site/setup new file mode 100644 index 0000000..9abc1e5 --- /dev/null +++ b/_includes/site/setup @@ -0,0 +1,22 @@ +{% capture jbcache %} + + {% if site.site.setup.provider == "custom" %} + {% include custom/setup %} + {% else %} + {% if site.safe and site.site.BASE_PATH and site.site.BASE_PATH != '' %} + {% assign BASE_PATH = site.site.BASE_PATH %} + {% assign HOME_PATH = site.site.BASE_PATH %} + {% else %} + {% assign BASE_PATH = nil %} + {% assign HOME_PATH = "/" %} + {% endif %} + + {% if site.site.ASSET_PATH %} + {% assign ASSET_PATH = site.site.ASSET_PATH %} + {% else %} + {% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ page.theme.name }}{% endcapture %} + {% endif %} + {% endif %} +{% endcapture %}{% assign jbcache = nil %} diff --git a/_includes/site/sharing b/_includes/site/sharing new file mode 100644 index 0000000..d2a4f85 --- /dev/null +++ b/_includes/site/sharing @@ -0,0 +1,8 @@ +{% if site.safe and site.site.sharing.provider and page.site.sharing != false %} + +{% case site.site.sharing.provider %} +{% when "custom" %} + {% include custom/sharing %} +{% endcase %} + +{% endif %} diff --git a/_includes/site/tags_list b/_includes/site/tags_list new file mode 100644 index 0000000..a35b1ad --- /dev/null +++ b/_includes/site/tags_list @@ -0,0 +1,10 @@ +{% if tags_list.first[0] == null %} + {% for tag in tags_list %} +
  • {{ tag }} {{ site.tags[tag].size }}
  • + {% endfor %} +{% else %} + {% for tag in tags_list %} +
  • {{ tag[0] }} {{ tag[1].size }}
  • + {% endfor %} +{% endif %} +{% assign tags_list = nil %} diff --git a/_includes/site/time_list b/_includes/site/time_list new file mode 100644 index 0000000..bfcf0fa --- /dev/null +++ b/_includes/site/time_list @@ -0,0 +1,14 @@ +{% comment %} timeline.html页面中的时间锚点 {% endcomment %} + +{% for post in posts_list %} + {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% capture this_month %}{{ post.date | date: "%m" }}{% endcapture %} + {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} + {% capture next_month %}{{ post.previous.date | date: "%m" }}{% endcapture %} + + {% if this_year != next_year or this_month != next_month %} +
  •   {{ this_year }} 年 {{ this_month }} 月
  • + {% endif %} + +{% endfor %} + diff --git a/_includes/site/timeline b/_includes/site/timeline new file mode 100644 index 0000000..c74132e --- /dev/null +++ b/_includes/site/timeline @@ -0,0 +1,36 @@ +{% comment %} timeline.html页面中的文章链接 {% endcomment %} + +{% for post in posts_list %} + {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% capture this_month %}{{ post.date | date: "%m" }}{% endcapture %} + {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} + {% capture next_month %}{{ post.previous.date | date: "%m" }}{% endcapture %} + + {% if forloop.first %} +
    +

    {{ this_year }} 年 {{ this_month }} 月

    +
      + {% endif %} + +
    • + + {{ post.title }} + + + {{ post.categories | join:' / ' }} + +
    • + + {% if forloop.last %} +
    +
    + {% else %} + {% if this_year != next_year or this_month != next_month %} + +

    +
    +

    {{ next_year }} 年 {{ next_month }} 月

    +
      + {% endif %} + {% endif %} +{% endfor %} diff --git a/css/site.css b/css/site.css new file mode 100644 index 0000000..f9f9ee2 --- /dev/null +++ b/css/site.css @@ -0,0 +1,292 @@ + +@charset "utf-8"; + +/* a标签样式 */ +a { + text-decoration: none; +} + +a:link { + color: #1077BC; +} + +a:hover { + color: #FF9900; + text-decoration: none; +} + +a:active { + color: #FF6699; + text-decoration: none; +} + +a:visited { + color: #FF6699; +} + +/* 主页中央区域 */ +html, body, div.wrapper { + height: 100%; + background-color: #F3F3F3; +} + +/* 段落样式 */ +.paragraph { + font-size: 15px; + text-indent: 2em; +} + +/* font-awesome post信息按钮样式 */ +.icon-folder-open, .icon-tags, .icon-calendar { + color:#A84365; +} + +.icon-double-angle-right { + color: #FF6699; +} + +/* 自定义高亮样式 */ +.highlight pre,code { + font-size: 15px; + background-color: #002B36; + color:#93A1A1; +} + +blockquote { + font-size: 15px; + background-color: #002B36; + color:#93A1A1; +} + +blockquote p { + font-size: 15px; +} +/* 覆盖bootstrap导航条设置 */ +a.brand { + height: auto; +} + +.navbar ul.nav { + padding: 15px 20px 15px; + height:auto; +} + +.navbar>.navbar-inner{ + padding-left: 0px; + padding-right: 0px; + border-left: none; + border-right: none; +} + +/* 覆盖导航条激活菜单的背景色设置 */ +.navbar .nav>.active>a, .navbar .nav>.active>a:hover, .navbar .nav>.active>a:focus { + background-color: transparent; + box-shadow:none; +} + +.navbar .nav>li.active>a { + color:#EC6197; +} + +/* 覆盖typo.css中ul默认的margin-left属性 */ +ul.tag_box { + margin-left: 0; +} + +ul.tag_box > li:first-child { + padding-left: 0px; +} + +/* 标题栏文字样式 */ +.site-title { + font-size: 14px; + color: #1B813F; +} + +.site-author { + font-size: 28px; + color: #169FDE; +} + +/* 底部div定位 */ +div.wrapper>div.typo{ + padding-bottom: 60px; +} + +/* 底栏div样式 */ +div.bottom { + position: relative; + margin-top: -60px; + height: 60px; + clear: both; +} + +/* 底栏声明链接样式 */ +a.license { + color:#5E6087; +} + +/* 解决typo.css覆盖bootstrap的li.list-style */ +ul.nav.nav-tabs { + list-style: none; +} + +/* 技术支持列表样式 */ +ul#support { + margin-top: 20px; +} + +.dispear { + border-color: #F3F3F3; +} + +ul#support.dispear>li { + display:none; +} + +ul#support.dispear>li:first-child { + display:block; +} + +ul#support.dispear>li>a { + border-color: #F3F3F3; + color: #F3F3F3; +} + +ul#support.dispear>li>a:hover { + background-color: transparent; +} + + +ul#support.dispear>li:first-child>a:hover { + color: #CC527A; +} + +ul#support.dispear>li:first-child>a>i.icon-star-empty { + color: #F3F3F3; +} + +ul#support.dispear>li:first-child>a:hover>i.icon-star-empty { + color: #E8175D; +} + +#support.show a { + color: #CC527A; +} + +.icon-ok, .icon-star-empty { + color: #E8175D; +} + +ul#support.show { + border-color: #F3F3F3; +} + +ul#support.show li { + display:block; +} + +ul#support.show a { + border-color: #DDDDDD; + color:#CC527A; +} + +/* 文章日期样式 */ +.post-date { + color: #1077BC; +} + +/* Datatable设置,应用bootstrap样式 */ +table#post-data { + border-spacing:0; + border-collapse:collapse; +} + +table#post-data td, table#post-data th { + color: #1077BC; +} + +table#post-data .icon-calendar, table#post-data .icon-bookmark, table#post-data .icon-tags { + color: #1077BC; +} + +table#post-data a:hover { + color: #FF6699; +} + +div.row { + margin-left: 0px; +} + +/* 覆盖bootstrap默认的tooltip设置 */ +div.tooltip.right .tooltip-arrow { + border-right-color: #1693A7; +} + +div.tooltip-inner { + font-size: 14px; + color: #F3F3F3; + background-color: #1693A7; +} + +/* 归档和时间线页面列表样式 */ +ul.posts-list { + list-style: none; + position: relative; +} + +ul.posts-list li{ + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: #D9D7D4; + margin-top: 9px; + padding-bottom: 5px; + font-size: 14px; +} + +a.post-url { + font-size: 16px; + margin-left: 2px; +} + +span.post-right-info { + right: 0px; + position: absolute; + font-size: 16px; + color: #BBBBBB; +} + + +/* 时间锚点的样式 */ +ul.time-list { + margin-top: 10px; +} + +ul.time-list a { + font-size: 14px; + color: #FF6699; +} + +ul.time-list a>i.icon-chevron-right{ + color: #F3F3F3; +} + +ul.time-list>li.active>a>i.icon-chevron-right { + color: #333333; +} + +/* about样式 */ +p.about { + text-indent: 2em; + font-size: 18px; +} + +/* 链接table样式 */ +table#about-me td{ + font-size: 18px; + padding:7px; +} + +table#about-me a{ + color: #1077BC; +} diff --git a/js/site.js b/js/site.js new file mode 100644 index 0000000..fdd8ad7 --- /dev/null +++ b/js/site.js @@ -0,0 +1,84 @@ +/* 页面加载后执行 */ +!function ($) { + $(function(){ + + var tableReference; + /* 初始化dataTable */ + if($('#post-data')[0]){ + tableReference = $('#post-data').dataTable(datatablesConfig); + } + /* 初始化tooltip */ + if($('#support a')[0]){ + $('#support a').tooltip(tooltipConfig); + } + + /* 目录页导航 */ + var url = window.location.href; + if(url.indexOf('categories.html') > -1){ + $('#categories-nav a').click(function (e){ + $(this).tab('show'); + }) + + /* 自动打开链接中的锚点 */ + var matches = url.match(/categories\.html(#.*)/); + if(matches){ + $('#categories-nav a[href="' + matches[1] + '"]').tab('show'); + }else{ + $('#categories-nav a:first').tab('show'); + } + } + + /* 自动根据标签过滤table */ + if(url.indexOf('posts.html') > -1){ + var matches = url.match(/posts\.html#(.*)/); + if(matches && tableReference){ + tableReference.fnFilter(matches[1],2); + } + + $('#post-data_filter input').val(matches[1]) + + $("#post-data_filter input").keyup( function () { + tableReference.fnFilter('', 2); + tableReference.fnFilter( this.value, 2); + } ); + } + }); + +}(window.jQuery); + +/* 切换技术支持列表的样式 */ +function toggleSupport(){ + $('#support').toggleClass('dispear').toggleClass('show'); + return false; +} + +/* datatables设置 */ +datatablesConfig = { + "aaSorting": [[ 0, "desc" ],[ 1, "asc" ],[ 2, "asc" ]], + "sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>", + "sWrapper": "dataTables_wrapper form-inline", + "sPaginationType": "bootstrap", + "oLanguage":{ + "sProcessing": "处理中...", + "sLengthMenu": "显示 _MENU_ 篇文章", + "sZeroRecords": "没有匹配文章", + "sInfo": "显示第 _START_ 至 _END_ 篇文章,共 _TOTAL_ 篇", + "sInfoEmpty": "显示第 0 至 0 篇文章,共 0 项", + "sInfoFiltered": "(由 _MAX_ 篇文章过滤)", + "sInfoPostFix": "", + "sSearch": "检索:", + "sUrl": "", + "oPaginate": { + "sFirst": "首页", + "sPrevious": "上页", + "sNext": "下页", + "sLast": "末页" + } + } +} + +/* tooltip设置 */ +tooltipConfig = { + "placement": "right", + "delay": { show: 200, hide: 100 } +} From 066cb91c112553a1fccfe178505bedee68d261cf Mon Sep 17 00:00:00 2001 From: codepiano Date: Wed, 11 Dec 2013 12:04:17 +0800 Subject: [PATCH 3/5] complete the clean branch,add example and introduce --- _config.yml | 18 +++++++++--------- _posts/2013-12-11-test.md | 24 ++++++++++++++++++++++++ about.html | 12 ++++++------ index.html | 2 +- 4 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 _posts/2013-12-11-test.md diff --git a/_config.yml b/_config.yml index 2509213..8fe0c5f 100644 --- a/_config.yml +++ b/_config.yml @@ -7,13 +7,13 @@ pygments: true paginate: 4 # 修改为自己的配置 -title : 隐匿于黑夜中的星 -tagline: 时间的回响,思维的残影 +title : _config.yml中的title设置 +tagline: author : - name : site - email : anyexingchen999@qq.com - github : https://github.com/site - twitter : http://twitter.com/anyexingchen + name : _config.yml中的author.name + email : + github : + twitter : # The production_url is only used when full-domain names are needed # such as sitemap.txt @@ -24,7 +24,7 @@ author : # Finally if you are pushing to a GitHub project page, include the project name at the end. # # 博客地址,如果没有自定义CNAME,写用户名即可 -production_url : http://blog.site.com +production_url : 你的github用户名 # All Jekyll-Bootstrap specific configurations are namespaced into this hash # 我使用我的id作为了这个属性的属性名 @@ -84,7 +84,7 @@ site : comments : provider : disqus disqus : - short_name : site + short_name : 你的disque账户名 # Settings for analytics helper # Set 'provider' to the analytics provider you want to use. @@ -94,7 +94,7 @@ site : analytics : provider : google google : - tracking_id : 'UA-40934298-1' + tracking_id : '' # Settings for sharing helper. # Sharing is for things like tweet, plusone, like, reddit buttons etc. diff --git a/_posts/2013-12-11-test.md b/_posts/2013-12-11-test.md new file mode 100644 index 0000000..11916b7 --- /dev/null +++ b/_posts/2013-12-11-test.md @@ -0,0 +1,24 @@ +--- +layout: post +keywords: test +description: test +title: "test" +categories: [test] +tags: [test] +group: archive +icon: file-alt +--- +{% include site/setup %} + +测试博客 +======== + +欢迎使用 +-------- + +如果你能看到本页面,说明博客已经可以正常使用,enjoy yourself. + +引用 女流氓.exe 的一句话 "今后的路,我希望你能自己好好走下去,而我,坐车。" + +希望你从这里开始 [BetterExplained]为什么你应该(从现在开始就)写博客 + diff --git a/about.html b/about.html index a41a4a6..f3f831b 100644 --- a/about.html +++ b/about.html @@ -11,7 +11,7 @@

      关于

      - 爱看书的程序员 + about.html中的p标签

      链接 @@ -20,23 +20,23 @@

      我的github - site · GitHub + about.html中的GitHub 我的知乎 - site - 知乎 + about.html中的知乎 我的微博 - site - 新浪微博 + about.html中的新浪微博 我的豆瓣 - site - 豆瓣 + about.html中的豆瓣 我的邮箱 - site · Gmail + about.html中的Gmail diff --git a/index.html b/index.html index 5fec0bf..0a6c2fb 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,6 @@ --- layout: index -title: site +title: index.html中的title属性 --- {% include site/setup %} From 79583806e3f007ec5e26d6e3fffbfaa01a4c7253 Mon Sep 17 00:00:00 2001 From: codepiano Date: Mon, 14 Jul 2014 10:08:53 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dclean=E5=88=86=E6=94=AF?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _includes/themes/twitter/post.html | 2 +- categories.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/themes/twitter/post.html b/_includes/themes/twitter/post.html index 18360e4..bc6f36f 100644 --- a/_includes/themes/twitter/post.html +++ b/_includes/themes/twitter/post.html @@ -32,7 +32,7 @@

      {{ page.title }} {% if page.tagline %}{{page.tagline}}{% endi {% else %} {% endif %} -
    • 索引
    • +
    • 索引
    • {% if page.next %} {% else %} diff --git a/categories.html b/categories.html index d05eea4..9e964cc 100644 --- a/categories.html +++ b/categories.html @@ -5,7 +5,7 @@ group: navigation index: 3 --- -{% include codepiano/setup %} +{% include site/setup %}
      - {% endunless %} + {% endunless %}
      {{ content }} @@ -23,7 +23,7 @@

      {{ page.title }} {% if page.tagline %}{{page.tagline}}{% endi {% assign tags_list = page.tags %} {% include site/tags_list %}

    - {% endunless %} + {% endunless %}