From dbd9a6fdd0c44e26b200fb706aacd120a2e09c47 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 24 Apr 2025 11:23:18 +0300 Subject: Replaced my global notify with snacks notify --- .config/nvim/init.lua | 2 -- .config/nvim/lua/custom/config/commands.lua | 8 ++++---- .config/nvim/lua/custom/globals.lua | 31 ----------------------------- 3 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 .config/nvim/lua/custom/globals.lua (limited to '.config') diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index d696529..a8d2c53 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -3,7 +3,6 @@ vim.loader.enable() vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -require('custom.globals') require('custom.config.options') vim.schedule(function() require('custom.config.keymaps') @@ -11,7 +10,6 @@ vim.schedule(function() end) local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' ----@diagnostic disable-next-line: undefined-field if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.fn.system({ 'git', diff --git a/.config/nvim/lua/custom/config/commands.lua b/.config/nvim/lua/custom/config/commands.lua index 4477733..7135eeb 100644 --- a/.config/nvim/lua/custom/config/commands.lua +++ b/.config/nvim/lua/custom/config/commands.lua @@ -32,16 +32,16 @@ vim.api.nvim_create_user_command('FormatToggle', function(args) if is_global then vim.g.disable_autoformat = not vim.g.disable_autoformat if vim.g.disable_autoformat then - Notify('Autoformat on save disabled globally') + Snacks.notify.info('Autoformat on save disabled globally', { title = 'test' }) else - Notify('Autoformat on save enabled globally') + Snacks.notify.info('Autoformat on save enabled globally') end else vim.b.disable_autoformat = not vim.b.disable_autoformat if vim.b.disable_autoformat then - Notify('Autoformat on save disabled for this buffer') + Snacks.notify.info('Autoformat on save disabled for this buffer') else - Notify('Autoformat on save enabled for this buffer') + Snacks.notify.info('Autoformat on save enabled for this buffer') end end end, { diff --git a/.config/nvim/lua/custom/globals.lua b/.config/nvim/lua/custom/globals.lua deleted file mode 100644 index 25f26d1..0000000 --- a/.config/nvim/lua/custom/globals.lua +++ /dev/null @@ -1,31 +0,0 @@ -function Notify(message, title, level) - if not title then - if not level then - title = 'info' - else - title = level - end - end - vim.notify(message, level, { title = ' ' .. title }) -end - -function ToggleWrap() - if vim.wo.wrap then - vim.wo.wrap = false - Notify('Wrap disabled') - else - vim.wo.wrap = true - vim.wo.number = false - Notify('Wrap enabled') - end -end - -function ToggleInlayHints() - local is_enabled = vim.lsp.inlay_hint.is_enabled({}) - vim.lsp.inlay_hint.enable(not is_enabled) - if is_enabled then - Notify('Inlay Hints disabled') - else - Notify('Inlay Hints enabled') - end -end -- cgit v1.3.1