annotate vendor/vim-packs/ctrlp.vim/doc/ctrlp.cnx @ 725:0a896ffe3029

Switch to tgz bsdunzip doesn't seem to unzip from stdin.
author nanaya <me@nanaya.net>
date Mon, 19 Aug 2024 17:03:52 +0900
parents 4576f1471f53
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
707
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1 *ctrlp.txt* 支持模糊匹配的 文件, 缓冲区, 最近最多使用, 标签, ... 检索. v1.80
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
2 *CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
3 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
4 # #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
5 # :::::::: ::::::::::: ::::::::: ::: ::::::::: #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
6 # :+: :+: :+: :+: :+: :+: :+: :+: #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
7 # +:+ +:+ +:+ +:+ +:+ +:+ +:+ #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
8 # +#+ +#+ +#++:++#: +#+ +#++:++#+ #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
9 # +#+ +#+ +#+ +#+ +#+ +#+ #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
10 # #+# #+# #+# #+# #+# #+# #+# #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
11 # ######## ### ### ### ########## ### #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
12 # #
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
13 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
14 名词对照(译注)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
15
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
16 buffer:缓冲区 mapping:按键绑定
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
17 mru:最近最多使用 prompt:提示符面板
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
18 tag:标签 tab:页签
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
19 tab:制表符
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
20
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
21 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
22 内容 *ctrlp-content*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
23
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
24 1. 介绍.............................................|ctrlp-intro|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
25 2. 选项.............................................|ctrlp-options|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
26 3. 命令.............................................|ctrlp-commands|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
27 4. 按键绑定.........................................|ctrlp-mappings|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
28 5. 输入格式.........................................|ctrlp-input-formats|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
29 6. 扩展.............................................|ctrlp-extensions|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
30
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
31 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
32 介绍 *ctrlp-intro*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
33
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
34 带有直观接口的全路径模糊文件, 缓冲区, 最近最多使用, 标签, ... 检索。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
35 使用纯净的Vimscript编写,可以运行在MacVim,gVim和版本号7.0以上的Vim中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
36 全面支持Vim的正则表达式 |regexp| 作为搜索模式,内建最近最多使用文件监测,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
37 项目根目录定位和更多特性。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
38
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
39 开启可选的扩展(标记,目录,rtscript...),参考 |ctrlp-extensions| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
40
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
41 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
42 OPTIONS *ctrlp-options*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
43
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
44 总览:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
45
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
46 |loaded_ctrlp|................禁用插件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
47 |ctrlp_map|...................默认按键绑定。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
48 |ctrlp_cmd|...................默认按键绑定调用的命令。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
49 |ctrlp_by_filename|...........是否默认开启文件名模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
50 |ctrlp_regexp|................是否默认开启正则表达式模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
51 |ctrlp_match_window|..........匹配窗口的显示位置。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
52 |ctrlp_switch_buffer|.........如果文件已在缓冲区中打开,跳转到该打开的缓冲区。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
53 |ctrlp_reuse_window|..........重用特殊窗口(帮助、快速修复 |quickfix| ,等等)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
54 |ctrlp_tabpage_position|......新标签页出现的位置。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
55 |ctrlp_working_path_mode|.....如何设置CtrlP的本地工作目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
56 |ctrlp_root_markers|..........额外的,高优先级的根目录标识。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
57 |ctrlp_use_caching|...........针对每个会话,设置是否开启缓存的。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
58 |ctrlp_clear_cache_on_exit|...退出Vim后是否保留缓存。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
59 |ctrlp_cache_dir|.............缓存目录的位置。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
60 |ctrlp_show_hidden|...........是否显示隐藏文件和隐藏文件夹。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
61 |ctrlp_custom_ignore|.........使用 |globpath()| 时自定义忽略的文件或目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
62 |ctrlp_max_files|.............扫描文件的最大数目。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
63 |ctrlp_max_depth|.............扫描目录的最大层数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
64 |ctrlp_user_command|..........使用外部的扫描工具。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
65 |ctrlp_max_history|...........历史提示符面板中保留的最大条目数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
66 |ctrlp_open_new_file|.........由<c-y>创建的文件的打开方式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
67 |ctrlp_open_multiple_files|...由<c-z>选择的文件的打开方式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
68 |ctrlp_arg_map|...............是否拦截<c-y> 和 <c-o> 命令。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
69 |ctrlp_follow_symlinks|.......是否跟随链接。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
70 |ctrlp_lazy_update|...........停止输入时才更新。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
71 |ctrlp_default_input|.........为提示符面板提供一个初始字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
72 |ctrlp_abbrev|................输入缩写。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
73 |ctrlp_key_loop|..............为多字节输入开启输入事件循环。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
74 |ctrlp_prompt_mappings|.......改变提示符面板内部的按键绑定。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
75 |ctrlp_line_prefix|...........ctrlp 窗口中为每一行添加前缀。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
76 |ctrlp_open_single_match|.....当只有一个候选时自动接受。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
77 |ctrlp_brief_prompt|..........提示符为空的时候使用<bs>退出 CtrlP。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
78 |ctrlp_match_current_file|....在匹配条目中包含当前文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
79 |ctrlp_types|.................內建类型的名称。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
80
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
81 最近最多使用模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
82 |ctrlp_mruf_max|..............记录的最近最多使用的最大数据。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
83 |ctrlp_mruf_exclude|..........需要被排除的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
84 |ctrlp_mruf_include|..........需要被记录的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
85 |ctrlp_mruf_relative|.........只显示在工作目录内的最近最多使用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
86 |ctrlp_tilde_homedir|.........保存 home 目录中的 MRU 的目录路径为波浪扩展的形式 ~/。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
87 |ctrlp_mruf_default_order|....禁用排序。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
88 |ctrlp_mruf_case_sensitive|...最近最多使用文件是否大小写敏感。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
89 |ctrlp_mruf_save_on_update|...只要有一个新的条目添加,就保存到磁盘。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
90
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
91 缓冲模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
92 |ctrlp_bufname_mod|...........文件名部分修饰符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
93 |ctrlp_bufpath_mod|...........文件路径部分修饰符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
94
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
95 缓冲标签模式: (开启此模式,参考 |ctrlp-extensions| )
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
96 |g:ctrlp_buftag_ctags_bin|....兼容的ctags二进制程序的位置。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
97 |g:ctrlp_buftag_systemenc|....ctags命令的编码。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
98 |g:ctrlp_buftag_types|........添加新的文件类型和设置命令行参数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
99
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
100 高级选项:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
101 |ctrlp_open_func|.............使用自定义的打开文件的函数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
102 |ctrlp_status_func|...........改变CtrlP的两个状态栏
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
103 |ctrlp_buffer_func|...........在CtrlP的缓冲区内调用自定义的函数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
104 |ctrlp_match_func|............替换内建的匹配算法。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
105
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
106 -------------------------------------------------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
107 详细描述和默认值:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
108
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
109 *'g:ctrlp_map'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
110 使用该选项来改变普通模式 |Normal| 下调用CtrlP的按键绑定: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
111 let g:ctrlp_map = '<c-p>'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
112 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
113
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
114 *'g:ctrlp_cmd'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
115
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
116 设置当按下上面的按键绑定时,使用的默认打开命令: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
117 let g:ctrlp_cmd = 'CtrlP'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
118 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
119
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
120 *'g:loaded_ctrlp'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
121 使用该选项完全禁用插件: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
122 let g:loaded_ctrlp = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
123 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
124
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
125 *'g:ctrlp_by_filename'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
126 修改该选项为1,设置默认为按文件名搜索(否则为全路径): >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
127 let g:ctrlp_by_filename = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
128 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
129 在提示符面板内可以使用 <c-d> 来切换。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
130
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
131 *'g:ctrlp_regexp'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
132 修改该选项为1,设置默认为使用正则表达式匹配。: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
133 let g:ctrlp_regexp = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
134 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
135 在提示符面板内可以使用 <c-r> 来切换。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
136
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
137 *'g:ctrlp_match_window'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
138 改变匹配窗口的位置,结果的排列顺序,最小和最大高度: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
139 let g:ctrlp_match_window = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
140 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
141 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
142 let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:10,results:10'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
143 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
144 位置: (默认:底部)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
145 top - 在屏幕顶部显示匹配窗口。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
146 bottom - 在屏幕底部显示匹配窗口。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
147
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
148 结果的排列顺序: (默认: btt)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
149 order:ttb - 从顶部到底部。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
150 order:btt - 从底部到顶部。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
151
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
152 最小和最大高度:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
153 min:{n} - 最少显示 {n} 行 (默认: 1).
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
154 max:{n} - 最多显示 {n} 行 (默认: 10).
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
155
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
156 结果集的最大数目:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
157 results:{n} - 列出最多 {n} 条结果 (默认: 和最大高度同步).
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
158 0代表没有限制。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
159
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
160 注意: 当一个设置项没有被设置时,将会使用默认值。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
161
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
162 *'g:ctrlp_switch_buffer'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
163 当尝试打开一个文件时,如果它已经在某个窗口被打开,CtrlP会尝试跳到那个窗口,而
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
164 不是新打开一个实例。: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
165 let g:ctrlp_switch_buffer = 'Et'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
166 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
167 e - 当 <cr> 被按下时跳转,但是只跳转到当前页签内的窗口内。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
168 t - 当 <c-t> 被按下时跳转, 但是只跳转到其它标签的窗口内。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
169 v - 类似 "e", 但是当 <c-v> 被按下时跳转。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
170 h - 类似 "e", 但是当 <c-x> 被按下时跳转。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
171 E, T, V, H - 行为类似 "e", "t", "v", and "h", 但是跳转到任何地方的窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
172 0 或者 <empty> - 禁用这项功能。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
173
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
174 *'g:ctrlp_reuse_window'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
175 当使用 <cr> 打开新文件时,CtrlP避免在插件,帮助,快速修复创建的窗口中打开该文
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
176 件。使用该选项来设置一些例外: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
177 let g:ctrlp_reuse_window = 'netrw'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
178 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
179 接受的值可以为特殊缓冲区的名字的一部分,文件类型或者缓冲区类型使用正则表达式来
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
180 指定匹配模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
181 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
182 let g:ctrlp_reuse_window = 'netrw\|help\|quickfix'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
183 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
184
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
185 *'g:ctrlp_tabpage_position'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
186 新打开页签的位置: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
187 let g:ctrlp_tabpage_position = 'ac'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
188 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
189 a - 后面。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
190 b - 前面。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
191 c - 当前页签。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
192 l - 最后一个页签。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
193 f - 第一个页签。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
194
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
195 *'g:ctrlp_working_path_mode'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
196 当启动时,CtrlP依据这个变量来设置它的工作目录: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
197 let g:ctrlp_working_path_mode = 'ra'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
198 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
199 c - 当前文件所在的目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
200 a - 当前文件所在的目录,除非这个目录为当前工作目录的子目录
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
201 r - 包含下列文件或者目录的最近的祖先目录:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
202 .git .hg .svn .bzr _darcs
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
203 w - 用来修饰r:使用当前工作目录而不是当前文件所在目录进行查找
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
204 0 或者 <empty> - 禁用这项功能。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
205
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
206 注意 #1: 如果 "a" 或者 "c" 和 "r"一起被包含,当无法找到根目录时使用 "a" 或者
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
207 "c" 的行为(作为备选)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
208
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
209 注意 #2: 你可以在每个缓冲区内使用 |b:var| 来设置该选项。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
210
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
211 *'g:ctrlp_root_markers'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
212 使用该选项来设置自定义的根目录标记作为对默认标记(.hg, .svn, .bzr, and _darcs)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
213 的补充。自定义的标记具有优先权: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
214 let g:ctrlp_root_markers = ['']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
215 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
216 注意: 你可以在每个缓冲区内使用 |b:var| 来设置该选项。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
217
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
218 *'g:ctrlp_use_caching'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
219 启用/禁用每个会话的缓存: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
220 let g:ctrlp_use_caching = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
221 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
222 0 - 禁用缓存。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
223 1 - 启用缓存。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
224 n - 当大于1时,禁用缓存,使用该数值作为重新启用缓存的限制条件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
225
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
226 注意: 当在CtrlP中时你可以使用 <F5> 来快速的清除缓存。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
227
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
228 *'g:ctrlp_clear_cache_on_exit'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
229 设置该选项为0通过退出Vim时不删除缓存文件来启用跨会话的缓存: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
230 let g:ctrlp_clear_cache_on_exit = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
231 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
232
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
233 *'g:ctrlp_cache_dir'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
234 设置存储缓存文件的目录: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
235 let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
236 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
237
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
238 *'g:ctrlp_show_hidden'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
239 如果你想CtrlP扫描隐藏文件和目录,设置该选项为1: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
240 let g:ctrlp_show_hidden = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
241 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
242 注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
243
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
244 *'g:ctrlp_custom_ignore'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
245 除了 |g:ctrlp_show_hidden|,你可以用这个选项设置你想在CtrlP中隐藏的文件和目录。使用正
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
246 则表达式来指定匹配模式: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
247 let g:ctrlp_custom_ignore = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
248 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
249 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
250 let g:ctrlp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
251 let g:ctrlp_custom_ignore = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
252 \ 'dir': '\v[\/]\.(git|hg|svn)$',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
253 \ 'file': '\v\.(exe|so|dll)$',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
254 \ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
255 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
256 let g:ctrlp_custom_ignore = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
257 \ 'file': '\v(\.cpp|\.h|\.hh|\.cxx)@<!$'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
258 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
259 let g:ctrlp_custom_ignore = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
260 \ 'func': 'some#custom#match_function'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
261 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
262 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
263 注意 #1: |g:ctrlp_custom_ignore| 在已经使用 |g:ctrlp_user_command| 的时候不会生效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
264
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
265 注意 #2: 当改变选项的变量类型时,记得先 |:unlet| ,或者重启Vim来避免这个错误:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
266 "E706: Variable type mismatch" 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
267
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
268 注意 #3: 当使用函数来忽略类型时,你必须提供CtrlP可以调用的函数的全名。建议使用
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
269 自动加载的函数。函数必须接受两个参数,要匹配的条目和接受的类型,类型可以是目
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
270 录、文件和链接。如果条目被忽略,函数需要返回1,反之,返回0。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
271
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
272 注意 #4: 如果设置 |g:ctrlp_use_readdir| 为0,你可以使用 Vim 的 |'wildignore'|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
273 来将文件和目录排除出搜索结果。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
274
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
275 *'g:ctrlp_max_files'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
276 扫描文件的最大数量,设置为0时不进行限制: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
277 let g:ctrlp_max_files = 10000
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
278 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
279 注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
280
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
281 *'g:ctrlp_max_depth'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
282 目录树递归的最大层数: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
283 let g:ctrlp_max_depth = 40
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
284 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
285 注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
286
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
287 *'g:ctrlp_user_command'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
288 指定用来代替Vim的 |globpath()| 的外部工具来列出文件,使用 %s 代表目标目录: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
289 let g:ctrlp_user_command = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
290 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
291 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
292 let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
293 let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
294 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
295 你也可以使用 'grep', 'findstr' 或者其它东西来过滤结果集。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
296 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
297 let g:ctrlp_user_command =
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
298 \ 'find %s -type f | grep -v -P "\.jpg$|/tmp/"' " MacOSX/Linux
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
299 let g:ctrlp_user_command =
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
300 \ 'dir %s /-n /b /s /a-d | findstr /v /l ".jpg \\tmp\\"' " Windows
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
301 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
302 在扫描一个大型项目时,在仓库目录中使用版本控制系统的列出命令会加快扫描速度: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
303 let g:ctrlp_user_command = [root_marker, listing_command, fallback_command]
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
304 let g:ctrlp_user_command = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
305 \ 'types': {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
306 \ 1: [root_marker_1, listing_command_1],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
307 \ n: [root_marker_n, listing_command_n],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
308 \ },
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
309 \ 'fallback': fallback_command,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
310 \ 'ignore': 0 or 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
311 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
312 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
313 一些例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
314 " 单个版本控制系统,列出命令不会列出没有被追踪的文件:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
315 let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
316 let g:ctrlp_user_command = ['.hg', 'hg --cwd %s locate -I .']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
317
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
318 " 多个版本控制系统:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
319 let g:ctrlp_user_command = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
320 \ 'types': {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
321 \ 1: ['.git', 'cd %s && git ls-files'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
322 \ 2: ['.hg', 'hg --cwd %s locate -I .'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
323 \ },
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
324 \ 'fallback': 'find %s -type f'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
325 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
326
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
327 " 单个版本控制系统,列出命令列出没有被追踪的文件(较慢):
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
328 let g:ctrlp_user_command =
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
329 \ ['.git', 'cd %s && git ls-files -co --exclude-standard']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
330
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
331 let g:ctrlp_user_command =
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
332 \ ['.hg', 'hg --cwd %s status -numac -I . $(hg root)'] " MacOSX/Linux
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
333
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
334 let g:ctrlp_user_command = ['.hg', 'for /f "tokens=1" %%a in (''hg root'') '
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
335 \ . 'do hg --cwd %s status -numac -I . %%a'] " Windows
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
336 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
337 注意 #1: 在 |Dictionary| 格式, 'fallback' 和 'ignore' 是可选的,在 |List| 格式,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
338 备选命令是可选的。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
339
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
340 注意 #2: 如果备选命令是空的或者属性 'fallback' 没有定义,当扫描仓库之外目录时,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
341 |globpath()| 会被使用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
342
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
343 注意 #3: 除非使用了 |Dictionary| 格式并且 'ignore' 被定义并且设置为1,当这些自
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
344 定义的命令被使用时 |wildignore| 和 |g:ctrlp_custom_ignore| 选项不会生效。没有出现
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
345 时,'ignore' 被默认设置为0来保留使用外部命令的性能优势。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
346
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
347 注意 #4: 当改变了选项的变量类型时,记得先 |:unlet| ,或者重启Vim来避免这个错误:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
348 "E706: Variable type mismatch" 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
349
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
350 注意 #5: 你可以在每个缓冲区内使用 |b:var| 来设置该选项。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
351
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
352 *'g:ctrlp_max_history'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
353 你希望CtrlP记录的用户输入历史的最大数目。默认值是Vim的全局选项 |'history'| : >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
354 let g:ctrlp_max_history = &history
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
355 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
356 设置为0来禁用提示符面板的历史。使用 <c-n> 和 <c-p> 来浏览历史。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
357
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
358 *'g:ctrlp_open_new_file'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
359 使用该选项指定当使用 <c-y> 打开新建的文件时,文件的打开方式: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
360 let g:ctrlp_open_new_file = 'v'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
361 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
362 t - 在新页签中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
363 h - 在新的水平分割窗口。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
364 v - 在新的竖直分割窗口。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
365 r - 在当前窗口。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
366
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
367 *'g:ctrlp_open_multiple_files'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
368 如果非0, 会启用使用 <c-z> 和 <c-o> 打开多个文件: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
369 let g:ctrlp_open_multiple_files = 'v'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
370 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
371 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
372 let g:ctrlp_open_multiple_files = '2vjr'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
373 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
374 对于数字:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
375 - 如果指定,会被用来作为打开文件时创建的窗口或者页签的最大数量(剩余的会在隐
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
376 藏的缓冲区中打开)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
377 - 如果没有指定,<c-o> 会打开所有文件,每个在一个新的窗口或者页签中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
378
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
379 对于字母:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
380 t - 每个文件在一个新页签中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
381 h - 每个文件在一个新的水平分割窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
382 v - 每个文件在一个新的竖直分割窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
383 i - 所有的文件在隐藏的缓冲区中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
384 j - 打开以后,跳转到第一个打开的页签或者窗口。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
385 r - 在当前窗口打开第一个文件,其他文件根据同时出现的"h","v"和"t"中的一个,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
386 在新的分割窗口或者页签中打开。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
387
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
388 *'g:ctrlp_arg_map'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
389 当设置为1时, <c-o> 和 <c-y> 会接收一个额外的键值作为参数,来覆盖默认行为: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
390 let g:ctrlp_arg_map = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
391 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
392 按下 <c-o> 或者 <c-y> 会提示一次按键。按键可以是:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
393 t - 在新标签页中打开。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
394 h - 每个文件在一个新的水平分割窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
395 v - 每个文件在一个新的竖直分割窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
396 i - 所有的文件在隐藏的缓冲区中(只有 <c-o> 生效)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
397 c - 清楚标记的文件(只有 <c-o> 生效)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
398 r - 在当前窗口中打开(只有 <c-y> 生效)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
399 <esc>, <c-c>, <c-u> - 取消并且回到提示符面板。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
400 <cr> - 使用 |g:ctrlp_open_new_file| 和 |g:ctrlp_open_multiple_files| 指定的默
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
401 认行为。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
402
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
403
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
404 *'g:ctrlp_follow_symlinks'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
405 如果非0,当列出文件时CtrlP会跟随链接: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
406 let g:ctrlp_follow_symlinks = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
407 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
408 0 - 不要跟随链接。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
409 1 - 跟随但是忽略内部循环的链接,避免重复。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
410 2 - 无差别的跟随所有链接。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
411
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
412 注意: 当命令使用 |g:ctrlp_user_command| 定义时该选项无效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
413
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
414 *'g:ctrlp_lazy_update'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
415 设置为1将或更大可开启延迟更新特性:只在输入停止一个确定的时间后才更新匹配窗口:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
416 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
417 let g:ctrlp_lazy_update = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
418 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
419 如果设置为1,在250毫秒后更新該值作為默認值。如果大于1,数字会被作为延迟时间使
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
420 用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
421
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
422 *'g:ctrlp_default_input'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
423 设置为1将为提示符面板提供当前文件的相对路径作为种子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
424 let g:ctrlp_default_input = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
425 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
426 如果不指定1或0,如果选项的值是字符串,会被用来作为默认输入: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
427 let g:ctrlp_default_input = 'anystring'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
428 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
429 这个选项可以和 |g:ctrlp_open_single_match| 配合使用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
430
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
431
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
432 *'g:ctrlp_match_current_file'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
433 在匹配条目中包含当前文件: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
434 let g:ctrlp_match_current_file = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
435
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
436 默认情况下,当前文件不包含在列表中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
437
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
438 注意: 当使用 |g:ctrlp_match_func| 时不会应用这个选项。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
439
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
440 *'g:ctrlp_types'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
441 通过设置这个列表变量的值来定制核心类型: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
442 let g:ctrlp_types = ['mru', 'fil']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
443
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
444 类型默认为: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
445 let g:ctrlp_types = ['fil', 'buf', 'mru'].
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
446
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
447 *'g:ctrlp_abbrev'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
448 定义可以在提示面包内被扩展(内部的或者可见的)的输入缩写: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
449 let g:ctrlp_abbrev = {}
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
450 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
451 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
452 let g:ctrlp_abbrev = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
453 \ 'gmode': 'i',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
454 \ 'abbrevs': [
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
455 \ {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
456 \ 'pattern': '^cd b',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
457 \ 'expanded': '@cd ~/.vim/bundle',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
458 \ 'mode': 'pfrz',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
459 \ },
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
460 \ {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
461 \ 'pattern': '\(^@.\+\|\\\@<!:.\+\)\@<! ',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
462 \ 'expanded': '.\{-}',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
463 \ 'mode': 'pfr',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
464 \ },
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
465 \ {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
466 \ 'pattern': '\\\@<!:.\+\zs\\\@<! ',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
467 \ 'expanded': '\ ',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
468 \ 'mode': 'pfz',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
469 \ },
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
470 \ ]
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
471 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
472 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
473 字符串 'pattern' 是使用正则表达式来匹配输入的匹配模式。扩展后就像扩展后的字符串
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
474 在提示符面板中被输入了一样。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
475
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
476 对于 'gmode' (可选的):
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
477 i - 内部扩展(默认)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
478 t - 插入扩展结果到提示符面板,就像你自己输入的一样。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
479 k - 当非关键字的字符被输入时,插入扩展结果到提示符面板。只在"t"也出现时生效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
480
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
481 对于 'mode' (对于每个条目,可选的):
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
482 f - 只应用于文件名模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
483 p - 只应用于全路径模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
484 r - 只应用于正则表达式模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
485 z - 只应用于模糊模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
486 n - 只应用于使用 <c-y> 创建新文件时(使用扩展后的字符串作为文件名)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
487 c - 当使用 <tab> 自动补全目录名时(在自动补全之前立即扩展模式)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
488 <empty> 或者未定义 - 总是启用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
489
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
490 注意: 缩写条目按顺序求值,后求值的条目会覆盖先求值的条目;当 'gmode' 为"t"时,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
491 包括他自己。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
492
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
493 *'g:ctrlp_key_loop'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
494 一个实验性的特性。设置该选项为1将为多字节字符开启输入事件循环: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
495 let g:ctrlp_key_loop = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
496 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
497 注意 #1: 当设置时,该选项会重置 |g:ctrlp_lazy_update| 选项。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
498
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
499 注意 #2: 你可以在提示符面板使用自定义的按键绑定切换这个特性: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
500 let g:ctrlp_prompt_mappings = { 'ToggleKeyLoop()': ['<F3>'] }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
501 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
502
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
503 *'g:ctrlp_prompt_mappings'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
504 使用该选项来自定义CtrlP的提示窗口内的按键绑定为你喜欢的方式。你只需要保留你改
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
505 变值(在[]内部)的行: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
506 let g:ctrlp_prompt_mappings = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
507 \ 'PrtBS()': ['<bs>', '<c-]>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
508 \ 'PrtDelete()': ['<del>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
509 \ 'PrtDeleteWord()': ['<c-w>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
510 \ 'PrtClear()': ['<c-u>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
511 \ 'PrtSelectMove("j")': ['<c-j>', '<down>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
512 \ 'PrtSelectMove("k")': ['<c-k>', '<up>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
513 \ 'PrtSelectMove("t")': ['<Home>', '<kHome>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
514 \ 'PrtSelectMove("b")': ['<End>', '<kEnd>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
515 \ 'PrtSelectMove("u")': ['<PageUp>', '<kPageUp>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
516 \ 'PrtSelectMove("d")': ['<PageDown>', '<kPageDown>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
517 \ 'PrtHistory(-1)': ['<c-n>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
518 \ 'PrtHistory(1)': ['<c-p>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
519 \ 'AcceptSelection("e")': ['<cr>', '<2-LeftMouse>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
520 \ 'AcceptSelection("h")': ['<c-x>', '<c-cr>', '<c-s>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
521 \ 'AcceptSelection("t")': ['<c-t>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
522 \ 'AcceptSelection("v")': ['<c-v>', '<RightMouse>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
523 \ 'ToggleFocus()': ['<s-tab>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
524 \ 'ToggleRegex()': ['<c-r>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
525 \ 'ToggleByFname()': ['<c-d>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
526 \ 'ToggleType(1)': ['<c-f>', '<c-up>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
527 \ 'ToggleType(-1)': ['<c-b>', '<c-down>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
528 \ 'PrtExpandDir()': ['<tab>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
529 \ 'PrtInsert("c")': ['<MiddleMouse>', '<insert>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
530 \ 'PrtInsert()': ['<c-\>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
531 \ 'PrtCurStart()': ['<c-a>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
532 \ 'PrtCurEnd()': ['<c-e>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
533 \ 'PrtCurLeft()': ['<c-h>', '<left>', '<c-^>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
534 \ 'PrtCurRight()': ['<c-l>', '<right>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
535 \ 'PrtClearCache()': ['<F5>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
536 \ 'PrtDeleteEnt()': ['<F7>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
537 \ 'CreateNewFile()': ['<c-y>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
538 \ 'MarkToOpen()': ['<c-z>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
539 \ 'OpenMulti()': ['<c-o>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
540 \ 'PrtExit()': ['<esc>', '<c-c>', '<c-g>'],
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
541 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
542 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
543 注意: 如果按 <bs> 后光标向左移动一个字符而不是删除一个字符,在你的.vimrc中添加
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
544 下面的设置来禁用插件默认的 <c-h> 绑定: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
545 let g:ctrlp_prompt_mappings = { 'PrtCurLeft()': ['<left>', '<c-^>'] }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
546 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
547
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
548 *'g:ctrlp_line_prefix'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
549 这个前缀会被加到ctrlp的条目列表中每一行的前面。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
550 默认值: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
551 let g:ctrlp_line_prefix = '> '
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
552 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
553
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
554 *'g:ctrlp_open_single_match'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
555 当CtrlP处于列表中配置的模式中时,如果只有一个候选条目,CtrlP会直接接受该条目。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
556 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
557 let g:ctrlp_open_single_match = ['buffer tags', 'buffer']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
558 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
559 目前这个选项的作用是和 |g:ctrlp_default_input| 一起,使用类似下面的函数,在使用
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
560 前设置,使用完后还原: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
561 fu! <SID>tagsUnderCursor()
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
562 try
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
563 let default_input_save = get(g:, 'ctrlp_default_input', '')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
564 let g:ctrlp_default_input = expand('<cword>')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
565 CtrlPBufTagAll
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
566 finally
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
567 if exists('default_input_save')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
568 let g:ctrlp_default_input = default_input_save
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
569 endif
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
570 endtry
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
571 endfu
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
572 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
573 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
574 ----------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
575 MRU mode options:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
576
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
577 *'g:ctrlp_mruf_max'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
578 指定你希望CtrlP记录的最近打开的文件历史的数目: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
579 let g:ctrlp_mruf_max = 250
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
580 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
581
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
582 *'g:ctrlp_mruf_exclude'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
583 你不希望CtrlP记录的文件。使用正则表达式来指定模式: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
584 let g:ctrlp_mruf_exclude = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
585 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
586 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
587 let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
588 let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
589 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
590
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
591 *'g:ctrlp_mruf_include'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
592 如果你想让CtrlP只记录某些文件,在这里指定: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
593 let g:ctrlp_mruf_include = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
594 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
595 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
596 let g:ctrlp_mruf_include = '\.py$\|\.rb$'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
597 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
598 *'g:ctrlp_tilde_homedir'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
599 将这个选项设置为1来把所有的 MRU 文件路径中 $HOME 目录下的 $HOME/$filepath 保存
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
600 为 ~/$filepath ,而不是 $HOME/$filepath : >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
601 let g:ctrlp_tilde_homedir = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
602 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
603 注意: 对所有通过 :CtrlPBookmarkDirAdd! 保存的也有效
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
604
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
605 *'g:ctrlp_mruf_relative'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
606 设置该选项为1将只显示在当前工作目录内的最近最多使用文件: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
607 let g:ctrlp_mruf_relative = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
608 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
609 注意: 你可以在提示符面板使用自定义的按键绑定切换这个特性: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
610 let g:ctrlp_prompt_mappings = { 'ToggleMRURelative()': ['<F2>'] }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
611 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
612
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
613 *'g:ctrlp_mruf_default_order'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
614 设置该选项为1将在最近最多使用模式搜索时禁用排序: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
615 let g:ctrlp_mruf_default_order = 0
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
616 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
617
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
618 *'g:ctrlp_mruf_case_sensitive'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
619 将该选项和你的文件系统大小写敏感性保持一致来避免重复的最近最多使用条目: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
620 let g:ctrlp_mruf_case_sensitive = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
621 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
622
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
623 *'g:ctrlp_mruf_save_on_update'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
624 设置该选项为 0 禁止 CtrlP 每当有一个新条目增加就把最近最多使用列表保存到磁盘
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
625 文件,而是在退出Vim时才保存: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
626 let g:ctrlp_mruf_save_on_update = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
627 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
628 *'g:ctrlp_bufname_mod'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
629 根据修饰符修改文件名部分。参见 |filename-modifiers| 。 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
630 let g:ctrlp_bufname_mod = ':t'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
631 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
632 *'g:ctrlp_bufpath_mod'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
633 根据修饰符修改文件路径部分。参见 |filename-modifiers| 。 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
634 let g:ctrlp_bufpath_mod = ':~:.:h'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
635 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
636 ----------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
637 高级选项:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
638
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
639 *'g:ctrlp_open_func'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
640 使用一个自定义函数来打开选定的文件: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
641 let g:ctrlp_open_func = {}
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
642 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
643 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
644 let g:ctrlp_open_func = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
645 \ 'files' : 'Function_Name_1',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
646 \ 'buffers' : 'Function_Name_2',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
647 \ 'mru files' : 'Function_Name_3',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
648 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
649 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
650 函数结构: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
651 function! Function_Name(action, line)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
652 " 参数:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
653 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
654 " +- a:action : 打开的动作:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
655 " | + 'e' : 用户按下 <cr> (默认)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
656 " | + 'h' : 用户按下 <c-x> (默认)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
657 " | + 'v' : 用户按下 <c-v> (默认)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
658 " | + 't' : 用户按下 <c-t> (默认)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
659 " | + 'x' : 用户使用 <c-o> 终端对话框 (默认) 选择"e[x]ternal"。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
660 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
661 " +- a:line : 选择的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
662
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
663 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
664 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
665 注意: 当使用<c-z> 和 <c-o>打开多个文件时无效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
666
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
667 例子: 当 <c-t> 被按下时在默认浏览器中打开HTML文件,否则在Vim中打开 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
668 function! HTMLOpenFunc(action, line)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
669 if a:action =~ '^[tx]$' && fnamemodify(a:line, ':e') =~? '^html\?$'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
670
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
671 " 获取文件名
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
672 let filename = fnameescape(fnamemodify(a:line, ':p'))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
673
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
674 " 关闭CtrlP
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
675 call ctrlp#exit()
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
676
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
677 " 打开文件
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
678 silent! execute '!xdg-open' filename
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
679
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
680 elseif a:action == 'x' && fnamemodify(a:line, ':e') !~? '^html\?$'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
681
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
682 " 不是HTML文件,再次模拟 <c-o> 按键并且等待新的输入
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
683 call feedkeys("\<c-o>")
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
684
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
685 else
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
686
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
687 " 使用CtrlP的默认的打开文件的函数
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
688 call call('ctrlp#acceptfile', [a:action, a:line])
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
689
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
690 endif
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
691 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
692
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
693 let g:ctrlp_open_func = { 'files': 'HTMLOpenFunc' }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
694 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
695
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
696 *'g:ctrlp_status_func'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
697 为CtrlP窗口使用自定义的状态栏: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
698 let g:ctrlp_status_func = {}
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
699 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
700 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
701 let g:ctrlp_status_func = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
702 \ 'main': 'Function_Name_1',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
703 \ 'prog': 'Function_Name_2',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
704 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
705 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
706 函数结构: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
707 " 主状态栏
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
708 function! Function_Name_1(focus, byfname, regex, prev, item, next, marked)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
709 " 参数:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
710 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
711 " +- a:focus : 提示符面板的焦点: "prt" 或者 "win"。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
712 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
713 " +- a:byfname : 在文件名模式还是全路径模式: "file" 或者 "path"。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
714 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
715 " +- a:regex : 是否在正则表达式模式: 1 or 0。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
716 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
717 " +- a:prev : 前一个搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
718 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
719 " +- a:item : 当前的搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
720 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
721 " +- a:next : 下一个搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
722 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
723 " +- a:marked : 被标记文件的数目,或者一个逗号分隔的被标记的文件名列表。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
724
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
725 return full_statusline
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
726 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
727
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
728 " 状态栏进度条
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
729 function! Function_Name_2(str)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
730 " a:str : 一个当前已扫描的文件数,或者一个当前扫描目录和用户命令的字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
731
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
732 return full_statusline
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
733 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
734 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
735 一个可用的例子,参见 https://gist.github.com/1610859 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
736
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
737 *'g:ctrlp_buffer_func'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
738 指定一个会在启动或者退出CtrlP缓冲区时被调用的函数: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
739 let g:ctrlp_buffer_func = {}
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
740 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
741 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
742 let g:ctrlp_buffer_func = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
743 \ 'enter': 'Function_Name_1',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
744 \ 'exit': 'Function_Name_2',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
745 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
746 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
747
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
748 *'g:ctrlp_match_func'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
749 为CtrlP设置一个额外的模糊匹配函数: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
750 let g:ctrlp_match_func = {}
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
751 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
752 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
753 let g:ctrlp_match_func = { 'match': 'Function_Name' }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
754 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
755 函数结构: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
756 function! Function_Name(items, str, limit, mmode, ispath, crfile, regex)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
757 " 参数:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
758 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
759 " +- a:items : 搜索条目的全列表。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
760 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
761 " +- a:str : 用户输入的字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
762 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
763 " +- a:limit : 匹配窗口的最大高度。可以用来限制返回的条目数量。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
764 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
765 " +- a:mmode : 在匹配模式。可以是下列字符串之一:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
766 " | + "full-line": 匹配整行。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
767 " | + "filename-only": 只匹配文件名。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
768 " | + "first-non-tab": 匹配到第一个制表符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
769 " | + "until-last-tab": 匹配到最后一个制表符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
770 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
771 " +- a:ispath : 搜索文件,缓冲区,最近最多使用,混合,目录和rtscript模.
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
772 " | 式时为1。其它为0。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
773 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
774 " +- a:crfile : 当前窗口中的文件。当a:ispath为1时应该被搜索结果排除在外
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
775 " |
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
776 " +- a:regex : 是否在正则表达式模式: 1 or 0.
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
777
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
778 return list_of_matched_items
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
779 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
780 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
781
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
782 注意: 你可以通过 { 'arg_type': 'dict' } 扩展上面的任何选项,这样就可以通过
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
783 一个字典类型的参数来传递所有的函数参数。使用参数名作为字典的键值。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
784
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
785 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
786 let g:ctrlp_status_func = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
787 \ 'arg_type' : 'dict',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
788 \ 'enter': 'Function_Name_1',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
789 \ 'exit': 'Function_Name_2',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
790 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
791
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
792 function! Function_Name_1(dict)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
793 " where dict == {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
794 " \ 'focus': value,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
795 " \ 'byfname': value,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
796 " \ 'regex': value,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
797 " \ ...
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
798 " }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
799 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
800 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
801 *'g:ctrlp_brief_prompt'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
802 当设置为 1 时, 提示符后为空时按 <bs> 会退出 CtrlP 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
803
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
804 *ctrlp-default-value*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
805 另外,你可以使用下面的方式来改变默认值。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
806 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
807 let g:ctrlp_path_nolim = 1
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
808
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
809 这样可以让无限制模式匹配“路径”类型。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
810 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
811 命令 *ctrlp-commands*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
812
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
813 *:CtrlP*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
814 :CtrlP [起始目录]
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
815 用文件搜索模式打开CtrlP。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
816
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
817 如果没有给定参数,|g:ctrlp_working_path_mode| 会被用来决定起始目录。临时覆盖
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
818 这个参数 的方法见 |:CtrlPCurFile| 和 |:CtrlPCurWD| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
819
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
820 在输入时你可以使用 <tab> 自动补全[起始目录]。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
821
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
822 *:CtrlPBuffer*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
823 :CtrlPBuffer
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
824 用缓冲区搜索模式打开CtrlP。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
825
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
826 *:CtrlPCurFile*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
827 :CtrlPCurFile
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
828 行为类似变量 |g:ctrlp_working_path_mode| = '' 时执行 |:CtrlP| ,忽略这个变量
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
829 现在的值。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
830
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
831 *:CtrlPCurWD*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
832 :CtrlPCurWD
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
833 行为类似变量 |g:ctrlp_working_path_mode| = '' 时执行 |:CtrlP| ,忽略这个变量
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
834 现在的值。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
835
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
836 *:CtrlPMRU*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
837 :CtrlPMRU
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
838 用最近最多使用模式打开CtrlP。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
839
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
840 *:CtrlPLastMode*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
841 :CtrlPLastMode [--dir]
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
842 用上一次使用的模式打开CtrlP。当提供了"--dir"参数,也重用上一次的工作目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
843
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
844 *:CtrlPRoot*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
845 :CtrlPRoot
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
846 行为类似使用了 |g:ctrlp_working_path_mode| = 'r' 并且忽略了该变量的当前值的
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
847 |:CtrlP| 命令。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
848
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
849 *:CtrlPClearCache*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
850 :CtrlPClearCache
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
851 清除当前工作目录的缓存。和在CtrlP内按 <F5> 效果一样。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
852 使用 |g:ctrlp_use_caching| 来启用或禁用缓存。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
853
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
854 *:CtrlPClearAllCaches*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
855 :CtrlPClearAllCaches
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
856 删除在 |g:ctrlp_cache_dir| 中定义的缓存目录中的所有缓存文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
857
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
858 -------------------------------------------------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
859 由扩展提供的命令参见 |ctrlp-extensions| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
860
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
861 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
862 按键绑定 *ctrlp-mappings*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
863
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
864 *'ctrlp-<c-p>'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
865 <c-p>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
866 普通模式 |Normal| 下默认以文件搜索模式打开CtrlP提示符面板。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
867
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
868 ----------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
869 已经在提示符面板中:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
870
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
871 <c-d>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
872 在全路径搜索和文件名搜索间切换。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
873 注意: 在文件名搜索模式,提示符面板的提示符是'>d>',而不是'>>>'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
874
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
875 <c-r> *'ctrlp-fullregexp'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
876 在字符串搜索模式和正则表达式模式之间切换。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
877 注意: 在全正则表达式模式,提示符面板的提示符是'r>>',而不是'>>>'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
878
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
879 详细参见: |input-formats| (指引)和 |g:ctrlp_regexp_search| 选项。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
880
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
881 <c-f>, 'forward' 前进
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
882 <c-up>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
883 切换到序列里面的 'next' 后一个搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
884
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
885 <c-b>, 'backward' 后退
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
886 <c-down>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
887 切换到序列里面的 'previous' 前一个搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
888
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
889 <tab> *'ctrlp-autocompletion'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
890 自动补全在提示符面板的当前工作路径中的目录名。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
891
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
892 <s-tab>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
893 在匹配窗口和提示符面板之间切换焦点。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
894
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
895 <esc>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
896 <c-c>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
897 <c-g>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
898 退出CtrlP。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
899
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
900 移动:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
901
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
902 <c-j>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
903 <down>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
904 向下移动。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
905
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
906 <c-k>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
907 <up>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
908 向上移动。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
909
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
910 <c-a>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
911 移动光标到提示符面板的 'start' 开头。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
912
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
913 <c-e>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
914 移动光标到提示符面板的 'end' 末尾。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
915
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
916 <c-h>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
917 <left>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
918 <c-^>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
919 向左 'left' 移动一个字符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
920
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
921 <c-l>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
922 <right>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
923 向右 'right' 移动一个字符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
924
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
925 编辑:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
926
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
927 <c-]>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
928 <bs>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
929 删除前一个字符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
930
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
931 <del>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
932 删除当前字符。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
933
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
934 <c-w>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
935 删除前一个单词。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
936
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
937 <c-u>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
938 清除输入。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
939
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
940 浏览输入历史:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
941
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
942 <c-n>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
943 提示符面板历史里的下一个字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
944
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
945 <c-p>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
946 提示符面板历史里的上一个字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
947
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
948 打开/创建文件:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
949
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
950 <cr>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
951 如果可能的话在 'current' 当前窗口打开选择的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
952
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
953 <c-t>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
954 在 'tab' 新标签打开选择的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
955 Open the selected file in a new 'tab'.
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
956
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
957 <c-v>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
958 在 'vertical' 竖直分割窗口打开选择的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
959
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
960 <c-x>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
961 <c-cr>,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
962 <c-s>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
963 在 'horizontal' 水平分割窗口打开选择的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
964
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
965 <c-y>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
966 创建一个新文件和它的父目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
967
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
968 打开多个文件:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
969
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
970 <c-z>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
971 - 标记/取消标记一个被 <c-o> 打开的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
972 - 标记/取消标记一个被 <c-y> 在它的目录被创建的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
973
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
974 <c-o>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
975 - 打开被 <c-z> 标记的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
976 - 当没有文件被 <c-z> 标记时,使用下列选项打开一个终端对话框:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
977
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
978 打开被选择的文件:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
979 t - 在新标签页中打开。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
980 v - 在一个竖直分割窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
981 h - 在一个水平分割窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
982 r - 在当前窗口中打开。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
983 i - 在隐藏的缓冲区中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
984 x - (可选的)使用 |g:ctrlp_open_func| 中定义的函数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
985
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
986 其它选项 (未显示):
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
987 a - 标记匹配窗口中的所有文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
988 d - 改变CtrlP的工作目录到被选择的文件的目录并切换到文件搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
989
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
990 功能按键绑定:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
991
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
992 <F5>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
993 - 刷新匹配窗口并且清除当前目录的缓存。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
994 - 从最近最多使用中移除被删除的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
995
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
996 <F7>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
997 最近最多使用模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
998 - 清除最近最多使用列表。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
999 - 删除被 <c-z> 标记的最近最多使用条目。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1000 缓冲区模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1001 - 删除光标下的条目或者删除被 <c-z> 标记的多个条目。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1002
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1003 粘贴:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1004
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1005 <Insert>, *'ctrlp-pasting'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1006 <MiddleMouse>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1007 将剪贴板中的文本粘贴到提示符窗口中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1008
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1009 <c-\>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1010 打开一个终端对话框来粘贴 <cword>, <cfile>,搜索寄存器的文本,上一次可视
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1011 化模式的选择,剪贴板或者任何寄存器到提示符面板中。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1012
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1013 使用 |g:ctrlp_prompt_mappings| 选择你自己的绑定。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1014
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1015 ----------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1016 当焦点在匹配窗口中时(使用 <s-tab> 来切换):~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1017
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1018 a-z
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1019 0-9
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1020 ~^-=;`',.+!@#$%&_(){}[]
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1021 在匹配第一个字符的行中循环。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1022
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1023 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1024 输入格式 *ctrlp-input-formats*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1025
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1026 提示符面板的输入格式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1027
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1028 a) 字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1029
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1030 例如: 'abc' 被内部理解为 'a[^a]\{-}b[^b]\{-}c'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1031
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1032 b) 在正则表达式模式,输入字符串被按照Vim的正则表达式模式 |pattern| 来对待,不
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1033 进行任何修改。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1034
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1035 例如: 'abc\d*efg' 会被解读为 'abc\d*efg'。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1036
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1037 如何启用正则表达式模式参见 |ctrlp-fullregexp| (按键绑定)和
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1038 |g:ctrlp_regexp_search| (选项)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1039
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1040 c) 字符串末尾使用一个冒号':'跟随一个Vim命令来在打开那个文件后执行该命令。如果
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1041 你需要使用':'的字面意思,使用反斜杠转义'\:'。但打开多个文件时,命令会在每
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1042 个打开文件上执行。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1043
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1044 例如: 使用':45'跳转到第45行。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1045
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1046 使用':/any\:string'跳转到'any:string'第一次出现的地方。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1047
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1048 使用':+setf\ myfiletype|50'来设置文件类型为 'myfiletype',然后跳转
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1049 到第50行。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1050
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1051 使用':diffthis'当打开多个文件时在前四个文件上调用 |:diffthis| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1052
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1053 参见: Vim的 |++opt| 和 |+cmd|.
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1054
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1055 d) 提交两个点号 '..' 来进入上级目录。如果想进入向上多级目录,每多一级使用一个
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1056 额外的点号:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1057 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1058 输入 解释为
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1059 .. ../
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1060 ... ../../
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1061 .... ../../../
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1062 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1063 注意: 如果父目录很大并且没有被缓存,可能会很慢。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1064
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1065 你可以使用'@cd path/'来改变CtrlP的工作目录为path/。使用'@cd %:h'来改变为当
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1066 前文件的目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1067
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1068 e) 类似的,提交'/'或者'\'来查找或者跳转到项目的根目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1069
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1070 如果项目很大,使用版本控制系统的列出命令来寻找文件可能会加速初始化扫描。(
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1071 更多细节参见 |g:ctrlp_user_command| )。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1072
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1073 注意: d) 和 e) 只在文件,目录和混合模式生效。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1074
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1075 f) 输入一个不存在的文件名并且按下 <c-y> 来创建文件。如果使用 <c-z> 标记了一个
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1076 文件,将会在被标记的文件的目录下创建这个新文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1077
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1078 例如: 使用 'newdir/newfile.txt' 会创建一个名为'newdir'的目录和一个名为
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1079 'newfile.txt'的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1080
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1081 如果一个条目'some/old/dirs/oldfile.txt'被 <c-z> 标记,然后 'newdir'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1082 和'newfile.txt'会在'some/old/dirs'下被创建。最终的路径会像下面这样
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1083 'some/old/dirs/newdir/newfile.txt'.
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1084
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1085 注意: 在Windows下使用 '\' 代替 '/' (如果 |'shellslash'| 选项没有设置)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1086
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1087 g) 在文件名模式(使用 <c-d> 切换)下,你可以使用被逗号分隔的一个主要的模式和
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1088 一个改善的模式。两个模式在正则表达式模式下像(a)或(b)那样工作。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1089
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1090 h) 使用?打开帮助文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1091
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1092 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1093 扩展 *ctrlp-extensions*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1094
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1095 扩展是可选的。把它的名字添加到变量g:ctrlp_extensions中来开启扩展: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1096 let g:ctrlp_extensions = ['tag', 'buffertag', 'quickfix', 'dir', 'rtscript',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1097 \ 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1098 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1099 扩展的名字在变量中出现的顺序会是在使用命令 <c-f>, <c-b> 切换时扩展在状态栏中出
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1100 现的顺序。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1101
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1102 可用的扩展:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1103
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1104 *:CtrlPTag*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1105 * 标记模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1106 - 名称: 'tag'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1107 - 命令: ":CtrlPTag"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1108 - 在一个生成的标记文件中搜索标签,跳转到标签定义。使用Vim的 |'tags'| 来指定
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1109 标签文件的位置和名称。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1110 例如: set tags+=doc/tags
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1111
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1112 *:CtrlPBufTag*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1113 *:CtrlPBufTagAll*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1114 * 缓冲区标签模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1115 - 名称: 'buffertag'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1116 - 命令: ":CtrlPBufTag [缓冲区]",
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1117 ":CtrlPBufTagAll"。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1118 - 在当前缓冲区或者所有列出的缓冲区中搜索标签并且跳转到定义。需要
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1119 |exuberant_ctags| 或者兼容的程序。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1120
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1121 *:CtrlPQuickfix*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1122 * 快速修复模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1123 - 名称: 'quickfix'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1124 - 命令: ":CtrlPQuickfix"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1125 - 在当前的快速修复错误列表中搜索条目并且跳转过去。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1126
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1127 *:CtrlPDir*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1128 * 目录模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1129 - 名称: 'dir'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1130 - 命令: ":CtrlPDir [起始muu]"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1131 - 搜索目录并且将其作为工作目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1132 - 按键绑定:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1133 + <cr> 为CtrlP修改工作目录并且保持打开状态。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1134 + <c-t> 修改全局的工作目录(退出)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1135 + <c-v> 为当前窗口修改工作目录(退出)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1136 + <c-x> 修改全局工作目录为CtrlP的当前工作目录(退出)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1137
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1138 *:CtrlPRTS*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1139 * 运行时脚本模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1140 - 名称: 'rtscript'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1141 - 命令: ":CtrlPRTS"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1142 - 在运行时路径中寻找文件(vimscripts, docs, snippets...)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1143
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1144 *:CtrlPUndo*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1145 * 撤销模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1146 - 名称: 'undo'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1147 - 命令: ":CtrlPUndo"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1148 - 浏览撤销历史。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1149
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1150 *:CtrlPLine*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1151 * 行模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1152 - 名称: 'line'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1153 - 命令: ":CtrlPLine [缓冲区]"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1154 - 在所有列出的缓冲区或者在指定的 [buffer] 缓冲区内搜索一行内容。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1155
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1156 *:CtrlPChange*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1157 *:CtrlPChangeAll*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1158 * 修改列表模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1159 - 名称: 'changes'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1160 - 命令: ":CtrlPChange [缓冲区]",
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1161 ":CtrlPChangeAll".
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1162 - 在当前缓冲区或者在所有列出的缓冲区内搜索最近的修改并跳转。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1163
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1164 *:CtrlPMixed*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1165 * 混合模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1166 - 名称: 'mixed'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1167 - 命令: ":CtrlPMixed"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1168 - 同时在文件,缓冲区和最近最多修改中搜索。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1169
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1170 *:CtrlPBookmarkDir*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1171 *:CtrlPBookmarkDirAdd*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1172 * 书签目录模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1173 - 名称: 'bookmarkdir'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1174 - 命令: ":CtrlPBookmarkDir",
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1175 ":CtrlPBookmarkDirAdd [目录] [标题]".
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1176 ":CtrlPBookmarkDirAdd! [目录] [标题]".
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1177 - 搜索一个被书签标记的目录并将其作为工作目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1178 - 以指定的[标题]添加[目录]到 CtrlPBookmarkDir 中,如果没有给出[标题]或
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1179 者[目录],会请求用户输入。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1180 - 以指定的[标题]添加[目录]到 CtrlPBookmarkDir 中,如果没有给出目录,则
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1181 默认为当前目录( [CWD] ),如果没有给出[标题] ,会请求用户输入。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1182
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1183 最新的用来添加所有最近使用过的目录到 CtrlPBookmarkDir 列表中的自动命令
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1184 如下
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1185 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1186 augroup CtrlPDirMRU
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1187 autocmd!
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1188 autocmd FileType * if &modifiable | execute 'silent CtrlPBookmarkDirAdd! %:p:h' | endif
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1189 augroup END
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1190 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1191
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1192 - 按键绑定:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1193 + <cr> 为CtrlP修改工作目录并且保持打开状态,并且切换到文件搜索模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1194 + <c-x> 修改全局的工作目录(退出)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1195 + <c-v> 为当前窗口修改工作目录(退出)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1196 + <F7>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1197 - 清除书签列表。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1198 - 删除被 <c-z> 标记的书签条目。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1199
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1200 *ctrlp-autoignore-extension*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1201 * 自动忽略模式:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1202 - 名称: 'autoignore'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1203
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1204 - 这个扩展并不会添加新命令。它支持通过项目根目录中的 `.ctrlpignore` 文件为
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1205 每个项目设置忽略模式 (就像属于单个项目的 |ctrlp_custom_ignore|)。基本
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1206 上就像 CtrlP 的 `.gitignore` 或者 `.hgignore`。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1207
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1208 注意: 当使用 |g:ctrlp_user_command| 自动忽略模式不起作用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1209
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1210 注意: `.ctrlpignore` 会被当做根目录的标识(参见 |g:ctrlp_root_markers|).
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1211
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1212 - 忽略文件的语法:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1213 空行,以 `#` (注释)开头的行会被忽略。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1214
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1215 其他行会被当做正则表达式。 匹配模式如何被使用参见 *string-match* 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1216 任意条目,只要匹配到任意匹配模式,就会从 CtrlP 中搜索结果中忽略。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1217
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1218 例子:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1219
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1220 \.tmp$
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1221 ^generated/
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1222 local\.cfg
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1223
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1224 注意: 即使在 Windows 上模式也应该使用反斜线。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1225
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1226 你也可以像下面那样使用 glob 命令风格的语法:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1227
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1228 syntax:wildignore
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1229 *.tar.gz
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1230 *.tmp
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1231
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1232 这样会在搜索文件时临时的把每一个匹配模式添加到 |'wildignore'|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1233 中,结束时移除。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1234
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1235 你也可以通过下面的方式切换回默认的正则表达式为基础的模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1236
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1237 syntax:regexp
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1238
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1239 你也可以只为某一条目类型(文件、目录...)设置匹配模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1240
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1241 dir:build
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1242 file:foo\.txt
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1243
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1244 这样只会忽略包含 "build" 的目录和包含 "foo.txt" 的文件。不会忽略带
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1245 有 "build" 的文件或者反过来。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1246
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1247 注意: 如果为了忽略名为 "build" 的目录,而不是『任何』包含 "build"
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1248 的目录,你可以使用下面的正则: ^build$
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1249
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1250 - 常见问题:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1251 问: 为什么 CtrlP 不能直接支持原生的 `.gitignore` or `.hgignore` ?
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1252
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1253 答: 这些文件初看起来好像已经包含了所有你想从 CtrlP 中排除的文件。但是
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1254 通常情况下,这些文件和你想在 CtrlP 中的配置会有一些不同。这些配置文件
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1255 列出了不能被包含到版本控制中的文件。这些不能被包含到版本控制中的文件
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1256 包括了你想忽略的,但是同时可能也包含了你不想忽略的:本地设置,外部包
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1257 和依赖,等等。作者觉得支持多种语法与只是简单的复制/粘贴几行忽略规则比
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1258 起来比较麻烦。如果你不这么觉得可以随时提交补丁 :)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1259
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1260 问: 我开启了 |ctrlp-autoignore-extension|, 或者编辑了 `.ctrlpignore`
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1261 但是这些新模式并没有起作用。我哪里做错了?
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1262
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1263 答: 可能什么都没做错!CtrlP 可以为了快速的响应缓存搜索结果。你可以按
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1264 <F5> 强制刷新。如果 `.ctrlpignore` 改动过,这样也会使用新的匹配模式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1265
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1266 ----------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1267 缓冲标签模式选项:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1268
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1269 *'g:ctrlp_buftag_ctags_bin'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1270 如果ctags没有在环境变量中配置,或者一个二进制ctags文件存在于
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1271 /opt/local/bin 或 /usr/local/bin,使用该选项来指定它的位置: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1272 let g:ctrlp_buftag_ctags_bin = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1273 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1274
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1275 *'g:ctrlp_buftag_systemenc'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1276 将该选项与你的操作系统的编码(非Vim的)保持一致。默认值使用Vim的全局
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1277 |'encoding'| 选项: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1278 let g:ctrlp_buftag_systemenc = &encoding
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1279 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1280
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1281 *'g:ctrlp_buftag_types'*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1282 使用该选项来在ctags, jsctags...中为指定的文件格式设置参数: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1283 let g:ctrlp_buftag_types = ''
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1284 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1285 例子: >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1286 let g:ctrlp_buftag_types = {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1287 \ 'erlang' : '--language-force=erlang --erlang-types=drmf',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1288 \ 'javascript' : {
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1289 \ 'bin': 'jsctags',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1290 \ 'args': '-f -',
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1291 \ },
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1292 \ }
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1293 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1294
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1295 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1296 自定义 *ctrlp-customization*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1297
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1298 高亮:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1299 * CtrlP缓冲区的设置:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1300 CtrlPNoEntries : 当没有匹配被发现时的消息(错误)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1301 CtrlPMatch : 匹配模式(标识)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1302 CtrlPLinePre : 匹配窗口的行前缀'>'。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1303 CtrlPPrtBase : 提示符窗口的基础(注释)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1304 CtrlPPrtText : 提示符窗口的文本 (|hl-Normal|)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1305 CtrlPPrtCursor : 提示符窗口的光标在文本上移动时(常量)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1306
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1307 * 缓冲区浏览模式:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1308 CtrlPBufferNr : 缓冲区编号
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1309 CtrlPBufferInd : '+', '-', '=' 和 '#' 指示符 (参见 |:buffers|)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1310 CtrlPBufferHid : 隐藏缓冲区
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1311 CtrlPBufferHidMod : 隐藏和被编辑过的缓冲区
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1312 CtrlPBufferVis : 可见的缓冲区
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1313 CtrlPBufferVisMod : 可见的和被编辑过的缓冲区
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1314 CtrlPBufferCur : 当前缓冲区
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1315 CtrlPBufferCurMod : 当前和被编辑过的缓冲区
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1316 CtrlPBufferPath : 缓冲区路径
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1317
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1318 * 在扩展中:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1319 CtrlPTabExtra : 每一行中不匹配的部分(注释)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1320 CtrlPBufName : 条目所属的缓冲区名称(|hl-Directory|)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1321 CtrlPTagKind : 缓冲区标签模式中标签的类型(|hl-Title|)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1322 CtrlPqfLineCol : 快速修复模式中行和列的序号(注释)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1323 CtrlPUndoT : 撤销模式的流逝时间(|hl-Directory|)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1324 CtrlPUndoBr : 撤销模式的方括号(注释)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1325 CtrlPUndoNr : 撤销模式的方括号中的数字(字符串)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1326 CtrlPUndoSv : 文件被保存的点(注释)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1327 CtrlPUndoPo : 撤销树中的当前位置(|hl-Title|)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1328 CtrlPBookmark : 书签的名称(标识)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1329
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1330 状态栏:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1331 * 高亮组:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1332 CtrlPMode1 : 'file' 或 'path' 或 'line',和当前模式(字符)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1333 CtrlPMode2 : 'prt' 或 'win', 'regex',工作目录 |hl-LineNr| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1334 CtrlPStats : 扫描状态(函数)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1335
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1336 重新构建状态栏,参见 |g:ctrlp_status_func| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1337
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1338 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1339 其它选项 *ctrlp-miscellaneous-configs*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1340
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1341 * 为 |g:ctrlp_user_command| 使用 |wildignore| :
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1342 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1343 function! s:wig2cmd()
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1344 " 修改wildignore为空格或者|分隔的组
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1345 " 例如: .aux .out .toc .jpg .bmp .gif
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1346 " 或者 .aux$\|.out$\|.toc$\|.jpg$\|.bmp$\|.gif$
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1347 let pats = ['[*\/]*\([?_.0-9A-Za-z]\+\)\([*\/]*\)\(\\\@<!,\|$\)','\\\@<!,']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1348 let subs = has('win32') || has('win64') ? ['\1\3', ' '] : ['\1\2\3', '\\|']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1349 let expr = substitute(&wig, pats[0], subs[0], 'g')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1350 let expr = substitute(expr, pats[1], subs[1], 'g')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1351 let expr = substitute(expr, '\\,', ',', 'g')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1352
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1353 " 设置用户命令选项
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1354 let g:ctrlp_user_command = has('win32') || has('win64')
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1355 \ ? 'dir %s /-n /b /s /a-d | findstr /V /l "'.expr.'"'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1356 \ : 'find %s -type f | grep -v "'.expr .'"'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1357 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1358
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1359 call s:wig2cmd()
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1360 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1361 (由 Rich Alesi <github.com/ralesi> 提交)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1362
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1363 * 一个独立的函数,设置项目的根目录为工作目录,如果没有找到根目录的话使用当前文
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1364 * 件的父目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1365 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1366 function! s:setcwd()
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1367 let cph = expand('%:p:h', 1)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1368 if cph =~ '^.\+://' | retu | en
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1369 for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects']
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1370 let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';'])
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1371 if wd != '' | let &acd = 0 | brea | en
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1372 endfo
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1373 exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', ''))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1374 endfunction
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1375
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1376 autocmd BufEnter * call s:setcwd()
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1377 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1378 (需要 Vim 7.1.299+)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1379
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1380 * 使用 |count| 来使用同样的按键绑定调用不同的命令:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1381 >
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1382 let g:ctrlp_cmd = 'exe "CtrlP".get(["", "Buffer", "MRU"], v:count)'
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1383 <
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1384
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1385 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1386 开发人员 *ctrlp-credits*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1387
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1388 最初由 Kien Nguyen <github.com/kien>开发。现在由 Github 上 ctrlpvim 组织的成员
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1389 维护(https://github.com/orgs/ctrlpvim/people) 。在Vim的 |license| 下发行。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1390
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1391 项目主页: http://ctrlpvim.github.com/ctrlp.vim
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1392 Git 仓库: https://github.com/ctrlpvim/ctrlp.vim
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1393
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1394 -------------------------------------------------------------------------------
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1395 感谢所有通过github,bitbucket或电子邮件提供想法,报告bug或者帮助debugging的人。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1396
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1397 特别感谢:~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1398
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1399 * Woojong Koh <github.com/wjkoh>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1400 * Simon Ruderich
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1401 * Yasuhiro Matsumoto <github.com/mattn>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1402 * Ken Earley <github.com/kenearley>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1403 * Kyo Nagashima <github.com/hail2u>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1404 * Zak Johnson <github.com/zakj>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1405 * Diego Viola <github.com/diegoviola>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1406 * Piet Delport <github.com/pjdelport>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1407 * Thibault Duplessis <github.com/ornicar>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1408 * Kent Sibilev <github.com/datanoise>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1409 * Tacahiroy <github.com/tacahiroy>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1410 * Luca Pette <github.com/lucapette>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1411 * Seth Fowler <github.com/sfowler>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1412 * Lowe Thiderman <github.com/thiderman>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1413 * Christopher Fredén <github.com/icetan>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1414 * Zahary Karadjov <github.com/zah>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1415 * Jo De Boeck <github.com/grimpy>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1416 * Rudi Grinberg <github.com/rgrinberg>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1417 * Timothy Mellor <github.com/mellort>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1418 * Sergey Vlasov <github.com/noscript>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1419
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1420 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1421 更新日志 *ctrlp-changelog*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1422
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1423 * 新选项 |g:ctrlp_custom_tag_files| 用来指定自定义的标签文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1424 * 设置 g:ctrlp_match_window 为0来不限制窗口大小
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1425
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1426 Before 2016/11/28~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1427
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1428 + 新命令: |YankLine()| 来复制整个文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1429 + 新选项: |g:ctrlp_types| 来选择內建类型。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1430 + 新特性: 异步在新线程中调用 |g:ctrlp_user_command| 。 设置
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1431 |g:ctrlp_user_command_async| 为1来启用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1432 + 为 delphi, rust 和 golang提供buffertag支持。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1433 + 新选项: |g:ctrlp_brief_prompt|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1434 |g:match_current_file|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1435 |g:ctrlp_compare_lim|.
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1436 + 新功能: 自动忽略扩展。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1437 + 为 ant, tex, dosbatch, matlab 和 vhdl提供buffertag支持。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1438 + 新选项 |g:ctrlp_line_prefix| 来结合第三方插件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1439 + 新选项 |g:open_single_match| 在 matches 中打开单个文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1440 + 添加启动方式 <plug>(ctrlp) 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1441 + 接受 bang for CtrlPBookmarkDirAdd 来避免确认。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1442 + 处理像 "g:ctrlp_TYPE_MODE" 大小写混合的变量名。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1443 例如: let g:ctrlp_path_sort
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1444 + 新选项: |g:ctrlp_custom_ancestors|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1445
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1446 在2014/08/08之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1447
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1448 + 新的支持高亮的缓冲区浏览模式 (建议 |+conceal|)
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1449 + 新选项: |g:ctrlp_bufname_mod|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1450 |g:ctrlp_bufpath_mod|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1451 + 结合 *g:ctrlp_match_window_bottom* *g:ctrlp_match_window_reversed* 和
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1452 *g:ctrlp_max_height* 到 |g:ctrlp_match_window| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1453 + 新选项: |g:ctrlp_match_window| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1454
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1455 在2012/11/30之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1456
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1457 + 新选项: |g:ctrlp_abbrev|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1458 |g:ctrlp_key_loop|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1459 |g:ctrlp_open_func|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1460 |g:ctrlp_tabpage_position|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1461 |g:ctrlp_mruf_save_on_update|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1462 + 重命名:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1463 *g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden| 。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1464 + 修改 |g:ctrlp_switch_buffer| 和 |g:ctrlp_working_path_mode|的类型
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1465 (旧值仍然工作)。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1466 + 当 |g:ctrlp_user_command| 是一个字典时,为其增加一个新的键: 'ignore'。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1467
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1468 在2012/06/15之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1469
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1470 + |g:ctrlp_follow_symlinks| 的新值: 2。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1471 + |g:ctrlp_open_multiple_files| 的新值: 'j'。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1472 + 允许使用 <c-t>, <c-x>, <c-v> 打开被 <c-z> 标记的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1473 + 扩展 '..' (|ctrlp-input-formats| (d))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1474 + 新的输入格式: '@cd' (|ctrlp-input-formats| (d))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1475
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1476 在2012/04/30之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1477
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1478 + 新选项: |g:ctrlp_mruf_default_order|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1479 + 新特性: 被书签标记的目录的扩展。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1480 + 新命令: |:CtrlPBookmarkDir|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1481 |:CtrlPBookmarkDirAdd|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1482
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1483 在2012/04/15之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1484
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1485 + 新选项: |g:ctrlp_buffer_func|,CtrlP缓冲区的回调函数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1486 + 移除 : g:ctrlp_mruf_last_entered,使其作为最近最多使用的默认行为。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1487 + 新命令: |:CtrlPLastMode|,以上一次使用的模式打开CtrlP。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1488 |:CtrlPMixed|,在文件,缓冲区和最近最多使用中搜索。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1489
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1490 在2012/03/31之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1491
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1492 + 新选项: |g:ctrlp_default_input|, 进入CtrlP后的默认输入。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1493 |g:ctrlp_match_func|,允许使用自定义的模糊查找工具。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1494 + 重命名:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1495 *ClearCtrlPCache* -> |CtrlPClearCache|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1496 *ClearAllCtrlPCaches* -> |CtrlPClearAllCaches|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1497 *ResetCtrlP* -> |CtrlPReload|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1498
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1499 在2012/03/02之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1500
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1501 + 重命名:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1502 *g:ctrlp_regexp_search* -> |g:ctrlp_regexp|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1503 *g:ctrlp_dont_split* -> |g:ctrlp_reuse_window|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1504 *g:ctrlp_jump_to_buffer* -> |g:ctrlp_switch_buffer|。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1505 + 重命名和微调:
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1506 *g:ctrlp_open_multi* -> |g:ctrlp_open_multiple_files|。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1507 + 过时 *g:ctrlp_highlight_match*
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1508 + 扩展 |g:ctrlp_user_command| 支持多个命令。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1509 + 新选项: |g:ctrlp_mruf_last_entered| 修改最近最多使用为最近进入。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1510
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1511 在2012/01/15之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1512
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1513 + 新按键绑定: 交换 <tab> 和 <s-tab>. <tab> 现在用来补全在当前工作目录内的目
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1514 录名。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1515 + 新选项: |g:ctrlp_arg_map| 使 <c-y>, <c-o> 可以接收一个参数。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1516 |g:ctrlp_status_func| 自定义状态栏。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1517 |g:ctrlp_mruf_relative| 在当前工作目录内显示最近最多使用。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1518 + 扩展 g:ctrlp_open_multi 增加新选项值: tr, hr, vr。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1519 + 扩展 |g:ctrlp_custom_ignore| 指定过滤目录,文件和链接。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1520
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1521 在2012/01/05之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1522
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1523 + 新特性: 缓冲区标记扩展。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1524 + 新命令: |:CtrlPBufTag|, |:CtrlPBufTagAll|。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1525 + 新选项: |g:ctrlp_cmd|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1526 |g:ctrlp_custom_ignore|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1527
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1528 在2011/11/30之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1529
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1530 + 新特性: 标签,快速修复和目录扩展。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1531 + 新命令: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1532 + 新选项: |g:ctrlp_use_migemo|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1533 |g:ctrlp_lazy_update|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1534 |g:ctrlp_follow_symlinks|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1535
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1536 在2011/11/13之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1537
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1538 + 新的特殊输入: '/' 和 '\' 查找根目录 (|ctrlp-input-formats| (e))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1539 + 移除 ctrlp#SetWorkingPath()。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1540 + 移除 *g:ctrlp_mru_files* ,使最近最多使用模式变为永久的。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1541 + 扩展 g:ctrlp_open_multi,添加打开文件的新方式。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1542 + 新选项: g:ctrlp_dont_split,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1543 |g:ctrlp_mruf_case_sensitive|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1544
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1545 在2011/10/30之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1546
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1547 + 新特性: 支持自定义扩展。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1548 <F5> 也会从最近最多使用列表中移除不存在的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1549 + 新选项: g:ctrlp_jump_to_buffer
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1550
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1551 在2011/10/12之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1552
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1553 + 新特性: 打开多个文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1554 传递Vim的 |++opt| 和 |+cmd| 到新打开的文件
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1555 (|ctrlp-input-formats| (c))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1556 为 |:CtrlP| [起始目录]自动补全每个目录
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1557 + 新按键绑定: <c-z> 标记/取消标记一个被 <c-o> 打开的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1558 <c-o> 打开所有被标记的文件。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1559 + 新选项: g:ctrlp_open_multi
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1560 + 移除 *g:ctrlp_persistent_input* *g:ctrlp_live_update* and <c-^>。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1561
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1562 在2011/09/29之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1563
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1564 + 新按键绑定: <c-n>, <c-p> 输入历史中的前一个/后一个字符串。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1565 <c-y> 创建一个新的文件和它的父目录。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1566 + 新选项: |g:ctrlp_open_new_file|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1567 |g:ctrlp_max_history|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1568 + 添加一个新的在横向分割窗口打开的绑定:<c-x>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1569
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1570 在2011/09/19之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1571
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1572 + 新命令: ResetCtrlP
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1573 + 新选项: |g:ctrlp_max_files|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1574 |g:ctrlp_max_depth|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1575 g:ctrlp_live_update
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1576 + 新按键绑定: <c-^>
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1577
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1578 在2011/09/12之前~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1579
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1580 + 添加在匹配窗口内循环匹配行的功能。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1581 + 扩展 g:ctrlp_persistent_input的行为
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1582 + 扩展 |:CtrlP| 的行为
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1583 + 新选项: |g:ctrlp_dotfiles|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1584 |g:ctrlp_clear_cache_on_exit|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1585 g:ctrlp_highlight_match,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1586 |g:ctrlp_user_command|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1587 + 新的特殊输入: '..' (|ctrlp-input-formats| (d))
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1588 + 新按键绑定: <F5>。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1589 + 新命令: |:CtrlPCurWD|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1590 |:CtrlPCurFile|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1591 |:CtrlPRoot|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1592
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1593 + 新特性: 在最近最常使用的文件列表中搜索
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1594 + 新按键绑定: <c-b>。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1595 + 扩展 <c-f> 的行为。
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1596 + 新选项: g:ctrlp_mru_files,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1597 |g:ctrlp_mruf_max|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1598 |g:ctrlp_mruf_exclude|,
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1599 |g:ctrlp_mruf_include|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1600 + 新命令: |:CtrlPMRU|
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1601
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1602 第一版发布于: 2011/09/06~
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1603
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1604 ===============================================================================
4576f1471f53 [update-vendor, vim] add ctrlp
nanaya <me@nanaya.net>
parents:
diff changeset
1605 vim:ft=help:et:ts=2:sw=2:sts=2:norl