How do I use the 'Goto Anything' feature in Sublime Text (Ctrl P)?
Jun 29, 2025 am 12:10 AMSublime Text's "Goto Anything" function (triggered by Ctrl P) can greatly improve project navigation efficiency. 1. Quickly open the file: Press Ctrl P and enter some file names or paths to filter and open the target file in real time, supporting camel naming matching; 2. Jump to symbols: Enter @-plus symbol names (such as functions and classes) after Ctrl P, and you can jump directly to the corresponding code block; 3. Positioning line numbers: Use after file names or in the current file: Adding numbers can jump to specific lines for easy debugging; 4. Global search assistance: Use Ctrl Shift F to quickly search content between files, which is more efficient in conjunction with Goto Anything. After mastering these techniques, quickly positioning with the keyboard will become a natural habit in coding.
If you're trying to navigate your project quickly in Sublime Text, the "Goto Anything" feature (triggered with Ctrl P) is one of the most powerful tools at your disposal. It's not just for opening files—it can help you jump to symbols, lines, and even specific parts of your codebase without ever touching the mouse.
Open Files Fast
The most common use of Goto Anything is to open files quickly. Once you hit Ctrl P , a popup appears at the top of the editor showing a list of files in your current project.
Just start typing part of the filename or path, and it filters the results in real time. You don't need to type the full name—Sublime Text is smart enough to guess what you're looking for based on partial matches.
For example:
- Typing
read
might bring upREADME.md
- Typing
log
could showutils/logger.js
You can also use camel-case matching: typing UL
would match UserInfoList.vue
.
Once you see the file you want, hit Enter to open it.
Jump to Symbols with @
If you want to go directly to a function, class, or other symbol within a file, use the @ symbol after opening Goto Anything.
After pressing Ctrl P , type @
followed by part of the symbol name. For example:
- In a JavaScript file, typing
@init
might take you to a function calledinitializeApp()
. - In a CSS file, typing
@container
could jump to.main-container
.
This works across many languages ??and helps you skip scrolling through long files.
If there are multiple symbols that match, you can keep typing more letters to narrow it down.
Go to Line Number with:
Another handy trick is jumping to a specific line number in a file. Just use : after the filename or while already in the file.
Here's how:
- Press Ctrl P
- Type the filename (or just start typing if you're already filtering)
- After the filename, type
:25
to jump to line 25 - Or, while already in a file, press Ctrl Pa again and type
:25
directly
This is especially useful when debugging or following error logs that reference specific line numbers.
You can even combine this with symbol navigation:
- Try typing
:MyFunction
to jump to a function namedMyFunction
in the current file
Search Across Files (Bonus Tip)
While not part of Goto Anything directly, it's worth knowing that if you want to search across files quickly, you can use Ctrl Shift F to bring up the global search panel. This complements Goto Anything by helping you find where something is before navigating to it.
Using Goto Anything effectively takes just a few shortcuts and habits, but it can seriously speed up your workflow. The key is to get comfortable with the syntax ( @
for symbols, :
for lines), and let muscle memory take over. Once you do, switching between files and diving into functions become second nature.
And honestly, once you get used to it, going back to clicking around in the sidebar feels like a step backward.
The above is the detailed content of How do I use the 'Goto Anything' feature in Sublime Text (Ctrl P)?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

1. Make sure that automatic completion is enabled: Check the user settings in Preferences>Settings and confirm "auto_complete": true; 2. Make sure that there is complete content in the file: Sublime's default automatic completion depends on existing text for suggestions, and it is necessary to manually enter duplicate content to trigger; 3. Install PackageControl and language plug-ins: such as SublimeJEDI or tern to obtain smarter code suggestions; 4. Restart or reset settings: Try restarting the software, delete the settings file, or run safe mode to troubleshoot problems. The above steps can be checked and fixed in the SublimeText that automatically completes failures.

Yes, you can install PackageControl in SublimeText through the following steps: 1. Open the console and use the shortcut key Ctrl ` or menu View>ShowConsole; 2. Paste the installation code to the console, the code content is importurllib.request,os,hashlib;h='2915d1851351e5ee549c20394736b442' '8bc59f460fa1548d1514676163dafc88';pf='PackageControl.sublime-package';ipp=subli

Solutions to slow startup of SublimeText include: 1. Uninstall uncommon plug-ins and enter safe mode to troubleshoot plug-ins; 2. Simplify project configuration and avoid loading large directories; 3. Clear cache or reset user settings; 4. Use SSD and close background programs to improve system resources. Due to factors such as plug-in conflicts, large-scale project loading, cache exceptions and hardware performance, it is recommended to troubleshoot the above problems in turn to optimize startup efficiency.

The most likely cause of the problem is that the build system is misconfigured or the program execution is too fast, so the output cannot be displayed. First check whether Tools>BuildSystem has selected the correct language (such as Python, C, etc.). If you use custom configuration, you need to verify that the command syntax is correct and test whether there is output through print("Hello"); secondly, if the program runs too quickly, you can add input("PressEntertoexit...") at the end of the script or modify the .sublime-build file to add pause commands such as "cmd":["s

SublimeText can implement the "jump to definition" function by installing the CTags plugin. First make sure that PackageControl is installed. If it is not installed, the installation will be completed through the official guide; then select "PackageControl:InstallPackage" through the command panel (Ctrl Shift P or Cmd Shift P) to search and install the CTags plug-in; then you need to install the ExuberantCtags or UniversalCtags tool, run ctags-R in the project root directory. Generate tags file; finally place the cursor on the target symbol and use the shortcut key Ctrl Shift Down

SublimeText can run linter or formatter through a custom build system. 1. Create .sublime-build file and configure commands, such as running Prettier with npxprettier; 2. Create multiple build systems for different tools or languages; 3. Use similar methods to configure ESLint and other linters to ensure that corresponding tools are installed and commands are adjusted; 4. Automatic formatting is achieved through plug-ins or scripts, or manually bind shortcut keys to perform formatting and saving operations.

SublimeText will not be updated automatically and requires manual operation. 1. First visit the official website sublimetext.com to view the latest version number and confirm whether the current installed version is too old; 2. View the local version through the Help>AboutSublimeText menu and compare it; 3. Backup settings before update: Enter Preferences>BrowsePackages to copy the Packages folder or use the PackageControl synchronization function; 4. After downloading the new version, operations are based on different systems: Windows run the installer, macOS drag and drop to replace the application, Linux is decompressed to the original directory; 5. Check after the update is completed

ToenhanceVue.jsdevelopmentinSublimeText,installVuesyntaxhighlightingviaPackageControl,setupEmmetforfasterHTMLtemplating,integrateESLintandPrettierforlintingandformatting,configurekeysettingslikeparserandformat-on-saveoptions,andoptionallycreatecustom
