summaryrefslogtreecommitdiffstatshomepage
path: root/nvim/.config/nvim/lua/tobyvin/plugins/dressing.lua
blob: b74d134c695603093d125c4d05368dde23783341 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local themes = require("telescope.themes")
local backends = require("dressing.config").get_mod_config("select").backend
local M = {}

M.kinds = {
	select = {
		select_normal = {
			telescope = themes.get_dropdown({ initial_mode = "normal" }),
		},
	},
}

M.setup = function()
	local status_ok, dressing = pcall(require, "dressing")
	if not status_ok then
		vim.notify("Failed to load module 'dressing'", "error")
		return
	end

	dressing.setup({
		select = {
			get_config = function(opts)
				if vim.tbl_contains(M.kinds, opts.kind) then
					return M.kinds.select[opts.kind]
				elseif vim.tbl_contains(backends, opts.kind) then
					return { backend = opts.kind }
				end
			end,
		},
	})
end

return M