diff --git a/lua/config/plugins/gitsigns.lua b/lua/config/plugins/gitsigns.lua index 6437554..915468d 100644 --- a/lua/config/plugins/gitsigns.lua +++ b/lua/config/plugins/gitsigns.lua @@ -1,48 +1,47 @@ require('gitsigns').setup { - signs = { - add = { text = '┃' }, - change = { text = '┃' }, - delete = { text = '' }, - topdelete = { text = '' }, - changedelete = { text = '┃' }, - untracked = { text = ' ' }, - }, - signs_staged = { - add = { text = '┃' }, - change = { text = '┃' }, - delete = { text = '' }, - topdelete = { text = '' }, - changedelete = { text = '┃' }, - untracked = { text = ' ' }, - }, - signcolumn = true, - numhl = false, - linehl = false, - word_diff = false, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ", - ", - sign_priority = 6, - status_formatter = nil, -- Use default - update_debounce = 200, - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "rounded", - style = "minimal", - relative = "cursor", - row = 0, - vcol = 1, - }, - yadm = { enable = false }, + signs = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '' }, + topdelete = { text = '' }, + changedelete = { text = '┃' }, + untracked = { text = ' ' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '' }, + topdelete = { text = '' }, + changedelete = { text = '┃' }, + untracked = { text = ' ' }, + }, + signcolumn = true, + numhl = false, + linehl = false, + word_diff = false, + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ", - ", + sign_priority = 6, + status_formatter = nil, -- Use default + update_debounce = 200, + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = "rounded", + style = "minimal", + relative = "cursor", + row = 0, + vcol = 1, + }, } diff --git a/lua/config/plugins/hover_actions.lua b/lua/config/plugins/hover_actions.lua index b8153b0..c23340f 100644 --- a/lua/config/plugins/hover_actions.lua +++ b/lua/config/plugins/hover_actions.lua @@ -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' diff --git a/lua/config/plugins/noice.lua b/lua/config/plugins/noice.lua index 273c6c1..ed4e9e5 100644 --- a/lua/config/plugins/noice.lua +++ b/lua/config/plugins/noice.lua @@ -1,15 +1,27 @@ require("noice").setup({ - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp - }, - }, - presets = { - command_palette = true, -- position the cmdline and popupmenu together - long_message_to_split = true, -- long messages will be sent to a split - 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 = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + presets = { + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + 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", + }, + }, + }, }) diff --git a/lua/config/plugins/telescope.lua b/lua/config/plugins/telescope.lua new file mode 100644 index 0000000..56cc1f2 --- /dev/null +++ b/lua/config/plugins/telescope.lua @@ -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 +})