stevearc / dressing.nvim

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

Theme of input not matching Readme.md #155

Closed akshit-sharma closed 1 week ago

akshit-sharma commented 1 month ago

Describe the bug Unable to get the similar appearance of vim.ui.input as shown in readme.md

System information

require'dressing'.setup({
  input = {
    relative = "editor",
    select = {
      relative = "editor",
    },
  }
})

To Reproduce Steps to reproduce the behavior:

  1. Open minimalDressing.lua
  2. press ui to open input prompt
  3. press us to open select prompt
minimumDressing.lua
`minimumDressing.lua` file ```lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazyInstallPath = vim.fn.stdpath("data") .. "/lazy" if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", -- latest stable release lazypath, }) end vim.opt.rtp:prepend(lazypath) vim.opt.termguicolors = true vim.cmd([[colorscheme desert]]) local plugins = { { 'nvim-telescope/telescope.nvim', tag = '0.1.6', dependencies = { 'nvim-lua/plenary.nvim' }, cmd = { "Telescope" }, -- Load Telescope only when the `Telescope` command is used config = function() local telescope = require 'telescope' telescope.setup({ defaults = { prompt_prefix = "? ", selection_caret = "> ", path_display = { "smart" }, }, extensions = { fzf = { fuzzy = true, -- false will only do exact matching override_generic_sorter = true, -- override the generic sorter override_file_sorter = true, -- override the file sorter case_mode = "smart_case", -- or "ignore_case" or "respect_case" -- the default case_mode is "smart_case" }, }, }) end, }, { 'stevearc/dressing.nvim', event = "VeryLazy", config = function() require'dressing'.setup({ input = { relative = "editor", select = { relative = "editor", }, } }) vim.notify("Dressing setup done", vim.log.levels.INFO) end, }, } function UiInputPrompt() vim.ui.input({ prompt = "Enter something: ", theme = require("telescope.themes").get_cursor(), }, function(input) if input then vim.notify("You entered: " .. input, vim.log.levels.INFO) else vim.notify("Input canceled", vim.log.levels.INFO) end end) end function UiSelectPrompt() vim.ui.select({'apple', 'banana', 'mango'}, { prompt = "Title", }, function(selected) if selected then vim.notify("You selected: " .. selected, vim.log.levels.INFO) else vim.notify("Selection canceled", vim.log.levels.INFO) end end) end function DressingSelectPrompt() vim.ui.select({ "first", "second", "third" }, { prompt = "Make selection: ", theme = require("telescope.themes").get_cursor(), }, function(item, lnum) if item and lnum then vim.notify(string.format("selected '%s' (idx %d)", item, lnum), vim.log.levels.INFO) else vim.notify("Selection canceled", vim.log.levels.INFO) end end) end local lazyOpts = { show = false, } require("lazy").setup(plugins, lazyOpts) vim.api.nvim_set_keymap('n', 'ui', ':lua UiInputPrompt()', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'us', ':lua UiSelectPrompt()', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'ds', ':lua DressingSelectPrompt()', { noremap = true, silent = true }) ```

Screenshots inputDressing

Additional context Is this plugin only for vim.ui.select and we are suppose to another plugin for vim.ui.input ? Am I configuring the plugin incorrectly ?

WizardStark commented 2 weeks ago

This looks like the LSP rename element in the README, albeit with some very contrasty highlight groups from your colourscheme. If it is a different float window position/border that you expect then that is achievabke via config, but if its just the colours, then it can be fixed by altering the highlight groups.

akshit-sharma commented 2 weeks ago

If I want have the same appearance as README.

  1. Which colorscheme should I use?
  2. If i want to use the same colorsheme I have, what should I change the highlight groups to?

Thanks

WizardStark commented 2 weeks ago

Most custom themes that I have tried provide colours that work nicely with dressing, the most popular ones being https://github.com/catppuccin/nvim, https://github.com/folke/tokyonight.nvim - see more at https://vimcolorschemes.com/i/trending - if you'd want to find one more to your liking. Also note that the most popular ones often have multiple variants that you can check out.

Otherwise - I see in the provided snippet that you are using desert from the list of prepackaged themes - and if you want to continue using it have a look at setting the winhighlight of the dressing window to the regular background colour. Using desert on my machine doing :hi FloatBorder guibg=grey20 does the trick: image

akshit-sharma commented 1 week ago

Thanks.

hi FloatBorder did the trick.

I will look into another colorschemes as well.