darlal/obsidian-switcher-plus

Hover Editor Ctrl + P Conflict

julroger2013 opened this issue · 3 comments

Hello—

This came up a while ago, and I thought I would raise it again.

On Windows OS, there is a shortcut conflict for <ctrl + p> between Switcher++ and Hover Editor.

Hover Editor designates this shortcut for opening a Switcher++ entry in a Hover Editor popup; Switcher ++ designates it as equivalent to the up arrow for navigating the search results.

The shortcut makes sense for both apps (and I recognize that ctrl + p is a common navigation shortcut more generally). It's just that I don't think I can resolve the conflict myself without manually tinkering with the code in one of the two plugins.

Is it possible you might be able to add a toggle for whether the <ctrl + p> shortcut functions in Switcher++? I've put in a parallel issue in the Hover Editor repository.

Thank you again for making this fantastic plugin. I haven't used Obsidian's built-in switcher in ages!

darlal commented

Hey @julroger2013 I'm thinking that I will just externalize this to the settings file, that way, users can remove the ones they don't want, or even add a different hotkey altogether, while not breaking existing users who depend on this feature. That would allow you to change/remove that hotkey to get the behavior you want. Sorry this has gone unresolved for so long.

That would be wonderful. And I am sorry to be the squeaky wheel — certainly I do not view this as an issue you should feel obligated to resolve.

Thank you for considering.

darlal commented

Release 3.3.4 externalizes the navigation keys out to the plugin settings file. You'll have to modify the settings file directly, but at least you have way of making this change now. If you're comfortable modifying a text json file, try the following:

  1. Update to the latest release
  2. Navigate to the Switcher++ settings pane in Obsidian. Toggle any of the settings on/off again, this is just to force Obsidian to write to disk an updated settings file.
  3. Close Obsidian
  4. Make a backup copy of the Switcher++ settings data.json file. That file is typically stored in vault-root/.obsidian/plugins/darlal-switcher-plus/data.json
  5. Open the data.json file in a text editor
  6. Search for the key nextKeys, there should only be one match, which should be nested under a navigationKeys key.
  7. You'll want to modify/remove the ctrl+n ctrl+p pairs.

By default, it might look something like this:

    "nextKeys": [
      {
        "modifiers": [
          "Ctrl"
        ],
        "key": "n"
      },
      {
        "modifiers": [
          "Ctrl"
        ],
        "key": "j"
      }
    ],

And when you're done, you want it to look like this:

    "nextKeys": [
      {
        "modifiers": [
          "Ctrl"
        ],
        "key": "j"
      }
    ],

This will remove the ctrl+n hotkey, now do the same editing steps for prevKeys to remove the ctrl+p hotkey. Save the data.json file, restart Obsidian. This should remove the hotkey conflict, of course if you just want to change the navigation keys to something else, you can do that too now.