karstenpedersen / obsidian-vimium

Interact with elements using keyboard shortcuts in the spirit of Vim.
MIT License
2 stars 0 forks source link

[BUG] Does not work with Vim enabled #1

Open einarpersson opened 5 days ago

einarpersson commented 5 days ago

Hi! I just started using vimium and was very happy to find your plugin. I have installed it and tried it using :obcommand vimium:show-markers. The link markers are shown, but nothing happens when I write the shortcut.

  1. Is this plugin working yet, or is it early WIP?
  2. Do I need to do anything else to get it working? I have vim mode and vimrc plugin working. Is it perhaps a conflict with with other keys? Do I need to add a leader key or something? Or do you have any other idea on what could be the reason it doesn't work?

Thanks and hope you'll keep maintaining this. Link markers was the missing piece for me.

karstenpedersen commented 4 days ago

There should be no leader key. What is :obcommand, is that when you enable Vim in Obsidian to execute commands? What platform are you on?

It could maybe be a conflict with other keys in Vim mode if it also takes the keys. I will test this in the weekend. You can also test it by disabling Vim and vimrc and reloading Obsidian.

einarpersson commented 4 days ago

:obcommand comes from https://github.com/esm7/obsidian-vimrc-support?tab=readme-ov-file#executing-obsidian-commands-with-obcommand and is just a way to invoke obsidian commands, sorry for that confusion.

Yes, I'll check around for potential conflicts.

karstenpedersen commented 3 days ago

Hi I was able to reproduce your problem. It is when you are inside a file and have enabled Settings > Editor > Vim. It takes the keys and Vimium can't get them. This does not happen when you are in the editor and Vim is turned off. I am not sure if its possible to take precedence over the editor and Vim setting when the Vimium: Show markers is running, but I don't think so. I can maybe look into it at some point.

I feel like you could use vimrc support to create shortcuts yourself to run commands you use often.

I have renamed the issue so other people can find it, if they maybe have any ideas on how to fix this.

einarpersson commented 3 days ago

Ok, good that you were able to reproduce it! I hope that you can find a way to solve it, it would be great if these vim-isch modes/tools would work well together. I won't be able to use this plugin if it requires me to inactivate vim mode!

I don't understand what you mean with _"I feel like you could use vimrc support to create shortcuts yourself to run commands you use often.".

I unfortunately haven't done much plugin development so I don't have much input atm:/

karstenpedersen commented 3 days ago

Ok, good that you were able to reproduce it! I hope that you can find a way to solve it, it would be great if these vim-isch modes/tools would work well together. I won't be able to use this plugin if it requires me to inactivate vim mode!

I don't understand what you mean with _"I feel like you could use vimrc support to create shortcuts yourself to run commands you use often.".

I unfortunately haven't done much plugin development so I don't have much input atm:/

I haven't used Vimrc Support but in vim, the text editor, you can create keybinds. On the Vimrc Support Github they show how to map keys: https://github.com/esm7/obsidian-vimrc-support?tab=readme-ov-file#supported-commands

einarpersson commented 2 days ago

I think we are talking past each other:) I have many custom keybindings, yes. I just didn't see how it could be used to create a workaround for the issue here, if that was what you meant.

I know how to activate the marker mode. It is what happens next that is the problem. I want to press SK or LL or whatever.

karstenpedersen commented 2 days ago

I think we are talking past each other:) I have many custom keybindings, yes. I just didn't see how it could be used to create a workaround for the issue here, if that was what you meant.

I know how to activate the marker mode. It is what happens next that is the problem. I want to press SK or LL or whatever.

  1. I suggested you could use vimrc support to create custom keybindings to commands that are used often. This could be a "workaround" to not use the mouse. It is good that you already know this.
  2. I know what the problem is; the plugin doesn't work when Vim is enabled.