ตามค่าเริ่มต้นเมื่อคุณกดC-nหรือC-pVim จะค้นหาแหล่งข้อมูลต่าง ๆ เพื่อค้นหาผู้สมัครที่จะเติมข้อมูลเมนูที่สมบูรณ์
แหล่งข้อมูลเหล่านี้สามารถกำหนดค่าด้วย'complete'ตัวเลือกบัฟเฟอร์ท้องถิ่น
ค่าของตัวเลือกนี้เป็นรายการของธงที่คั่นด้วยเครื่องหมายจุลภาค แต่ละธงมีความหมายของตัวเองอธิบายไว้ใน:h 'cpt:
. scan the current buffer ('wrapscan' is ignored)
w scan buffers from other windows
b scan other loaded buffers that are in the buffer list
u scan the unloaded buffers that are in the buffer list
U scan the buffers that are not in the buffer list
k scan the files given with the 'dictionary' option
kspell use the currently active spell checking |spell|
k{dict} scan the file {dict}. Several "k" flags can be given, patterns are valid too. For example:
:set cpt=k/usr/dict/*,k~/spanish
s scan the files given with the 'thesaurus' option
s{tsr} scan the file {tsr}. Several "s" flags can be given, patterns are valid too.
i scan current and included files
d scan current and included files for defined name or macro |i_CTRL-X_CTRL-D|
] tag completion
t same as "]"
โดยค่าเริ่มต้นค่าของมันคือ.,w,b,u,t,iซึ่งหมายความว่า:
1. the current buffer
2. buffers in other windows
3. other loaded buffers
4. unloaded buffers
5. tags
6. included files
หากคุณพบว่าการสแกนไฟล์ที่รวมใช้เวลานานเกินไปคุณสามารถลองลบการiตั้งค่าสถานะออกจาก'cpt'ตัวเลือก
หากคุณต้องการลบออกจากค่าส่วนกลางเพื่อส่งผลกระทบต่อบัฟเฟอร์ทั้งหมดโดยค่าเริ่มต้นคุณจะเขียนในvimrc:
setglobal complete-=i
หากคุณต้องการทำสิ่งเดียวกัน แต่สำหรับperlไฟล์เท่านั้นคุณสามารถติดตั้ง autocmd ภายในvimrc:
augroup PerlSettings
autocmd!
autocmd FileType perl setlocal complete-=i
augroup END
หรือดีกว่าคุณสามารถสร้างปลั๊กอินประเภทไฟล์เช่น~/.vim/after/ftplugin/perl.vimที่คุณจะเขียน:
setlocal complete-=i
ในการตรวจสอบว่า'complete'ตัวเลือกของคุณคืออะไรในโลกและในปัจจุบันและที่ไหนที่พวกเขาตั้งค่าล่าสุดคุณสามารถใช้คำสั่งเหล่านี้:
verbose setglobal complete?
verbose setlocal complete?
หรือสั้นกว่า:
verb setg cpt?
verb setl cpt?
ถ้าเป็นแหล่งเดียวที่คุณสนใจเป็นบัฟเฟอร์ปัจจุบันแล้วแทนการใช้คุณสามารถใช้C-n C-x C-nดู:h i_^x^nข้อมูลเพิ่มเติม
let g:ctrlp_custom_ignore = { 'dir': '^/usr/' } let g:ctrln_custom_ignore = { 'dir': '^/usr/' }