Vim CtrlP上的性能较慢,它不会';无法忽略某些文件夹

Vim CtrlP上的性能较慢,它不会';无法忽略某些文件夹,vim,ctrlp,Vim,Ctrlp,我试图通过在中添加以下设置来忽略供应商。vimrc 我通过输入ff map ff :CtrlP<.><cr> 这是我的.vimrc,我想可能有一些设置相互冲突 hi Comment ctermfg=6 "make vim save and load the folding of the document each time it loads" ""also places the cursor in the last place that it was left.

我试图通过在
中添加以下设置来忽略
供应商
。vimrc
我通过输入
ff

map ff :CtrlP<.><cr>

这是我的
.vimrc
,我想可能有一些设置相互冲突

hi  Comment  ctermfg=6

"make vim save and load the folding of the document each time it loads"
""also places the cursor in the last place that it was left."
au BufWinLeave *.* mkview
au BufWinEnter *.* silent loadview


"function SetCafeOptions()
    "CoffeeCompile
    ":set nonu
    ":res -24
    ":res +24
"endfunction

set encoding=utf-8 
set fileencoding=utf-8 

colorscheme elflord            
set smartindent
set tabstop=4
set expandtab  
set shiftwidth=4

"make it autoreload
set autoread 

"auto move it last time the position you viewed
"make vim save and load the folding of the document each time it loads"
""also places the cursor in the last place that it was left."

"try to set show ansi color
if &term=="ansi" 
    set t_Co=0 
endif

"set expandtab

filetype on

if has("cscope")
    set csprg=/usr/bin/cscope
    set csto=0
    set cst
    set nocsverb
    " add any database in current directory
    if filereadable("cscope.out")
        cs add cscope.out
        " else add database pointed to by environment
    elseif $CSCOPE_DB != ""
        cs add $CSCOPE_DB
    endif
    set csverb
    set cscopetag
    set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
endif

"let Tlist can close windows at one time
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'

" Key map
" Presee F4 and you can open the NERDTree
nnoremap <silent> <F4> :NERDTree<CR>  
"nnoremap <silent> <F3> :!/usr/bin/env python %<CR>
" Show function List with Tlist 
nnoremap <F12> :TlistToggle<CR>

" Map ctrl+q to ctrlw+ctrlw
"
"nnoremap <silent> <C-q>  :<C-w><C-w>

"switch in splitted window
map <c-d> <c-w>l
map <c-a> <c-w>h

"set highlight
set hlsearch

"set autocomplet 
"autocmd BufNewFile,BufRead *.html.erb set filetype=html.eruby
autocmd BufNewFile,BufRead *.html.erb set filetype=erb.html.eruby
filetype plugin indent on

"auto import python template
autocmd bufnewfile *.py 0r ~/common_lib/python_lib/tmpl.py


map ff :CtrlP<.><cr>
"set NerdTreeSize
let g:NERDTreeWinSize=12
let g:NERDTreeIgnore=['\.vim$', '\~$', '\vendor$']
"auto close the nerdtress window whe you open new file
"let g:ctrlp_dont_split = 'nerdtree'

set nocompatible " explictly get out of vi-compatible mode

set background=dark " we plan to use a dark background

syntax on " syntax highlighting on

set number " turn on line numbers

set ruler "always show current position along the bottom

set incsearch " do highlight as you type you search phrase

set ignorecase " case insensitive by default

set smartcase " if there are caps, go case-sensitive


"Rope vim
"let $PYTHONPATH .= ":~/install/ropehg/rope:~/install/ropehg/ropemode:~/install/ropehg/ropevim"
"source ~/install/ropehg/ropevim/ropevim.vim
"let g:pymode_rope_goto_def_newwin = "new"
"let ropevim_vim_completion=1
"Use Ctrl + ] . to autocomple
inoremap <C-]> <C-R>=RopeCodeAssistInsertMode()<CR>
map <leader>j :RopeGotoDefinition<CR>
map <leader>r :RopeRename<CR>

" Load the whole plugin
 let g:pymode = 1
" Load run code plugin
 let g:pymode_run = 1

"add ctrlp.vim setting
""
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/vendor/*,*/\.git/*
let g:ctrlp_custom_ignore = 'tmp$\|\.git$\|\.hg$\|\.svn$\|.rvm$|.bundle$\|vendor'
let g:ctrlp_working_path_mode = 0
let g:ctrlp_match_window_bottom=1
let g:ctrlp_max_height=25
let g:ctrlp_match_window_reversed=0
let g:ctrlp_mruf_max=500
let g:ctrlp_follow_symlinks=1
let g:ctrlp_clear_cache_on_exit=0


"Vundle
 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()
 Bundle 'gmarik/vundle'
 Bundle 'tpope/vim-surround'
 Bundle 'Raimondi/delimitMate'
"coffee script"
 Bundle 'kchmck/vim-coffee-script'
 Bundle 'ack.vim'
 Bundle 'matchit.zip'
 Bundle 'kien/ctrlp.vim'
 "Markdown"
 "Bundle 'plasticboy/vim-markdown'
 ""Vim-scripts repo
 "Bundle 'The-NERD-Commenter'
 Bundle 'pep8'
 ""Bundle 'AutoClose'
 Bundle 'desert-warm-256'
 Bundle 'https://github.com/altercation/vim-colors-solarized.git'
 filetype plugin indent on

 nmap <leader>a <Esc>:Ack ""

 "folding code
 nnoremap <space> za
 vnoremap <space> zf

" pep8
let g:pep8_map='<leader>8'

"coffee script"
call pathogen#infect()



let Tlist_Use_Right_Window   = 1

"autocmd BufEnter * if &filetype == "" | setlocal ft=python | endif

"markdown https://github.com/plasticboy/vim-markdown/wiki"
"let g:vim_markdown_folding_disabled=1

"auto exec ruby and coffee script with F5 , remeber to save file before launching
autocmd FileType python map <leader>p :!python %<cr>
autocmd FileType ruby,rb map <leader>5 :w!<cr>:!ruby %<cr>
autocmd FileType * map <leader>e :qa!<cr>

"set extension .god as a Ruby file"
"au BufNewFile,BufRead *.god set filetype=ruby

"autocmd FileType coffee nmap <F5> :CoffeeCompile<cr>
"autocmd FileType coffee map <F5> :call SetCafeOptions()<cr>

"so ~/.vim/snippets/support_functions.vim

set re=1

autocmd Filetype gitcommit setlocal spell textwidth=72


 " enable per-project .vimrc files
   set exrc
 "   " Only execute safe per-project vimrc commands
     set secure"
hi-mfg=6
“使vim在每次加载时保存并加载文档的折叠”
“”还将光标放置在最后一个留下的位置。”
au BufWinLeave**mkview
au Bufwanter**静默装载视图
“函数设置选项()
“咖啡
“:设置为非u
“:res-24
“:res+24
“端功能
设置编码=utf-8
设置fileencoding=utf-8
颜色方案
智能对齐
设置tabstop=4
设置扩展选项卡
设置shiftwidth=4
“让它自动上路
设置自动读取
“上次查看位置时自动移动它
“使vim在每次加载时保存并加载文档的折叠”
“”还将光标放置在最后一个留下的位置。”
“尝试设置显示ansi颜色
如果术语==“ansi”&术语
设置t_Co=0
恩迪夫
“设置扩展选项卡
侦测文件类型
如果有(“cscope”)
设置csprg=/usr/bin/cscope
将csto设置为0
设置cst
设置nocsverb
“在当前目录中添加任何数据库
如果文件可读(“cscope.out”)
cs添加cscope.out
“否则,请添加环境指向的数据库
其他$CSCOPE\u DB!=""
政务司司长增加$CSCOPE_DB
恩迪夫
集合动词
设置cscopetag
设置cscopequickfix=s-、g-、c-、d-、t-、e-、f-、i-
恩迪夫
“让Tlist可以一次关闭窗口
让Tlist\u显示一个文件=1
让Tlist_Exit_OnlyWindow=1
让Tlist_Ctags_Cmd='/usr/local/bin/Ctags'
“关键地图
“出示F4,你就可以打开NERDTree了
nnoremap:NERDTree
“nnoremap:/usr/bin/env python%
“使用Tlist显示函数列表
nnoremap:TlistToggle
“将ctrl+q映射到ctrlw+ctrlw
"
“地图:
“在拆分窗口中切换
地图l
地图h
“设置高光
高亮显示
“设置自动完成
“autocmd BufNewFile,BufRead*.html.erb set filetype=html.eruby
autocmd BufNewFile,BufRead*.html.erb set filetype=erb.html.eruby
文件类型插件缩进
“自动导入python模板
autocmd bufnewfile*.py 0r~/common\u lib/python\u lib/tmpl.py
地图ff:CtrlP
“设置NerdTreeSize
设g:nerdtrewinsize=12
设g:NERDTreeIgnore=['\.vim$','\~$','\vendor$']
“打开新文件时自动关闭NerdPress窗口
“让g:ctrlp\u don\u split='nerdtree'
设置nocompatible“明确退出vi兼容模式
设置背景=暗“我们计划使用暗背景
语法打开“语法突出显示打开”
“设置号码”打开行号
设置标尺“始终沿底部显示当前位置
设置incsearch“在键入搜索短语时突出显示
默认情况下,设置ignorecase“不区分大小写”
设置smartcase“如果有大写字母,请区分大小写
“绳子维姆
“让$PYTHONPATH.=”:~/install/ropehg/rope:~/install/ropehg/ropemode:~/install/ropehg/ropevim”
“source~/install/ropehg/ropevim/ropevim.vim
“让g:pymode_rope_goto_def_newwin=“new”
“让ropevim_vim_完成=1
“使用Ctrl+]。自动完成
inoremap=ropeCodeassistinerTMode()
地图j:绳状体定义
地图r:RopeRename
“加载整个插件
设g:pymode=1
加载运行代码插件
设g:pymode_run=1
“添加ctrlp.vim设置
""
设置wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/vendor/*,*/\.git/*
让g:ctrlp|u custom|u ignore='tmp$\\\\\\\\.git$\\\\\\.hg$\\\\\\\.svn$\\\\\\\.rvm$\.bundle$\\\\\\供应商
设g:ctrlp_工作路径_模式=0
设g:ctrlp_匹配_窗口_底部=1
设g:ctrlp_最大高度=25
设g:ctrlp\u match\u window\u reversed=0
设g:ctrlp_mruf_max=500
设g:ctrlp_follow_symlinks=1

设g:ctrlp\u清除\u退出时的\u缓存=0 “Vundle 设置rtp+=~/.vim/bundle/vundle/ 调用vundle#rc() 捆绑“gmarik/vundle” 捆绑“TPOP/vim环绕” 捆绑“Raimondi/Mate” “咖啡剧本” 捆绑“kchmck/vim咖啡脚本” 捆绑“确认,维姆” 捆绑“matchit.zip” 捆绑“kien/ctrlp.vim” “降价” “捆绑‘塑料男孩/vim降价’ “”Vim脚本repo “捆绑‘书呆子评论员’ 捆绑“pep8” “”捆绑“自动关闭” 捆绑“沙漠-温暖-256” 捆绑https://github.com/altercation/vim-colors-solarized.git' 文件类型插件缩进 nmap a:确认“” “折叠代码 诺雷扎地图 vnoremap zf “pep8 让g:pep8_map='8' “咖啡剧本” 叫病原体#传染() 让Tlist\u使用\u Right\u Window=1 “autocmd BufEnter*if&filetype==”| setlocal ft=python | endif “降价https://github.com/plasticboy/vim-markdown/wiki" “设g:vim\u降价\u折叠\u禁用=1 使用F5自动执行ruby和coffee脚本,请记住在启动之前保存文件 autocmd文件类型python映射p:!python% autocmd文件类型ruby,rb映射5:w!:!ruby% autocmd文件类型*映射e:qa! “将扩展名.god设置为Ruby文件” “au BufNewFile,BufRead*.god set filetype=ruby “autocmd文件类型coffee nmap:CoffeeCompile “autocmd文件类型咖啡映射:调用SetCafeOptions() “so~/.vim/snippets/support_functions.vim 设置re=1 autocmd文件类型gitcommit setlocal拼写文本宽度=72 “启用每个项目的.vimrc文件 设置exrc “”仅执行每个项目的安全vimrc命令 设置安全“
以下是一些肯定会加速ctrlp的提示:

let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'
if executable('ag')
  let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
在上面的示例中,第一个选项告诉ctrlp将缓存持久保存在配置的位置,因此当您再次启动vim时,它将从那里读取并加载缓存(速度要快得多)

第二个选项将ctrlp配置为使用ag(银色搜索器),而不是vim的原生
globpath()
API来搜索文件,这将大大提高它的扫描速度,如果你不想使用
ag
,你甚至可以使用普通的
grep
,而且速度应该会快很多。查看
:h'g:ctrlp\u user\u command'
了解更多详细信息。

如我所解释的,如果你键入
:help ctrlp options
a读一读,你会发现:

注#1:默认情况下,wildignoreg:ctrlp\u custom\u ignore 当使用globpath()扫描文件时应用,因此这些选项 D
let g:ctrlp_cache_dir = $HOME . '/.cache/ctrlp'
if executable('ag')
  let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
endif
if exists("g:ctrl_user_command")
  unlet g:ctrlp_user_command
endif
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*/vendor/*,*/\.git/*
...
rm -r ~/.cache/ctrlp/      # On Linux
let g:ctrlp_user_command = ['.git/', 'git ls-files --cached --others  --exclude-standard %s']
let g:ctrlp_clear_cache_on_exit = 0
if executable('rg')
  let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
  let g:ctrlp_use_caching = 0
endif