Skip to content

bug: ui_select picker starts in normal mode, preventing typing of motion characters #2642

@RizaHKhan

Description

@RizaHKhan

Did you check docs and existing issues?

  • I have read all the snacks.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of snacks.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.12.0-dev-1909+g922816877f

Operating system/version

WSL2

Describe the bug

When Snacks overrides vim.ui.select with picker.ui_select = true, the picker opens in normal mode with focus on the list window. This makes it impossible to type certain characters like b, w, e, etc., as they trigger Vim motions (backward word, forward word, end of word) instead of being typed into the filter input.

Steps To Reproduce

  1. Enable Snacks picker with ui_select = true:
    require("snacks").setup({
    picker = {
    ui_select = true,
    }
    })
  2. Use any plugin that calls vim.ui.select() (e.g., Kulala's environment switcher)
  3. Try to type the letter 'b' in the picker
  4. Observe that the cursor jumps (backward word motion) instead of typing 'b'

Expected Behavior

When the picker opens for vim.ui.select, it should:

  • Start in insert mode automatically, OR
  • Focus the input window and be in insert mode
    This would allow users to immediately start typing to filter options without needing to press i first.

Current Workaround:

Disable Snacks' ui_select override:
picker = {
ui_select = false,
}

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/snacks.nvim", opts = {} },
    -- add any other plugins here
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThis issue or PR has been inactive for a whilewontfixThis issue will not be fixed or implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions