tgrosinger / leader-hotkeys-obsidian

Use a leader-key (tmux style) for hotkeys in Obsidian.md
GNU General Public License v3.0
80 stars 12 forks source link

leader key not working yet #5

Closed santiyounger closed 2 years ago

santiyounger commented 3 years ago

Hey, super excited to use this plugin

I understand that it doesn't work in preview mode for now, so I'm doing it in edit mode. the problem I have is that if I use the default keybinding ctrl + b Obisdian uses that for making text bold.

Of course the good thing is one can remmap this.

I tried using a few other shortcut, such as alt + q alt + s ctrl + u

but none of them worked

I removed the default Obsidian bold so that leader-hotkeys-obsidian can use ctrl + b but it's not working either.

I'm testing the default mapping such as leader + h to focus on pane on left I open many panes to test it, but I don't get any results.

Specs

I'm on Linux Manjaro XFCE with Awesome Window Manager leader-hotkeys-obsidian 0.1.1 Obisdian 0.9.20

Thanks, looking forward to using this everyday

tgrosinger commented 3 years ago

Hi @santiyounger, just to check can you confirm that this is where you are changing your leader hotkey?

leader

And once you change the leader hotkey, you should see that reflected in the settings page text. See how the leader has been changed to "Mod+w" on the settings page in this example?

leader-settings

Let me know if that is working for you so far. If that is working then we can diagnose why using the hotkeys is not working.

santiyounger commented 3 years ago

Hey, Thanks for taking a look at this,

Yes, that's where I'm mapping the hotkeys indeed

image

image

It didn't work with ctrl + w either (which is an obsidian default for closing windows) I did unmap the original ctrl + w to test.

I'm also curious if there was any reason to use ctrl + b as the default leader key (considering it's a default for bolding) Just out of curiosity, do you remove ctrl + b for bolding out of your default obsidian hotkeys?

Ideally I'd like to map it to space as leader, since I'm so used to it, is there any way for this to be possible (I understand if it's an obisidian limitation, which seems to be the case)

Feel free to let me know if there's anything more you'd need me to share to figure this out.

I'd be curious to know if it's an issue with Linux perhaps, or maybe a conflict with other plug ins? I did make sure it's not a conflict with other existing hotkeys, since I did a lot of different tests to make sure it wasn't that.

Thanks for your time!

tgrosinger commented 3 years ago

Hmm, yeah maybe I should change the default. I have it set to ctrl+b because that's the leader key I use everywhere (I have a Vim plugin that integrates it's panes with tmux panes so I can navigate seamlessly with tmux hotkeys). I do unbind ctrl+b from Bold.

Hmm, if it were mapped to space it would only work when you are in normal mode right? I think that is technically possible, but it would be a pretty big departure from how the plugin is written right now. Currently I have using an Obisidan command to trigger the leader, and that would require switching to instead use a CodeMirror keyPress.

I'll play around with it a bit more and see if I can replicate your experience.

santiyounger commented 3 years ago

thanks, I get you, yeah if you use ctrl + b elsewhere it makes sense since it's on your muscle memory, it's the same thing for me with space but I understand your plugin uses the default hotkeys instead of vim's CodeMirror, that would be amazing, but of course it would mean a whole different process to make it happen.

Thanks for the help, I was looking further into things, not really sure why it's not working for me yet, let me know if you have any ideas or things to try on my side.

Thank you for the help!

Simon-Claudius commented 3 years ago

Thanks for making this plugin @tgrosinger :). I also use space in other applications, so I'd love to be able to use it in Obsidian, too. +1

santiyounger commented 3 years ago

Thanks for making this plugin @tgrosinger :). I also use space in other applications, so I'd love to be able to use it in Obsidian, too. +1

I actually found a workaround for obsidian shortcuts without modifiers https://forum.obsidian.md/t/unable-to-set-a-hotkey-to-f1/7194/3?u=santi

I'm still unsure if this is possible for a key like space but it might work!

delucca commented 3 years ago

+1 for space as the leader key

jaideeprana commented 3 years ago

Yeah, having space would be awesome.

pwntester commented 3 years ago

I actually found a workaround for obsidian shortcuts without modifiers forum.obsidian.md/t/unable-to-set-a-hotkey-to-f1/7194/3?u=santi

I used this trick to define the leader as:

  "leader-hotkeys-obsidian:leader": [
    {
      "modifiers": [
      ],
      "key": " "
    }
  ]

And it worked great

jaideeprana commented 3 years ago

Worked like a charm :)

For me, the name of the file was hotkeys.json file.

pwntester commented 3 years ago

I just found out that this approach will prevent <space> from working on insert mode :(

jaideeprana commented 3 years ago

😭

huyz commented 2 years ago

On macOS, ctrl-w only works for ctrl-w k but not for h,j,l for some reason

santiyounger commented 2 years ago

I just found out that this approach will prevent <space> from working on insert mode :(

so close, let's hope it becomes possible, it'd be incredible to be able to achieve this

ne1114 commented 2 years ago

I actually found a workaround for obsidian shortcuts without modifiers forum.obsidian.md/t/unable-to-set-a-hotkey-to-f1/7194/3?u=santi

I used this trick to define the leader as:

  "leader-hotkeys-obsidian:leader": [
    {
      "modifiers": [
      ],
      "key": " "
    }
  ]

And it worked great

Thank you so much!

delucca commented 2 years ago

I actually found a workaround for obsidian shortcuts without modifiers forum.obsidian.md/t/unable-to-set-a-hotkey-to-f1/7194/3?u=santi

I used this trick to define the leader as:

  "leader-hotkeys-obsidian:leader": [
    {
      "modifiers": [
      ],
      "key": " "
    }
  ]

And it worked great

Thank you so much!

That approach don't work. With that you can't use space in insert mode.

ne1114 commented 2 years ago

I actually found a workaround for obsidian shortcuts without modifiers forum.obsidian.md/t/unable-to-set-a-hotkey-to-f1/7194/3?u=santi

I used this trick to define the leader as:

  "leader-hotkeys-obsidian:leader": [
    {
      "modifiers": [
      ],
      "key": " "
    }
  ]

And it worked great

Thank you so much!

That approach don't work. With that you can't use space in insert mode.

Oh, I haven't tested with space. I wanted to use Alt + A as a prefix and it worked!

{
  "leader-hotkeys-obsidian:leader": [
    {
      "modifiers": [
        "Alt"
      ],
      "key": "A"
    }
  ],
  "maximise-active-pane-obsidian:maximise-active-pane": []
}
canelhasmateus commented 2 years ago

Can we close this issue? @tgrosinger

tgrosinger commented 2 years ago

Yeah, seems outdated. I'm not sure that using space as a leader works still, but it seems like that would require tighter integration with the vim-mode somehow.