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

Feature Request: Add "Open in VS Code" to folder context menu #14

Closed
quinn-p-mchugh opened this issue Oct 31, 2024 · 5 comments
Closed
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@quinn-p-mchugh
Copy link
Contributor

quinn-p-mchugh commented Oct 31, 2024

Hi there,

I'd like to request a small quality of life improvement to make it easier to open folders in VS Code:

Existing Workaround

As discussed in #8, users can configure this plugin to open a specific folder in VS Code by:

  1. Navigating to the plugin's settings page.
  2. Updating the Template for executing the "code" command setting to code "{{vaultpath}}/{{folderpath}}".
  3. Opening a file in Obsidian that is in the top-level directory of the desire folder.
  4. Clicking the VSCode command button on the left sidebar.

Proposed Enhancement

The goal of this enhancement would be to reduce the number of steps it takes to open a folder in VSCode from Obsidian.

To achieve this, I propose adding a new context menu item called Open in VS Code, displayed when the user right-clicks a folder in the Obsidian file explorer. Clicking this menu item would open the selected folder in VS Code.

The new workflow would be as follows:

  1. Navigate to the desired folder in the Obsidian file explorer.
  2. Right-click the folder.
  3. Select "Open in VS Code" in the folder context menu.
    image

To accommodate user preferences, the plugin should provide the ability to enable/disable this context menu item via the plugin settings.

Rationale

My Obsidian vault contains several Git repositories that I frequently need to open in VS Code to make edits and commit changes. This enhancement would make it easier to open these repositories without needing to navigate to specific files within them.

Thanks for the consideration!

@NomarCub NomarCub added enhancement New feature or request help wanted Extra attention is needed labels Oct 31, 2024
@NomarCub
Copy link
Owner

Hi!
I like the idea. Unfortunately I probably won't have the time to work on it until december. But I'll accept PRs if someone wants to implement it before then.

@quinn-p-mchugh
Copy link
Contributor Author

quinn-p-mchugh commented Oct 31, 2024

Hi @NomarCub,

Thanks for the approval!

I may give this a try, but like you, I probably won't be able to prioritize this until December/January. I'll keep you posted.

@NomarCub
Copy link
Owner

NomarCub commented Nov 1, 2024

This plugin has a Create Code File context menu item in the file explorer, that might be a good start: https://github.com/sunxvming/obsidian-vscode-editor.

And now that I look at it, you also have some items in your screenshot that are from plugins, @quinn-p-mchugh.
What are those from, above Rename...?

@quinn-p-mchugh
Copy link
Contributor Author

Hi @NomarCub,

Thanks for the link - always helpful to have a similar solution to reference.

I believe the plugins that correspond to those context menu items are:

  1. Templater
  2. Excalidraw
  3. Linter

@NomarCub
Copy link
Owner

Implemented in the latest version: https://github.com/NomarCub/obsidian-open-vscode/releases/tag/1.3.0.

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

No branches or pull requests

2 participants