Skip to content

Conversation

@hsanson
Copy link

@hsanson hsanson commented Oct 13, 2025

  • Replace the input prompt to use a floating window relative to the cursor instead of vim.ui.input. This makes sending prompts to opencode more pleasant visually and improves usability.
    • To achieve this, many of the xxx_persistent_prompt() methods were renamed and refactored to support a type argument that determines if the prompt window is shown as a floating window or a persistent window at the bottom.
  • Refactor the configuration to a separate module that would allow to extend it easily to support other features.
    • Added some configurations to allow users to set height and width of the floating and persistent prompts.
  • When opening input prompt prefill it with "@cursor" by default or "@selection" if something is visually selected.
  • Added some utilty methods:
    • safe_size, safe_height, and safe_width used to ensure height and width set in configuration have sane values.
      • If given a float between 0 and 1 as input it computes the height/width as a percentage of the window height/width.
    • add_text_at_cursor() method is used to prefill the prompt buffer with text (e.g. @cursor/@selection). It support filling the text from the cursor position and updates the cursor to be at the end of the inserted text. Supports single and multi line text. (Note: generated using Claude 4.0 LLM model).
    • Bonus: allow configuring the icon shown in the prompt title.

Horacio Sanson added 7 commits October 13, 2025 10:47
Refactoring the configuration to a separate module to make it easier
and cleaner to add additional configurations without poluting the
init.lua file.
- Refactor _persistent_ methods to accept a type that allows to
  show/toggle either a prompt input (floating) or a persistent (bottom)
  prompt.
- Add configuration options to set with/height of the prompts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant