stevearc / dressing.nvim

Neovim plugin to improve the default vim.ui interfaces
MIT License
1.69k stars 32 forks source link

[Question] option to disable titles #133

Closed sand4rt closed 6 months ago

sand4rt commented 6 months ago

Thanks for the awesome plugin!

Do you know if there is an option to disable all the titles? In this case "New Name:":

Screenshot 2024-01-07 at 00 58 22
stevearc commented 6 months ago

There is no way to disable the titles. Part of the interface for vim.ui.input is providing prompt text, so the plugin author or whoever is calling vim.ui.input is assuming that you will be able to read the prompt. In some cases maybe it isn't important, but we can't make the assumption that it's never important. As far as I'm concerned, displaying the prompt is part of the API contract for vim.ui.input.

sand4rt commented 4 months ago

I ended up using:

-- LazyVim config
return {
    "stevearc/dressing.nvim",
    event = "VeryLazy",
    config = function()
        require("dressing").setup({
            input = {
                border = "single",
            },
            select = {
                enabled = false,
            },
        })
        local input = vim.ui.input
        vim.ui.input = function(opts, on_confirm)
            opts.prompt = ""
            input(opts, on_confirm)
        end
    end,
}