Skip to content

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

Open
@AlejandroSuero

Description

@AlejandroSuero

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions