Custom Input UI
Goto Preview includes a feature to override the native vim.ui.input interface with a floating window style that matches your preview windows.
Enabling
To enable this feature, set vim_ui_input = true in your setup:
require('goto-preview').setup {
vim_ui_input = true
}
Behavior
When enabled, any plugin or Neovim command that calls vim.ui.input (like LSP rename actions) will open a small floating window at your cursor position.
Key Controls in Input Window:
<CR>(Enter): Confirm input.<Esc>: Cancel input.
Technical Details
This implementation:
- Creates a scratch buffer.
- Calculates window width based on content (min 20, max 120 columns).
- Sets normal and insert mode mappings for Confirm and Cancel actions.
- Restores the original
vim.ui.inputif the plugin is unloaded (though typically this override persists for the session).