NStefan002 / screenkey.nvim

Screencast your keys in Neovim
MIT License
291 stars 5 forks source link

Add win_opts.position #15

Closed biozz closed 3 months ago

biozz commented 4 months ago

The idea comes from the @inferst fork of the screenkey.nvim, where the position of the window is hardcoded. Some streamers have their camera on the bottom left corner of the screen and you cannot see the plugin in action.

This is a backwards compatible change. It is possible to extend it and make more flexible, i.e. position the window anywhere on the screen, but it would complicate things for this proof of concept.

biozz commented 4 months ago

I understand that you want to reuse native nvim_open_win options. I can also see a scenario, when a person doesn't want to dive deep into how nvim internals work and they would like to have a shortcut for those options.

What about a top-level config option 'preset'? The user would quickly start using the plugin with some sane defaults and if they want to customize it even further, they would go into nvim_open_win options.

NStefan002 commented 4 months ago

I can also see a scenario, when a person doesn't want to dive deep into how nvim internals work and they would like to have a shortcut for those options.

I get that, but I think col and row are simple and straightforward options. So, in my opinion, we should not create abstraction over that. Personally, I'd rather have something simple and configurable as (x, y) position - (row, col), than something like top_left, top_right etc. Also, with the options you proposed, you limit yourself to corners of the editor and perhaps someone would like to have their screenkey in the middle-right or above some standard plugin like fidget.nvim.

What about a top-level config option 'preset'? The user would quickly start using the plugin with some sane defaults and if they want to customize it even further, they would go into nvim_open_win options.

I don't know what you mean by preset. The user doesn't have to specify any of the options that get passed to setup function (the default options will be applied automatically). Also, the default options are (in my opinion) very sane - screenkey window gets positioned in the bottom right corner and clears its contents after 3 seconds of inactivity.

biozz commented 4 months ago

Maybe you are right. I changed to row and col options, as you requested.

NStefan002 commented 3 months ago

Sorry, I'm closing this PR since it got stale and I did some work on screenkey in the meantime. However, I added the features you proposed in this PR and added you as an author and contributor. Thank you!