From 4974d2d2f27663e348e22fe62c5086ee4154af16 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 29 Aug 2023 21:46:02 +0100 Subject: [PATCH] feat(nvim): re-add lualine and noice --- after/plugin/lualine.lua | 40 ++++++++++++++++++++++++ after/plugin/noice.lua | 66 +++++++++++++++++++++++++++++++++++++++ lua/opdavies/lsp/init.lua | 4 +++ 3 files changed, 110 insertions(+) create mode 100644 after/plugin/lualine.lua create mode 100644 after/plugin/noice.lua diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua new file mode 100644 index 0000000..ac39007 --- /dev/null +++ b/after/plugin/lualine.lua @@ -0,0 +1,40 @@ +local status_ok, lualine = pcall(require, "lualine") +if not status_ok then + return +end + +local noice = require 'noice' + +lualine.setup { + options = { + component_separators = { left = '', right = '' }, + extensions = { "fzf", "quickfix" }, + icons_enabled = false, + section_separators = { left = '', right = '' }, + theme = "catppuccin" + }, + + sections = { + lualine_x = { + { + noice.api.status.message.get_hl, + cond = noice.api.status.message.has, + }, + { + noice.api.status.command.get, + cond = noice.api.status.command.has, + color = { fg = "#EED49F" }, + }, + { + noice.api.status.mode.get, + cond = noice.api.status.mode.has, + color = { fg = "#EED49F" }, + }, + { + noice.api.status.search.get, + cond = noice.api.status.search.has, + color = { fg = "#EED49F" }, + }, + }, + }, +} diff --git a/after/plugin/noice.lua b/after/plugin/noice.lua new file mode 100644 index 0000000..ec6a6cd --- /dev/null +++ b/after/plugin/noice.lua @@ -0,0 +1,66 @@ +local status_ok, noice = pcall(require, "noice") +if not status_ok then + return +end + +local notify = require 'notify' + +noice.setup({ + cmdline = { + format = { + cmdline = { icon = ">" }, + filter = { icon = "$" }, + help = { icon = "?" }, + lua = { icon = "☾" }, + search_down = { icon = "🔍⌄" }, + search_up = { icon = "🔍⌃" }, + }, + }, + lsp = { + override = { + ["cmp.entry.get_documentation"] = true, + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + }, + }, + popupmenu = { + kind_icons = false, + }, + presets = { + bottom_search = true, + command_palette = true, + inc_rename = false, + long_message_to_split = true, + lsp_doc_border = false, + }, +}) + +notify.setup({ + background_colour = "#1e222a", + render = "minimal", + stages = "static", + timeout = 5000, +}) + +vim.cmd [[ + highlight NotifyERRORBorder guifg=#ED8796 + highlight NotifyWARNBorder guifg=#EED49F + highlight NotifyINFOBorder guifg=#A6DA95 + highlight NotifyDEBUGBorder guifg=#B8C0E0 + highlight NotifyTRACEBorder guifg=#C6A0F6 + highlight NotifyERRORIcon guifg=#ED8796 + highlight NotifyWARNIcon guifg=#EED49F + highlight NotifyINFOIcon guifg=#A6DA95 + highlight NotifyDEBUGIcon guifg=#B8C0E0 + highlight NotifyTRACEIcon guifg=#C6A0F6 + highlight NotifyERRORTitle guifg=#ED8796 + highlight NotifyWARNTitle guifg=#EED49F + highlight NotifyINFOTitle guifg=#A6DA95 + highlight NotifyDEBUGTitle guifg=#B8C0E0 + highlight NotifyTRACETitle guifg=#C6A0F6 + highlight link NotifyERRORBody Normal + highlight link NotifyWARNBody Normal + highlight link NotifyINFOBody Normal + highlight link NotifyDEBUGBody Normal + highlight link NotifyTRACEBody Normal +]] diff --git a/lua/opdavies/lsp/init.lua b/lua/opdavies/lsp/init.lua index b86a903..4bd3b1a 100644 --- a/lua/opdavies/lsp/init.lua +++ b/lua/opdavies/lsp/init.lua @@ -81,5 +81,9 @@ cmp.setup({ }, }) +local nmap = require "opdavies.keymap".nmap + +nmap { "r", "LspRestart" } + require "opdavies.lsp.null-ls" require "opdavies.lsp.signature"