Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat]: Add user input for options. #14

Open
AlejandroSuero opened this issue Jun 9, 2024 · 0 comments
Open

[Feat]: Add user input for options. #14

AlejandroSuero opened this issue Jun 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@AlejandroSuero
Copy link
Owner

Is your feature request related to a problem? Please describe

For example:

require("freeze-code").setup({
  freeze_config = {
    theme = "rose-pine-moon",
  },
  dir = "/tmp",
})

With this user config the user could have a base config when using it, but if for example want to change the dir to for example the current project to add to an assets directory, it will have to change the config and reload the plugin.

Describe the solution you'd like

  • Expose to the plugin options an entry like input_opts = { dir = false, theme = false, ... }.
  • Add a function that takes the current options and the options to change based on the input_opts.
  • Create a command for better use FreezeAs (like save as).
  • If command, then show an options changer with vim.ui.input for every input_opts[opt] = true.

Describe alternatives you've considered

  • Creating a vim.ui.select with the options to chose like:
prompt: Choose what option to change
1. dir
2. theme
3. config
4. ...
  • If one of the selected, show vim.ui.input to change that plugin_opt, ask for a choice again and if choice == nil don't show again, continue freeze.

Additional context

Something like this from my dotfiles for choosing fugitive actions:

Screen.Recording.2024-06-09.at.23.57.11.mov
@AlejandroSuero AlejandroSuero added the enhancement New feature or request label Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant