- Mastering Vim
- Ruslan Osipov
- 232字
- 2021-06-10 18:51:30
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.
- PHP動(dòng)態(tài)網(wǎng)站程序設(shè)計(jì)
- Web應(yīng)用系統(tǒng)開發(fā)實(shí)踐(C#)
- Boost程序庫(kù)完全開發(fā)指南:深入C++”準(zhǔn)”標(biāo)準(zhǔn)庫(kù)(第5版)
- MongoDB for Java Developers
- VSTO開發(fā)入門教程
- Mastering Ext JS
- Learning Zurb Foundation
- Visual C++開發(fā)入行真功夫
- Android開發(fā)三劍客:UML、模式與測(cè)試
- QlikView Unlocked
- 高質(zhì)量程序設(shè)計(jì)指南:C++/C語言
- PHP典型模塊與項(xiàng)目實(shí)戰(zhàn)大全
- C++從零開始學(xué)(視頻教學(xué)版)(第2版)
- Practical Time Series Analysis
- R for Data Science Cookbook