mirror of
https://github.com/pnx/dotfiles
synced 2026-06-18 20:10:03 +02:00
nvim: use dressing and telescope for ui select.
This commit is contained in:
parent
3df60dd8f8
commit
ae5e51873b
3 changed files with 49 additions and 24 deletions
|
|
@ -1,20 +1,5 @@
|
||||||
local icons = require("user.icons")
|
local icons = require("user.icons")
|
||||||
|
local ui = require("user.ui.telescope")
|
||||||
local border = {
|
|
||||||
prompt = { " " },
|
|
||||||
results = { " " },
|
|
||||||
preview = { " " },
|
|
||||||
}
|
|
||||||
|
|
||||||
local dropdown_opts = {
|
|
||||||
previewer = false,
|
|
||||||
prompt_title = false,
|
|
||||||
layout_strategy = "horizontal",
|
|
||||||
layout_config = {
|
|
||||||
prompt_position = "top",
|
|
||||||
},
|
|
||||||
borderchars = border,
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
|
|
@ -22,7 +7,6 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"nvim-telescope/telescope-ui-select.nvim",
|
|
||||||
"sharkdp/fd",
|
"sharkdp/fd",
|
||||||
},
|
},
|
||||||
cmd = "Telescope",
|
cmd = "Telescope",
|
||||||
|
|
@ -44,7 +28,7 @@ return {
|
||||||
["<esc>"] = actions.close,
|
["<esc>"] = actions.close,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
borderchars = border,
|
borderchars = ui.border,
|
||||||
preview = {
|
preview = {
|
||||||
filesize_limit = 0.1
|
filesize_limit = 0.1
|
||||||
},
|
},
|
||||||
|
|
@ -60,7 +44,7 @@ return {
|
||||||
find_files = {
|
find_files = {
|
||||||
hidden = true,
|
hidden = true,
|
||||||
},
|
},
|
||||||
buffers = vim.tbl_deep_extend("force", dropdown_opts, {
|
buffers = vim.tbl_deep_extend("force", ui.dropdown, {
|
||||||
theme = "dropdown",
|
theme = "dropdown",
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
|
|
@ -84,11 +68,6 @@ return {
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
extensions = {
|
|
||||||
["ui-select"] = {
|
|
||||||
require("telescope.themes").get_dropdown(dropdown_opts),
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,32 @@
|
||||||
|
local ui = require("user.ui.telescope")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{
|
||||||
|
'stevearc/dressing.nvim',
|
||||||
|
opts = {
|
||||||
|
input = {
|
||||||
|
border = { " " },
|
||||||
|
relative = "editor",
|
||||||
|
title_pos = "center",
|
||||||
|
mappings = {
|
||||||
|
n = {
|
||||||
|
["<Esc>"] = "Close",
|
||||||
|
["<CR>"] = "Confirm",
|
||||||
|
},
|
||||||
|
i = {
|
||||||
|
["<Esc>"] = "Close",
|
||||||
|
["<CR>"] = "Confirm",
|
||||||
|
["<Up>"] = "HistoryPrev",
|
||||||
|
["<Down>"] = "HistoryNext",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select = {
|
||||||
|
backend = { "telescope" },
|
||||||
|
telescope = require("telescope.themes").get_dropdown(ui.dropdown),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
{ import = "user.plugins.ui.statusline" },
|
{ import = "user.plugins.ui.statusline" },
|
||||||
-- File explorer
|
-- File explorer
|
||||||
{ import = "user.plugins.ui.neotree" },
|
{ import = "user.plugins.ui.neotree" },
|
||||||
|
|
|
||||||
18
nvim/lua/user/ui/telescope.lua
Normal file
18
nvim/lua/user/ui/telescope.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
local border = {
|
||||||
|
prompt = { " " },
|
||||||
|
results = { " " },
|
||||||
|
preview = { " " },
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
border = border,
|
||||||
|
dropdown = {
|
||||||
|
previewer = false,
|
||||||
|
prompt_title = false,
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_config = {
|
||||||
|
prompt_position = "top",
|
||||||
|
},
|
||||||
|
borderchars = border,
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue