Github url

ctrlp.vim

by kien

kien /ctrlp.vim

Fuzzy file, buffer, mru, tag, etc finder.

6.8K Stars 630 Forks Last release: Not found 450 Commits 21 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

This project is unmaintained

You should use this fork instead.

ctrlp.vim

Full path fuzzy file, buffer, mru, tag, ... finder for Vim.

  • Written in pure Vimscript for MacVim, gVim and Vim 7.0+.
  • Full support for Vim's regexp as search patterns.
  • Built-in Most Recently Used (MRU) files monitoring.
  • Built-in project's root finder.
  • Open multiple files at once.
  • Create new files and directories.
  • Extensible.

ctrlp

Basic Usage

  • Run
    :CtrlP
    or
    :CtrlP [starting-directory]
    to invoke CtrlP in find file mode.
  • Run
    :CtrlPBuffer
    or
    :CtrlPMRU
    to invoke CtrlP in find buffer or find MRU file mode.
  • Run
    :CtrlPMixed
    to search in Files, Buffers and MRU files at the same time.

Check

:help ctrlp-commands

and

:help ctrlp-extensions

for other commands.

Once CtrlP is open:
  • Press
    <f5></f5>
    to purge the cache for the current directory to get new files, remove deleted files and apply new ignore options.
  • Press
    <c-f></c-f>
    and
    <c-b></c-b>
    to cycle between modes.
  • Press
    <c-d></c-d>
    to switch to filename only search instead of full path.
  • Press
    <c-r></c-r>
    to switch to regexp mode.
  • Use
    <c-j></c-j>
    ,
    <c-k></c-k>
    or the arrow keys to navigate the result list.
  • Use
    <c-t></c-t>
    or
    <c-v></c-v>
    ,
    <c-x></c-x>
    to open the selected entry in a new tab or in a new split.
  • Use
    <c-n></c-n>
    ,
    <c-p></c-p>
    to select the next/previous string in the prompt's history.
  • Use
    <c-y></c-y>
    to create a new file and its parent directories.
  • Use
    <c-z></c-z>
    to mark/unmark multiple files and
    <c-o></c-o>
    to open them.

Run

:help ctrlp-mappings

or submit

?

in CtrlP for more mapping help.

  • Submit two or more dots
    ..
    to go up the directory tree by one or multiple levels.
  • End the input string with a colon
    :
    followed by a command to execute it on the opening file(s):
    Use
    :25
    to jump to line 25.
    Use
    :diffthis
    when opening multiple files to run
    :diffthis
    on the first 4 files.

Basic Options

  • Change the default mapping and the default command to invoke CtrlP:

let g:ctrlp\_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
</c-p>
  • When invoked, unless a starting directory is specified, CtrlP will set its local working directory according to this variable:

let g:ctrlp\_working\_path\_mode = 'ra'
'c'
  • the directory of the current file.
'r'
  • the nearest ancestor that contains one of these directories or files:
    .git
.hg
.svn
.bzr
\_darcs
'a'
  • like c, but only if the current working directory outside of CtrlP is not a direct ancestor of the directory of the current file.
0

or

''

(empty string) - disable this feature.

Define additional root markers with the

g:ctrlp\_root\_markers

option.

Exclude files and directories using Vim's

wildignore

and CtrlP's own

g:ctrlp\_custom\_ignore

:

set wildignore+=\*/tmp/\*,\*.so,\*.swp,\*.zip " MacOSX/Linux set wildignore+=\*\\tmp\\*,\*.swp,\*.zip,\*.exe " Windows let g:ctrlp\_custom\_ignore = '\v[\/]\.(git|hg|svn)$' let g:ctrlp\_custom\_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$', \ 'file': '\v\.(exe|so|dll)$', \ 'link': 'some\_bad\_symbolic\_links', \ }
  • Use a custom file listing command:

let g:ctrlp\_user\_command = 'find %s -type f' " MacOSX/Linux let g:ctrlp\_user\_command = 'dir %s /-n /b /s /a-d' " Windows

Check

:help ctrlp-options

for other options.

Installation

Use your favorite method or check the homepage for a quick installation guide.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.