Rename g:ctrlp_dotfiles and change its default value

This commit is contained in:
Kien N 2012-09-10 22:24:29 +07:00
parent 32ac8d27cb
commit f66f4e8503
2 changed files with 10 additions and 7 deletions

View File

@ -57,7 +57,7 @@ let [s:pref, s:opts, s:new_opts] = ['g:ctrlp_', {
\ 'custom_ignore': ['s:usrign', s:ignore()], \ 'custom_ignore': ['s:usrign', s:ignore()],
\ 'default_input': ['s:deftxt', 0], \ 'default_input': ['s:deftxt', 0],
\ 'dont_split': ['s:nosplit', 'netrw'], \ 'dont_split': ['s:nosplit', 'netrw'],
\ 'dotfiles': ['s:dotfiles', 1], \ 'dotfiles': ['s:showhidden', 0],
\ 'extensions': ['s:extensions', []], \ 'extensions': ['s:extensions', []],
\ 'follow_symlinks': ['s:folsym', 0], \ 'follow_symlinks': ['s:folsym', 0],
\ 'highlight_match': ['s:mathi', [1, 'CtrlPMatch']], \ 'highlight_match': ['s:mathi', [1, 'CtrlPMatch']],
@ -88,6 +88,7 @@ let [s:pref, s:opts, s:new_opts] = ['g:ctrlp_', {
\ 'open_multiple_files': 's:opmul', \ 'open_multiple_files': 's:opmul',
\ 'regexp': 's:regexp', \ 'regexp': 's:regexp',
\ 'reuse_window': 's:nosplit', \ 'reuse_window': 's:nosplit',
\ 'show_hidden': 's:showhidden',
\ 'switch_buffer': 's:jmptobuf', \ 'switch_buffer': 's:jmptobuf',
\ }] \ }]
@ -194,7 +195,7 @@ fu! s:opts() "{{{2
if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en
let s:maxdepth = min([s:maxdepth, 100]) let s:maxdepth = min([s:maxdepth, 100])
let s:mxheight = max([s:mxheight, 1]) let s:mxheight = max([s:mxheight, 1])
let s:glob = s:dotfiles ? '.*\|*' : '*' let s:glob = s:showhidden ? '.*\|*' : '*'
let s:igntype = empty(s:usrign) ? -1 : type(s:usrign) let s:igntype = empty(s:usrign) ? -1 : type(s:usrign)
if s:lazy if s:lazy
cal extend(s:glbs, { 'ut': ( s:lazy > 1 ? s:lazy : 250 ) }) cal extend(s:glbs, { 'ut': ( s:lazy > 1 ? s:lazy : 250 ) })
@ -1300,7 +1301,7 @@ fu! ctrlp#dirnfile(entries)
let etype = getftype(each) let etype = getftype(each)
if s:igntype >= 0 && s:usrign(each, etype) | con | en if s:igntype >= 0 && s:usrign(each, etype) | con | en
if etype == 'dir' if etype == 'dir'
if s:dotfiles | if each !~ '[\/]\.\{1,2}$' if s:showhidden | if each !~ '[\/]\.\{1,2}$'
cal add(items[0], each) cal add(items[0], each)
en | el en | el
cal add(items[0], each) cal add(items[0], each)

View File

@ -51,7 +51,7 @@ Overview:~
|ctrlp_use_caching|...........Use per-session caching or not. |ctrlp_use_caching|...........Use per-session caching or not.
|ctrlp_clear_cache_on_exit|...Keep cache after exiting Vim or not. |ctrlp_clear_cache_on_exit|...Keep cache after exiting Vim or not.
|ctrlp_cache_dir|.............Location of the cache directory. |ctrlp_cache_dir|.............Location of the cache directory.
|ctrlp_dotfiles|..............Ignore dotfiles and dotdirs or not. |ctrlp_show_hidden|...........Ignore dotfiles and dotdirs or not.
|ctrlp_custom_ignore|.........Hide stuff when using |globpath()|. |ctrlp_custom_ignore|.........Hide stuff when using |globpath()|.
|ctrlp_max_files|.............Number of files to scan initially. |ctrlp_max_files|.............Number of files to scan initially.
|ctrlp_max_depth|.............Directory depth to recurse into when scanning. |ctrlp_max_depth|.............Directory depth to recurse into when scanning.
@ -209,9 +209,9 @@ Set the directory to store the cache files: >
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp' let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
< <
*'g:ctrlp_dotfiles'* *'g:ctrlp_show_hidden'*
Set this to 0 if you don't want CtrlP to scan for dotfiles and dotdirs: > Set this to 1 if you want CtrlP to scan for dotfiles and dotdirs: >
let g:ctrlp_dotfiles = 1 let g:ctrlp_show_hidden = 0
< <
Note: does not apply when a command defined with |g:ctrlp_user_command| is Note: does not apply when a command defined with |g:ctrlp_user_command| is
being used. being used.
@ -1178,6 +1178,8 @@ Special thanks:~
=============================================================================== ===============================================================================
CHANGELOG *ctrlp-changelog* CHANGELOG *ctrlp-changelog*
+ Rename:
*g:ctrlp_dotfiles* -> |g:ctrlp_show_hidden|.
+ Change |g:ctrlp_switch_buffer|'s and |g:ctrlp_working_path_mode|'s type + Change |g:ctrlp_switch_buffer|'s and |g:ctrlp_working_path_mode|'s type
(old values still work). (old values still work).
+ New key for |g:ctrlp_user_command| when it's a Dictionary: 'ignore'. + New key for |g:ctrlp_user_command| when it's a Dictionary: 'ignore'.