From 48cfacde4e00f34643e7e6cbf334d3eb547417a3 Mon Sep 17 00:00:00 2001 From: fiplox Date: Sun, 25 Jun 2023 17:10:09 +0200 Subject: [PATCH] update add noice --- init.lua | 5 +++-- lua/config/lazy.lua | 3 ++- lua/config/mappings.lua | 1 + lua/config/utils.lua | 9 +++++++++ lua/plugins/feline.lua | 1 + lua/plugins/lsp/init.lua | 12 ++++++------ lua/plugins/noice.lua | 31 +++++++++++++++++++++++++++++++ lua/plugins/trouble.lua | 4 ++-- 8 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 lua/plugins/noice.lua diff --git a/init.lua b/init.lua index 541582d..87e0249 100644 --- a/init.lua +++ b/init.lua @@ -16,12 +16,13 @@ vim.opt.runtimepath:prepend(lazypath) vim.api.nvim_create_autocmd('User', { pattern = 'LazyVimStarted', callback = function() + vim.cmd 'colorscheme neogruber' require 'feline' + require 'flash' require 'config.mappings' require 'config.autocmd' --- require 'noice' require 'nvim-treesitter' - vim.cmd 'colorscheme neogruber' + require 'noice' end, }) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index cfed2a6..b67e8e3 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -4,9 +4,10 @@ require('lazy').setup('plugins', { enabled = false, }, performance = { + reset_packpath = true, rtp = { reset = true, - paths = { '~/.local/share/nvim/site/' }, + -- paths = { '~/.local/share/nvim/site/' }, disabled_plugins = { 'fzf', 'gzip', diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index 67561a5..2a4b64f 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -36,6 +36,7 @@ keymap('n', 'D', '"_d', { noremap = true }) keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opt) keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opt) +keymap('n', 'gr', 'TroubleToggle lsp_references', opt) keymap('n', '', 'lua vim.lsp.buf.hover()', opt) keymap('n', 'gI', 'lua vim.lsp.buf.implementation()', opt) keymap('n', 'gl', 'lua vim.diagnostic.open_float()', opt) diff --git a/lua/config/utils.lua b/lua/config/utils.lua index 884553e..725d77f 100644 --- a/lua/config/utils.lua +++ b/lua/config/utils.lua @@ -124,6 +124,10 @@ local function selectionCount() return "" .. tostring(lines) .. "L " .. tostring(vim.fn.wordcount().visual_chars) .. "C" end +local function startupTime() + return tostring(require'lazy'.stats().startuptime) +end + M.feline_c = { right_separator = { provider = '', @@ -253,6 +257,11 @@ M.feline_c = { end, }, }, + startup = { + provider = startupTime, + left_sep = ' ', + right_sep = ' ', + }, select_count = { provider = selectionCount, hl = function() diff --git a/lua/plugins/feline.lua b/lua/plugins/feline.lua index e0a163b..9633031 100644 --- a/lua/plugins/feline.lua +++ b/lua/plugins/feline.lua @@ -34,6 +34,7 @@ return { c.search_count, c.macro, c.file_encoding, + -- c.startup, c.line_percentage, c.select_count, c.position, diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index 21789d1..02e0114 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -110,12 +110,12 @@ function M.config() vim.diagnostic.config(utils.lsp_config) - vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { - border = 'rounded', - }) - vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = 'rounded', - }) + -- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { + -- border = 'rounded', + -- }) + -- vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { + -- border = 'rounded', + -- }) local on_references = vim.lsp.handlers['textDocument/references'] vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { -- Use location list instead of quickfix list diff --git a/lua/plugins/noice.lua b/lua/plugins/noice.lua new file mode 100644 index 0000000..ddcde3c --- /dev/null +++ b/lua/plugins/noice.lua @@ -0,0 +1,31 @@ +return { + "folke/noice.nvim", + -- event = "VeryLazy", + opts = { + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + -- signature = { + -- enabled = false, + -- }, + -- hover = { + -- enabled = false, + -- }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + 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 + }, + }, + dependencies = { + "MunifTanjim/nui.nvim", + } +} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index 9167d23..092b0b5 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -19,11 +19,11 @@ return { close = "q", -- close the list cancel = "", -- cancel the preview and get back to your last window / buffer / cursor refresh = "r", -- manually refresh - jump = { "", "" }, -- jump to the diagnostic or open / close folds + jump = { "o", "" }, -- jump to the diagnostic or open / close folds open_split = { "" }, -- open buffer in new split open_vsplit = { "" }, -- open buffer in new vsplit open_tab = { "" }, -- open buffer in new tab - jump_close = { "o" }, -- jump to the diagnostic and close the list + jump_close = { "" }, -- jump to the diagnostic and close the list toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR toggle_preview = "P", -- toggle auto_preview