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

如何在VSCode中高亮显示光标所在列位置?

Replicate Atom's Dynamic Crosshair Cursor Highlight in VS Code

Hey there! I totally get that craving for Atom's subtle crosshair effect—where your cursor's current row and column both get a faint, dynamic highlight, creating that准星-like marker that follows you as you move. The static column lines or multi-cursor tools you found aren't the same, so let's fix that.

Here are two reliable ways to get this working in VS Code:

1. No Plugin Required: Customize via Settings

You can tweak VS Code's built-in highlighting directly to match the effect. Here's how:

  • Open your settings with Ctrl+, (Windows/Linux) or Cmd+, (Mac).
  • Click the curly braces {} icon in the top-right corner to open the raw JSON settings file.
  • Add these lines to adjust the line and column highlights—tweak the color values to get that faint, unobtrusive look (use rgba for transparency):
"workbench.colorCustomizations": {
    // Faint horizontal line highlight (matches Atom's default row highlight)
    "editor.lineHighlightBackground": "rgba(128, 128, 128, 0.05)",
    // Faint vertical column highlight that follows your cursor
    "editorCursor.columnHighlightBackground": "rgba(128, 128, 128, 0.05)"
}

Save the file, and you'll immediately see the crosshair effect whenever your cursor moves.

2. Use a Dedicated Plugin

If you want more control or don't want to mess with JSON settings, try a plugin built specifically for this:

  • Search for "Crosshair Cursor" in the VS Code Extensions marketplace. This plugin adds a dynamic crosshair that follows your cursor, with options to adjust highlight intensity, color, and even toggle the effect on/off quickly.
  • Another option is "Highlight Current Column"—it focuses on column highlighting, which pairs perfectly with VS Code's default row highlight to create the crosshair.

The key difference here from what you found earlier is that these solutions are dynamic: the vertical highlight moves with your cursor, instead of being a fixed line at a specific column number.

Hope this gets you that familiar Atom-style crosshair! Let me know if you need help fine-tuning the colors or plugin settings.

内容的提问来源于stack exchange,提问作者Matt Molnar

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.28 17:18:14