diff --git a/init.lua b/init.lua index 4a0a147b..3710e7fd 100644 --- a/init.lua +++ b/init.lua @@ -157,6 +157,9 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 +-- term gui colors for nvim.notify +vim.opt.termguicolors = true + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` diff --git a/lua/custom/plugins/misc.lua b/lua/custom/plugins/misc.lua index 1e5d42f8..9c56994c 100644 --- a/lua/custom/plugins/misc.lua +++ b/lua/custom/plugins/misc.lua @@ -6,33 +6,6 @@ return { -- use opts = {} for passing setup options -- this is equivalent to setup({}) function }, - -- { - -- -- sessions - -- 'folke/persistence.nvim', - -- event = 'BufReadPre', -- this will only start session saving when an actual file was opened - -- opts = { - -- -- load the session for the current directory - -- vim.keymap.set('n', 'Ss', function() - -- require('persistence').load() - -- end, { desc = 'Load session from directory' }), - -- - -- -- select a session to load - -- vim.keymap.set('n', 'SS', function() - -- require('persistence').select() - -- end, { desc = 'Select a sesion to load' }), - -- - -- -- load the last session - -- vim.keymap.set('n', 'Sl', function() - -- require('persistence').load { last = true } - -- end, { desc = 'Load the last session' }), - -- - -- -- stop Persistence => session won't be saved on exit - -- vim.keymap.set('n', 'Sd', function() - -- require('persistence').stop() - -- end, { desc = 'Stop Saving sessions' }), - -- -- add any custom options here - -- }, - -- }, { 'karb94/neoscroll.nvim', config = function() @@ -61,11 +34,17 @@ return { -- opts = { config = function() local resession = require 'resession' + + ---@diagnostic disable-next-line: missing-parameter resession.setup() + -- Resession does NOTHING automagically, so we have to set up some keymaps vim.keymap.set('n', 'Ss', resession.save, { desc = 'Save Session' }) - vim.keymap.set('n', 'Sl', resession.load, { desc = 'Load Session' }) + vim.keymap.set('n', 'SL', resession.load, { desc = 'Load Session' }) vim.keymap.set('n', 'Sd', resession.delete, { desc = 'Delete Session' }) + vim.keymap.set('n', 'Sl', function() + require('resession').load 'Last' + end, { desc = 'Load last session' }) vim.api.nvim_create_autocmd('VimLeavePre', { callback = function() @@ -76,4 +55,59 @@ return { end, -- }, }, + { + 'rcarriga/nvim-notify', + }, + { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- require('notify').setup { + -- background_colour = '#000000', + -- }, + -- add any options here + 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, -- requires hrsh7th/nvim-cmp + }, + }, + -- 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 + }, + vim.keymap.set('n', 'nl', function() + require('noice').cmd 'last' + end, { desc = 'Last Message' }), + + vim.keymap.set('n', 'nd', function() + require('noice').cmd 'dismiss' + end, { desc = 'Dismiss Message' }), + + vim.keymap.set('n', 'nh', function() + require('noice').cmd 'history' + end, { desc = 'History' }), + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + }, + config = function() + require('noice').setup { + -- Your existing configuration + } + -- Set the background color for NotifyBackground highlight group + vim.cmd [[highlight NotifyBackground guibg=#000000]] + end, + }, }