From af9d132fafc454afe2e2fa7d299a2040debe10bd Mon Sep 17 00:00:00 2001 From: Andrew Conlin Date: Fri, 24 May 2024 16:34:48 +0100 Subject: [PATCH] [2024-05-24] Adding noice.nvim, minor aesthetic feline updates --- nvim/init.vim | 3 ++ nvim/lua/init.lua | 1 + nvim/lua/plugins/feline.lua | 54 +++++++++++++++++++++++++++------ nvim/lua/plugins/noice.lua | 17 +++++++++++ nvim/lua/plugins/treesitter.lua | 2 +- 5 files changed, 67 insertions(+), 10 deletions(-) create mode 100644 nvim/lua/plugins/noice.lua diff --git a/nvim/init.vim b/nvim/init.vim index 374fbf8..6b70b1a 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -38,6 +38,9 @@ Plug 'ms-jpq/coq.artifacts', {'branch': 'artifacts'} Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'xiyaowong/transparent.nvim' Plug 'justinhj/battery.nvim' +Plug 'MunifTanjim/nui.nvim' +Plug 'rcarriga/nvim-notify' +Plug 'folke/noice.nvim' call plug#end() set bg=dark diff --git a/nvim/lua/init.lua b/nvim/lua/init.lua index f54d9f7..e5dd7cb 100644 --- a/nvim/lua/init.lua +++ b/nvim/lua/init.lua @@ -4,3 +4,4 @@ require('gitsigns').setup() require('plugins.matlab_ls') require('plugins.treesitter') require('battery').setup() +require('plugins.noice') diff --git a/nvim/lua/plugins/feline.lua b/nvim/lua/plugins/feline.lua index 35e7ed3..57dbf4f 100644 --- a/nvim/lua/plugins/feline.lua +++ b/nvim/lua/plugins/feline.lua @@ -40,7 +40,7 @@ status_components.active[1][1] = { hl = function() return { fg = require('feline.providers.vi_mode').get_mode_color(), - bg = 'bg' + bg = 'bg' } end } @@ -51,7 +51,11 @@ status_components.active[1][1] = { status_components.active[3][1] = { provider = 'battery', left_sep = { - str = 'block' + { + str = 'left', + hl = {fg = 'fg'} + }, + {str = 'block'} }, right_sep = { str = 'block' @@ -59,25 +63,51 @@ status_components.active[3][1] = { } status_components.active[3][2] = { provider = 'date', + hl = function() + return { + name = (require('feline.providers.vi_mode').get_mode_highlight_name()) .. " ", + fg = require('feline.providers.vi_mode').get_mode_color(), + bg = 'bg' + } + end, left_sep = { - str = 'block' - }, + {str = 'left', + hl = function() + return { fg = require('feline.providers.vi_mode').get_mode_color() } + end + }, + {str = 'block'} + }, right_sep = { str = 'block' } } status_components.active[3][3] = { provider = 'time', + hl = function() + return { + name = (require('feline.providers.vi_mode').get_mode_highlight_name()) .. " ", + bg = require('feline.providers.vi_mode').get_mode_color(), + fg = 'bg', + style = 'bold' + } + end, left_sep = { - str = 'block' - }, + str = 'left_filled', + hl = function() + return { + fg = require('feline.providers.vi_mode').get_mode_color(), + bg = 'bg' + } + end }, right_sep = { str = 'block' } } local custom_providers = { time = function() - return tostring(vim.fn.strftime('%H:%M')) + local time = tostring(vim.fn.strftime('%H:%M')) + return '  ' .. time end, git_add = function() return git_diff('added'), '  ' @@ -167,8 +197,14 @@ win_components.active[1][4] = { win_components.active[1][5] = { provider = 'file_type', right_sep = { - str = 'block', - hl = { fg = 'bg' } + { + str = 'block', + hl = { fg = 'bg' } + }, + { + str = 'right', + hl = { fg = 'fg' } + } } } win_components.active[3][1] = { diff --git a/nvim/lua/plugins/noice.lua b/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..e0a862d --- /dev/null +++ b/nvim/lua/plugins/noice.lua @@ -0,0 +1,17 @@ +require("noice").setup({ + 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, + }, + }, + -- 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 + }, +}) diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 53651a8..351194f 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,6 +1,6 @@ require('nvim-treesitter.configs').setup { -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "matlab", "lua", "vim", "vimdoc" }, + ensure_installed = { "matlab", "lua", "vim", "vimdoc", "regex" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false,