官术网_书友最值得收藏!

Plugin spotlight – CtrlP

CtrlP is a fuzzy completion plugin that helps you open the files you need quickly, given that you somewhat know what you're looking for. CtrlP is available from https://github.com/ctrlpvim/ctrlp.vim (see the Installing plugins section earlier in this chapter for installation instructions). 

Install it and hit Ctrl + p:

This shows the list of files in the project directory. Type in a partial filename or a path, and the list of files will narrow down to string matches. You can use Ctrl + j and Ctrl + k to navigate up and down the list, and Enter to open the file. Esc closes the CtrlP window.

CtrlP also allows you to navigate through buffers and most recently used files. With the CtrlP window open, you can use Ctrl + f and Ctrl + b to cycle through the available options.

You can invoke these directly by executing :CtrlPBuffer for buffers and :CtrlPMRU for the most recently used ones. You can also use :CtrlPMixed to search through files, buffers, and the most recently used files at the same time.

You can also add custom mappings for these to your .vimrc file. For example, to map Ctrl + b to :CtrlPBuffer, you could do the following:

nnoremap <C-b> :CtrlPBuffer<cr>  " Map CtrlP buffer mode to Ctrl + B.
主站蜘蛛池模板: 彩票| 石首市| 惠安县| 大荔县| 电白县| 竹山县| 葵青区| 隆昌县| 新宾| 读书| 陇西县| 高邑县| 龙井市| 乐安县| 潞西市| 浦县| 综艺| 扎囊县| 清流县| 黄骅市| 泰和县| 龙山县| 龙门县| 柳林县| 神池县| 城固县| 唐海县| 德清县| 嘉禾县| 长泰县| 永兴县| 江门市| 大埔县| 闽清县| 怀柔区| 福泉市| 苗栗市| 襄汾县| 抚顺县| 松江区| 德保县|