Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add configurable external editor support for component selection #748

Open
antharuu opened this issue Oct 23, 2024 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@antharuu
Copy link

🆒 Your use case

Currently, when selecting a component in Nuxt DevTools using the selection tool, it automatically opens Visual Studio Code by default. However, many developers use different IDEs, and it's frustrating when VSCode is opened, especially when it’s not the primary editor.

🆕 The solution you'd like

I suggest adding an optional configuration field similar to what Godot offers for external editors: Godot External Editor Configuration. This field would allow developers to specify their preferred editor and how to pass file and cursor position (line, column) to that editor.

The field could default to VSCode but provide customization options for other editors.

Example configuration options:

  • Editor: The name of the external editor (e.g., Atom, JetBrains IDE, Vim, Emacs, Sublime Text).
  • Exec Flags: The command-line flags to open the selected component in the correct file and position. Examples:
    • Atom: {file}:{line}
    • JetBrains IDE: {project} --line {line} {file}
    • Vim (gVim): "+call cursor({line}, {col})" {file}
    • Emacs: emacs +{line}:{col} {file}
    • Sublime Text: {project} {file}:{line}:{column}

🔍 Alternatives you've considered

Another option would be to simply open the file with the system's default application for .vue files. While this might be more practical in some situations, it can lead to issues if the system default is not properly configured, as it could open in something like Notepad or another undesired application.

ℹ️ Additional info

This feature could remain optional with a VSCode default, but having flexibility would greatly improve the workflow for developers who do not use VSCode as their primary IDE.

@antharuu antharuu added the enhancement New feature or request label Oct 23, 2024
@larryh
Copy link

larryh commented Oct 26, 2024

As a user of JetBrains (Rubymine) I would love to see this.

@Jakub-Horacek
Copy link

I would also love this feature in the Nuxt Devtools. I recently started to use Cursor instead of the VS Code. Even tho Cursor is a fork of the VS Code, I would love the Nuxt Devtools component inspector to open my components in the Cursor editor instead of the VS Code.

@ItsRyanWu
Copy link

Hey how to change it to Windsurf?
Now Cursor is the default one for me and I don't know how it did it.

@antfu
Copy link
Member

antfu commented Dec 18, 2024

Nuxt DevTools use launch-editor to do that:

Where it should automatically detect your editor based on where you start the process. You can also override it with env LAUNCH_EDITOR=codium as suggested in the docs.

@antharuu
Copy link
Author

Oh ok, maybe adding a drop-down list of supported editors would be easier and more useful. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants