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

Yes, SublimeText is available for free, but users are encouraged to purchase licenses. It offers an indefinite free trial, all features are available, but occasionally a window to remind you to purchase a license will pop up; you can use it individually or at will, but purchasing a license can support development and remove reminders; the license is permanently valid and applicable to all platforms, with a single user license fee of $90, supports multi-user and team authorization, and provides educational and bulk discounts; copy the license key to the software after purchase and activate without an account or online activation.

SublimeText's multi-cursor editing feature allows efficient code editing in a variety of ways. First, hold down Alt (Windows/Linux) or Option (Mac) and click to add multiple cursors; secondly, press Ctrl Shift L (or Cmd Shift L) after selecting the text to edit all matches at the same time; thirdly, use Shift Alt to drag the mouse to achieve column selection, and edit multiple rows vertically; in addition, you can gradually expand the selected instance through Ctrl D (or Cmd D), press Esc to exit the multi-cursor mode, and press Ctrl U (or Cmd U) to undo the last cursor addition. These techniques greatly improve the efficiency of code modification.

ToconfigurekeybindingsforbuildsystemsinSublimeText,opentheUserkeybindingsfileviaPreferences>KeyBindings,thenedittherightpanewithcustomJSONentries.EachentryisaJSONobjectspecifying"keys","command",andoptionally"args".Fo

SublimeText has many practical but easily overlooked features. 1. Multiple selection and quick editing: supports multi-cursor operation, splitting and selecting rows, batch modifying the same words to improve the efficiency of processing duplicate content; 2. Fuzzy search expansion function: can jump function definition, specify line number, and global search symbols to facilitate navigation of large projects; 3. Automatic saving and project recovery: no manual saving, it can automatically recover after crash, retaining the multi-task working state; 4. Custom shortcut keys and plug-in extensions: Install plug-ins and custom shortcut keys through the command panel to significantly improve personalized editing efficiency.

To install the SublimeText plug-in, please make sure that PackageControl is installed. If it is not installed, you can get the code from the official website to run it on the console. 1. Open the console (Ctrl `) and paste the installation code. 2. Press Ctrl Shift P to open the command panel. 3. Enter "InstallPackageControl" to install (if not installed yet). 4. Open the command panel again and enter "InstallPackage" to select the corresponding option. 5. Search and select the required plugin in the package list for installation. 6. After the installation is completed, you can enter "ListPackages" in the command panel to confirm whether it is successful. Some plugins may require additional configuration, but

SublimeText's best package improves web development efficiency. 1. Emmet quickly generates HTML/CSS code, such as using the abbreviation div.container to automatically generate complete tags, and supports nested and duplicate elements; 2. SideBarEnhancements enhances file management, providing new templates, trash can move, right-click browser opening and other functions; 3. CSScomb automatically organizes the order of CSS attributes, improves readability and maintenance, and supports custom sorting rules; 4. GitGutter displays code change marks, which facilitates quick view of newly added, deleted or modified lines of code; 5. LSP and language plug-ins provide real-time code prompts such as intelligent completion, jump definition, error checking, etc.

To set up SublimeText for Python development, first install PackageControl, then install the plug-in, configure the build system, and enable automatic formatting. 1. Install PackageControl: Install through the console paste commands; 2. Install plug-ins: such as Anaconda, SublimeREPL, PythonFlake8Lint to enhance functions; 3. Configure the build system: Create a custom Python3.sublime-build file and select the corresponding interpreter path; 4. Enable automatic formatting: Use YAPF or Black combined with shortcut keys to achieve code beautification.

To use SublimeText more effectively, you can refer to the following resources: 1. Official documents and built-in help provide accurate information on core functions and configuration options; 2. YouTube channels such as TheNetNinja and TraversyMedia provide video tutorials; 3. Forums and community websites such as SublimeText forums and Reddit provide plug-ins and question answers; 4. Books and in-depth guides such as "MasteringSublimeText" are suitable for reading long articles; 5. Use PackageControl to install plug-ins such as Emmet and GitGutter to improve efficiency. By combining these resources with different learning methods, Sublim can be comprehensively improved
