Skip to content

[Suggestion]: Add functionality to clear the nvim picker input #629

Description

@GunawanAhmad

Which fff frontend(s)?

Neovim plugin (fff.nvim)

What problem are you trying to solve?

I usually use <C-u> to clear the current input, so I keep reaching for it in the picker.

Right now the Neovim picker does not have a way to clear the input query. I know <C-u> is currently mapped to preview_scroll_up by default, but that can already be remapped.
What I need is a function for clearing the query, so I can move preview scrolling with another key and use <C-u> for clearing input.

For example:

keymaps = {
  clear_query = '<C-u>',
  preview_scroll_up = '<C-b>',
  preview_scroll_down = '<C-b>',
}

Proposed solution

Add a new clear_query action to the picker keymaps.

For example:

keymaps = {
clear_query = '<C-u>',
preview_scroll_up = '<C-b>',
preview_scroll_down = '<C-b>',
}

clear_query would clear the current picker input, keep the picker open, and keep focus in the prompt so the user can immediately type a new query.

Maybe the default for clear_query can be unset.

This would let users remap preview scrolling away from <C-u> while keeping the current default behavior unchanged for existing users.

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