stevearc / dressing.nvim

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

Difficult to see Input border and title #42

Closed Firaenix closed 2 years ago

Firaenix commented 2 years ago

System information

require('dressing').setup({
  input = {
    -- Set to false to disable the vim.ui.input implementation
    enabled = true,

    -- Default prompt string
    default_prompt = "Input:",

    -- Can be 'left', 'right', or 'center'
    prompt_align = "left",

    -- When true, <Esc> will close the modal
    insert_only = true,

    -- These are passed to nvim_open_win
    anchor = "SW",
    border = "rounded",
    -- 'editor' and 'win' will default to being centered
    relative = "cursor",

    -- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
    prefer_width = 40,
    width = nil,
    -- min_width and max_width can be a list of mixed types.
    -- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
    max_width = { 140, 0.9 },
    min_width = { 80, 0.2 },

    -- Window transparency (0-100)
    winblend = 0,
    -- Change default highlight groups (see :help winhl)
    winhighlight = "",

    override = function(conf)
      -- This is the config that will be passed to nvim_open_win.
      -- Change values here to customize the layout
      return conf
    end,

    -- see :help dressing_get_config
    get_config = nil,
  },
  select = {
    -- Set to false to disable the vim.ui.select implementation
    enabled = true,

    -- Priority list of preferred vim.select implementations
    backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },

    -- Trim trailing `:` from prompt
    trim_prompt = true,

    -- Options for telescope selector
    -- These are passed into the telescope picker directly. Can be used like:
    -- telescope = require('telescope.themes').get_ivy({...})
    telescope = require('telescope.themes').get_cursor({ winblend = 5 }),

    -- Used to override format_item. See :help dressing-format
    format_item_override = {},

    -- see :help dressing_get_config
    get_config = nil,
  },
})

To Reproduce Steps to reproduce the behavior:

  1. Use onedark vim theme (https://github.com/joshdick/onedark.vim)

Screenshots image

I've tried out a few colorschemes with dressing.nvim but cant seem to find a suitably visible border and title theme. Is it possible to change the input theme in the dressing config?

stevearc commented 2 years ago

onedark seems to not define the NormalFloat highlight (see :help NormalFloat). Try either doing :highlight link NormalFloat Normal or if you just want to configure it for the dressing windows, you can use winhighlight:

require('dressing').setup({
  input = {
    winhighlight = "NormalFloat:Normal",
  }
})
nanozuki commented 2 years ago
image

When I set "NormalFloat:Normal", I also have the same issue. I use the theme rose-pine-dawn. I tried some

cpea2506 commented 2 years ago

onedark seems to not define the NormalFloat highlight (see :help NormalFloat). Try either doing :highlight link NormalFloat Normal or if you just want to configure it for the dressing windows, you can use winhighlight:

require('dressing').setup({
  input = {
    winhighlight = "NormalFloat:Normal",
  }
})

Thanks, i've been finding this for so long. Now it works as expected.

Screen Shot 2022-06-02 at 15 53 11
nanozuki commented 2 years ago

After reading help winhighlight and floatwin-api, I found that I want to change the highlight of the floating windows' title. But I don't know what highlight group to replace...

cpea2506 commented 2 years ago

After reading help winhighlight and floatwin-api, I found that I want to change the highlight of the floating windows' title. But I don't know what highlight group to replace...

There are 3 things you can change

NormalFloat
FloatTitle
FloatBorder
nanozuki commented 2 years ago

There are 3 things you can change

NormalFloat
FloatTitle
FloatBorder

Ok, I see the 'rose pine' to set highlight as this:

FloatBorder  guifg=#dfdad9
FloatTitle   links to FloatBorder
NormalFloat  guifg=#575279 guibg=#fffaf3

They don't set the FloatTitle(FloatBorder)'s background, and the FloatTitle uses the background from NormalFloat. So the text is hard to recognize.

cpea2506 commented 2 years ago

There are 3 things you can change

NormalFloat
FloatTitle
FloatBorder

Ok, I see the 'rose pine' to set highlight as this:

FloatBorder  guifg=#dfdad9
FloatTitle   links to FloatBorder
NormalFloat  guifg=#575279 guibg=#fffaf3

They don't set the FloatTitle(FloatBorder)'s background, and the FloatTitle uses the background from NormalFloat. So the text is hard to recognize.

Ye. And i see that rose-pine has option for you to set these highlight: https://github.com/rose-pine/neovim#options

Screen Shot 2022-06-02 at 21 24 13
nanozuki commented 2 years ago

Oh, that's right, I missed that, thank you!

Firaenix commented 2 years ago

Thank you very much for your help! I'm a neo/vim noob so I appreciate the swift response.