feat(ui): improve UI

This commit is contained in:
doryan 2025-04-13 00:19:42 +04:00
parent e87eae6dd8
commit 3c5dde045b
4 changed files with 136 additions and 60 deletions

View File

@ -44,5 +44,4 @@ require('gitsigns').setup {
row = 0,
vcol = 1,
},
yadm = { enable = false },
}

View File

@ -1,7 +1,9 @@
require("hover").setup {
init = function()
require("hover.providers.lsp")
require('hover.providers.diagnostic')
require("hover.providers.diagnostic")
require("hover.providers.dap")
require("hover.providers.dictionary")
end,
preview_opts = {
border = 'single'

View File

@ -12,4 +12,16 @@ require("noice").setup({
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
views = {
cmdline_popup = {
border = {
style = "none",
padding = { 1, 2 },
},
filter_options = {},
win_options = {
winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
},
},
},
})

View File

@ -0,0 +1,63 @@
require("telescope").setup({
defaults = {
borderchars = { " ", " ", " ", " ", " ", " ", " ", " " }
}
})
local blend = 50
vim.api.nvim_create_autocmd("FileType", {
pattern = "TelescopePrompt",
callback = function(ctx)
local backdropName = "TelescopeBackdrop"
local telescopeBufnr = ctx.buf
-- `Telescope` does not set a zindex, so it uses the default value
-- of `nvim_open_win`, which is 50: https://neovim.io/doc/user/api.html#nvim_open_win()
local telescopeZindex = 50
local backdropBufnr = vim.api.nvim_create_buf(false, true)
local winnr = vim.api.nvim_open_win(backdropBufnr, false, {
relative = "editor",
border = "none",
row = 0,
col = 0,
width = vim.o.columns,
height = vim.o.lines,
focusable = false,
style = "minimal",
zindex = telescopeZindex - 1, -- ensure it's below the reference window
})
vim.api.nvim_set_hl(0, backdropName, { bg = "#000000", default = true })
vim.wo[winnr].winhighlight = "Normal:" .. backdropName
vim.wo[winnr].winblend = blend
vim.bo[backdropBufnr].buftype = "nofile"
-- close backdrop when the reference buffer is closed
vim.api.nvim_create_autocmd({ "WinClosed", "BufLeave" }, {
once = true,
buffer = telescopeBufnr,
callback = function()
if vim.api.nvim_win_is_valid(winnr) then vim.api.nvim_win_close(winnr, true) end
if vim.api.nvim_buf_is_valid(backdropBufnr) then
vim.api.nvim_buf_delete(backdropBufnr, { force = true })
end
end,
})
end,
})
vim.api.nvim_create_autocmd({ "ColorScheme", "VimEnter" }, {
group = vim.api.nvim_create_augroup('Color', {}),
pattern = "*",
callback = function()
vim.api.nvim_set_hl(0, "TelescopePreviewTitle", { link = "MiniStatuslineModeVisual" })
vim.api.nvim_set_hl(0, "TelescopePromptTitle", { link = "MiniStatuslineModeCommand" })
vim.api.nvim_set_hl(0, "TelescopeResultsTitle", { link = "MiniStatuslineModeReplace" })
vim.api.nvim_set_hl(0, "TelescopePromptNormal", { link = "StatusLine" })
vim.api.nvim_set_hl(0, "TelescopePromptBorder", { link = "StatusLine" })
vim.api.nvim_set_hl(0, "TelescopePreviewNormal", { link = "BufferLineHint" })
vim.api.nvim_set_hl(0, "TelescopePreviewBorder", { link = "BufferLineHint" })
end
})