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

@ -1,48 +1,47 @@
require('gitsigns').setup { require('gitsigns').setup {
signs = { signs = {
add = { text = '' }, add = { text = '' },
change = { text = '' }, change = { text = '' },
delete = { text = '' }, delete = { text = '' },
topdelete = { text = '' }, topdelete = { text = '' },
changedelete = { text = '' }, changedelete = { text = '' },
untracked = { text = ' ' }, untracked = { text = ' ' },
}, },
signs_staged = { signs_staged = {
add = { text = '' }, add = { text = '' },
change = { text = '' }, change = { text = '' },
delete = { text = '' }, delete = { text = '' },
topdelete = { text = '' }, topdelete = { text = '' },
changedelete = { text = '' }, changedelete = { text = '' },
untracked = { text = ' ' }, untracked = { text = ' ' },
}, },
signcolumn = true, signcolumn = true,
numhl = false, numhl = false,
linehl = false, linehl = false,
word_diff = false, word_diff = false,
watch_gitdir = { watch_gitdir = {
interval = 1000, interval = 1000,
follow_files = true, follow_files = true,
}, },
attach_to_untracked = true, attach_to_untracked = true,
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = { current_line_blame_opts = {
virt_text = true, virt_text = true,
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
delay = 1000, delay = 1000,
ignore_whitespace = false, ignore_whitespace = false,
}, },
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>", current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>",
sign_priority = 6, sign_priority = 6,
status_formatter = nil, -- Use default status_formatter = nil, -- Use default
update_debounce = 200, update_debounce = 200,
max_file_length = 40000, max_file_length = 40000,
preview_config = { preview_config = {
-- Options passed to nvim_open_win -- Options passed to nvim_open_win
border = "rounded", border = "rounded",
style = "minimal", style = "minimal",
relative = "cursor", relative = "cursor",
row = 0, row = 0,
vcol = 1, vcol = 1,
}, },
yadm = { enable = false },
} }

View File

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

View File

@ -1,15 +1,27 @@
require("noice").setup({ require("noice").setup({
lsp = { lsp = {
override = { override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true, ["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
}, },
}, },
presets = { presets = {
command_palette = true, -- position the cmdline and popupmenu together command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help 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
})