lite-xl-plugins icon indicating copy to clipboard operation
lite-xl-plugins copied to clipboard

Add lite-modal plugin

Open Mandarancio opened this issue 1 year ago • 5 comments
trafficstars

Add lite-modal plugin: a fully customizable modal editing for Lite XL

Mandarancio avatar Jul 11 '24 20:07 Mandarancio

In general you can test your changes with:

lpm run --ephemeral https://github.com/Mandarancio/lite-xl-plugins:patch-2 modal

Thank you very much for the information I wanted to test it but I was unable to find this info, would be possible to add some sort of guidelines on how to submit plugins?

Mandarancio avatar Jul 12 '24 07:07 Mandarancio

well... lpm on my arch does not have the flag --ephemeral and if I try with --repository it fail with attempt to index a nil value

Mandarancio avatar Jul 12 '24 07:07 Mandarancio

@Guldoman I will update the plugin configuration using the tips you gave me on the keyhud (using config.plugins and common.merge)

Mandarancio avatar Jul 12 '24 07:07 Mandarancio

would be possible to add some sort of guidelines on how to submit plugins?

Yeah would be a good idea to add it to the README.

well... lpm on my arch does not have the flag --ephemeral and if I try with --repository it fail with attempt to index a nil value

How did you install lpm? Is there any error when you use --ephemeral?

Guldoman avatar Jul 12 '24 18:07 Guldoman

would be possible to add some sort of guidelines on how to submit plugins?

Yeah would be a good idea to add it to the README.

well... lpm on my arch does not have the flag --ephemeral and if I try with --repository it fail with attempt to index a nil value

How did you install lpm? Is there any error when you use --ephemeral?

I checked my install and I saw that I was using a old (1.0.x) version of lpm, I updated it and now it works!

Mandarancio avatar Jul 13 '24 12:07 Mandarancio

I really like the look of this! I'm going to test this now.

adamharrison avatar Jan 05 '25 18:01 adamharrison

If I test this, should I use the most recent commit on your repository?

adamharrison avatar Jan 05 '25 18:01 adamharrison

OK, couple things as I go through this.

  1. You should probably set keymaps to a table; your examples in your README fail with attempt to index a nil value (field 'keymaps') if you try and paste them into your user config; you need to first initialize keymaps to a table.
  2. If you don't specify a keymap for a modal, you get an error in general trying to press any key; should probably default to an empty keymap.
  3. I'd suggest throwing in a full example config that can be just copy and pasted into your user config to allow for easy testing.
  4. on_key_passtrought should be on_key_passthrough

But other than that, I love this. I tested the master branch of the repository. Let me know if that's the commit you'd prefer to pin, and I'll pin that one, and merge this. (And I'll probably write a modal-vim plugin which uses this with a prefab config that replicate vim).

adamharrison avatar Jan 05 '25 19:01 adamharrison

@adamharrison Thank you for your feedback, have you tried together with https://codeberg.org/Mandarancio/lite-modal-hx? It provide a quite complete configuration that mimics the helix mode I will added it to the PR and fix the points you suggested! Thanks again! :)

Mandarancio avatar Jan 17 '25 16:01 Mandarancio

OK, couple things as I go through this.

  1. You should probably set keymaps to a table; your examples in your READM E fail with attempt to index a nil value (field 'keymaps') if you try and paste them into your user config; you need to first initialize keymaps to a table.
  2. If you don't specify a keymap for a modal, you get an error in general trying to press any key; should probably default to an empty keymap.
  3. I'd suggest throwing in a full example config that can be just copy and pasted into your user config to allow for easy testing.
  4. on_key_passtrought should be on_key_passthrough

But other than that, I love this. I tested the master branch of the repository. Let me know if that's the commit you'd prefer to pin, and I'll pin that one, and merge this. (And I'll probably write a modal-vim plugin which uses this with a prefab config that replicate vim).

Hi @adamharrison , I implemented your suggestions, I fixed the nil values as well as the empty keymap and I put a simple but complete example in the readme (and fixed the typo).

I do agree that additionally to the helix preset would be good to have a vi/vim/neovim like configuration, but unfortunately I am very short on time...

Mandarancio avatar Jan 31 '25 14:01 Mandarancio

Sorry about the delay on this. I'm really busy with school and work at the moment, but honestly, this is way overdue. I'm just going to merge this, and will be paying closer attention to it in the coming weeks. Really sorry about the delay.

adamharrison avatar Apr 24 '25 15:04 adamharrison