You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Eclipse的Ctrl+K快捷键在VS Code中的等效操作及PHP函数跳转方法

Answers to Your VS Code PHP Development Questions

Hey there! Since you're transitioning from Eclipse to VS Code for PHP projects, let's tackle your two key questions:

1. Equivalent of Eclipse's Ctrl+K/Ctrl+Shift+K for Jumping to Same Words

VS Code does have built-in commands for this, though the default shortcuts differ from Eclipse:

  • To jump to the next occurrence of the currently selected word: Use F3 (this matches Eclipse's Ctrl+K behavior)
  • To jump to the previous occurrence: Use Shift+F3 (matches Eclipse's Ctrl+Shift+K)

If you’d rather stick with Eclipse’s original keybindings, you can customize them easily:

  1. Open the Keyboard Shortcuts panel with Ctrl+K Ctrl+S (or go to File > Preferences > Keyboard Shortcuts)
  2. Search for "Find Next" – this is the command Eclipse’s Ctrl+K triggers
  3. Click the pencil icon next to the command, press Ctrl+K, and save the new shortcut
  4. Repeat for "Find Previous", setting it to Ctrl+Shift+K

2. Jumping to Function Definitions in VS Code

VS Code supports this behavior just like Eclipse, but you’ll need the right PHP language support extension (your PHP formatter only handles code formatting, not code navigation):

Step 1: Install a PHP Language Extension

Grab one of these popular extensions to enable PHP code intelligence:

  • PHP Intelephense: A robust, feature-rich extension that provides excellent code navigation, autocompletion, and definition lookup
  • PHP IntelliSense (Felix Becker): A widely used extension with reliable basic code navigation features

Step 2: Use the Navigation Features

Once the extension is installed and active:

  • Hold Ctrl and click the function name: This works exactly like Eclipse – it jumps straight to the function’s definition
  • Use the F12 shortcut: With your cursor on the function name, press F12 to jump to its definition
  • Hover and click: Hover over the function name, and a popup will show the definition’s file path – click the path to jump there (just like Sublime)

Make sure you’ve opened your PHP project’s root folder in VS Code so the extension can index all your files and provide accurate navigation.

内容的提问来源于stack exchange,提问作者Red Bottle

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:14:49