---
title: "Ctrl-P"
url: "https://courses.osherove.com/courses/vim-hates-you/ctrl-p.md"
canonical: "https://courses.osherove.com/courses/vim-hates-you/ctrl-p/"
tags: []
author: "Roy Osherove"
description: "Lesson 18 of 26 in Vim Hates You (Bring in reinforcements - Plugins), 2:47. Free video by Roy Osherove."
usage: "Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page)."
license: "https://creativecommons.org/licenses/by/4.0/"
---

# Ctrl-P

1. [Courses](https://courses.osherove.com/#courses)
2. [Vim Hates You](https://courses.osherove.com/courses/vim-hates-you/)
3. Bring in reinforcements - Plugins

Lesson 18 of 26

Duration: 2:47 [Watch on YouTube](https://www.youtube.com/watch?v=Hp6G43Y-B-M)

## In this lesson

Roy installs the Ctrl-P plugin, a fuzzy file finder, through the vimrc file and PlugInstall, restarting Vim because it reads the vimrc on load. Pressing Ctrl-P lists the files in all subfolders of the current location, and typing part of a file name finds the file so that Enter opens it. He compares this with browsing in NERDTree and finds a combination of the two useful.

## Transcript

401 words

[\[00:11\]](https://www.youtube.com/watch?v=Hp6G43Y-B-M&t=11s) Another very powerful plugin that I like to have running inside Vim is Ctrl P. And this is basically a fuzzy file finder. Let's say we want to install this and so I can explain what it really is and how to use it. Let's install it again by pasting this inside vimrc. So, let me go back into Vim and let's do a home slash sorry dot vimrc

[\[00:42\]](https://www.youtube.com/watch?v=Hp6G43Y-B-M&t=42s) And add this plugin. So, I'm going to put an O here. Paste a new line. Escape. Right quit. Now let me turn on Vim again and do a PlugInstall. And the reason I restarted Vim is because Vim Vim has to read the vimrc file on load. And technically we can also create later like a function that automatically reloads the Vimrc file. But for now I just do it this way and it's it's pretty nice and simple.

[\[01:13\]](https://www.youtube.com/watch?v=Hp6G43Y-B-M&t=73s) So now we have Ctrl P installed. So what does it actually do? Let me close this current window. If I press Ctrl P, what you see is that I have this menu inside which actually shows all the default the number of files that I can actually search through. And there's a lot of stuff in there. So, let me instead quit and go into just the current Vim. Just open Vim here directly in this. And if I press Ctrl P, it actually shows all the files in all the subfolders of all the places that I'm in.

[\[01:48\]](https://www.youtube.com/watch?v=Hp6G43Y-B-M&t=108s) Let me press escape for a second. Let's open NERDTree so you can see what I'm talking about. NERDTree. Let's see. And this is the NERDTree. And this is all the file the files on my current file system. So instead of searching for something inside NERDTree, I can technically just press Ctrl P and just type part of the file name and it will automatically try to find that file somewhere inside my folder structure.

[\[02:23\]](https://www.youtube.com/watch?v=Hp6G43Y-B-M&t=143s) First and you can see that it's the first thing that's already selected. I just press enter and I have the file. Let me switch to hello world. Ctrl P. Hello world. Enter. And I have the file. So it's a very very powerful very very easy to use plugin. And technically you're not you don't even need a tree of files on the left but a combination of both of these is very very useful.

[Previous lesson NerdTree in Vim](https://courses.osherove.com/courses/vim-hates-you/nerdtree-in-vim/) [Next lesson Find text in multiple files with AG](https://courses.osherove.com/courses/vim-hates-you/find-text-in-multiple-files-with-ag/)


---

## About the author

**Roy Osherove**: Senior Solutions Architect at AWS working on AI for production and AI-driven development; author of The Art of Unit Testing and Elastic Leadership, with about 20 years of consulting and training on unit testing, TDD, team leadership and continuous delivery.

### Sites

- [RobotPaper](https://robotpaper.ai/): This blog: AI patterns and anti-patterns, AI and coding agents, and engineering leadership.
- [osherove.com](https://osherove.com): Roy's personal site. Author of The Art of Unit Testing and Elastic Leadership; consulting and training on unit testing, TDD, team leadership and continuous delivery, plus about 20 years of blog posts.
- [The Art of Unit Testing](https://www.artofunittesting.com): The Art of Unit Testing, 3rd Edition (Manning): readable, maintainable, trustworthy unit tests, plus TDD workshops in C#, JavaScript, Java and Kotlin.
- [5whys.com](https://www.5whys.com): Roy's writing on software team leadership: self-organizing teams, surviving chaos, learning mode and the Elastic Leadership model.
- [Pipeline Driven](https://pipelinedriven.org): Continuous delivery and DevOps practices: build patterns, pipeline-friendly testing, DevOps metrics and enterprise DevOps.
- [Elastic Leadership](https://www.elasticleadership.com): Elastic Leadership, Roy's framework for software team leaders (survival, learning and self-organizing modes).

### Social

- X: https://x.com/royosherove
- LinkedIn: https://www.linkedin.com/in/osherove/

### Contact

- Contact form: https://forms.gle/jQSx5KoXvrVA1JCK7

### License

Licensed under CC BY 4.0 — reuse, quote and adapt with attribution (Roy Osherove, link to the original page). License: https://creativecommons.org/licenses/by/4.0/
