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: follow link under cursor #2

Closed
harveyr opened this issue Jul 7, 2020 · 6 comments
Closed

Feature request: follow link under cursor #2

harveyr opened this issue Jul 7, 2020 · 6 comments
Assignees
Labels
feature New feature or request

Comments

@harveyr
Copy link

harveyr commented Jul 7, 2020

Like in Obsidian, it would be great if something like cmd-enter would open the link under your cursor. Even better than Obsidian: it would be great if this worked not only for links to [[other notes]] but also https://external-links.

Thanks!

@svsool
Copy link
Owner

svsool commented Jul 7, 2020

Hello, @harveyr!

About cmd-enter, it should actually work out of the box in VSCode if you bind command called "Open link" to cmd-enter.

That's how I have it in my keybindings.json

image

About opening https://external-links, thanks for the idea I will add it on my list.

@harveyr
Copy link
Author

harveyr commented Jul 7, 2020

Thank you!

@harveyr harveyr closed this as completed Jul 7, 2020
@harveyr
Copy link
Author

harveyr commented Jul 7, 2020

Followup: the Open Link command appears to work both for internal links and web URLs, so there's nothing for you to add to your list. :)

@svsool svsool added question Further information is requested feature New feature or request and removed question Further information is requested labels Jul 18, 2020
@svsool svsool self-assigned this Jul 18, 2020
@RoneoOrg
Copy link

In plain text, easier to copy and paste:

    // Follow Markdown link (requires Markdown Memo)
    {
      "key": "ctrl+enter",
      "command": "editor.action.openLink"
    }

You can open keybindings.json with Ctrl+Shift+POpen Keyboard Shortcuts (JSON)

@memeplex
Copy link
Contributor

I would like to revisit this issue. I see two things undesirable about the proposed solution:

  1. It's not active by default even though following links is so important to Memo. Moreover, there is an asymmetry in that C-S-Enter works OOTB. This amounts to a confusing initial experience.
  2. C-Enter conflicts with such a basic vscode editing command as Insert Line Below.

I propose to provide C-M-Enter (Ctrl-Alt-Enter or Cmd-Opt-Enter) as a default shortcut. AFAICS it's not taken by vscode.

@revett
Copy link

revett commented Mar 9, 2023

I use the following to avoid it clashing with other cmd+enter shortcuts:

{
  "key": "cmd+enter",
  "command": "editor.action.openLink",
  "when": "editorTextFocus && resourceExtname == .md"
 }

Taken from: https://stackoverflow.com/questions/69261812/is-there-a-way-to-enable-keyboard-shortcuts-only-when-specific-file-types-are-op

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

No branches or pull requests

5 participants