Skip to content

jandamm/ctrlp-complete.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ctrlp-complete

Search current completion options in CtrlP

Example

Configuration

All this plugin provides is a mapping: <Plug>(ctrlp_complete)

Map it like this to use <C-f> to search completions when you can see a pum.

imap <expr> <C-f> pumvisible() ? '<Plug>(ctrlp_complete)' : '<C-f>'

If you don't use menu or menuone as a completeopt:

imap <C-f> <Plug>(ctrlp_complete)

Usage

Start a completion (e.g. <C-x><C-o>) and press your mapping. This will open CtrlP where you can search all possible completions.

Advanced

There is also an autocmd: User ctrlp_complete. When this autocmd is triggered the selected completion is inserted and you're in insert mode again.

" Always add a space after ctrlp complete has inserted your selection.
autocmd User ctrlp_complete call feedkeys(' ', 'n')

When you're using the autocmd and want to select an entry without triggering the autocmd you can use <C-s> (mnemonic: silent). It is the mapping for opening in a horizontal split. So by default <C-CR> and <C-x> work as well.

Installation

You have to have CtrlP installed. Install this plugin the same way.

Your Vim needs to support <CMD> mappings. :h <Cmd> should exist.

License

CtrlP Complete is distributed under Vim's license.

Credits

This plugin is based on this idea.

About

Search current completion options in CtrlP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published