From 2fb3e86bcf30f86e458829dcb5cc67676e1dfa0f Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 4 Aug 2024 00:53:58 +0300 Subject: feat(nvim): added some user commands and global functions for utility --- .config/nvim/lua/custom/globals.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .config/nvim/lua/custom/globals.lua (limited to '.config/nvim/lua/custom/globals.lua') diff --git a/.config/nvim/lua/custom/globals.lua b/.config/nvim/lua/custom/globals.lua new file mode 100644 index 0000000..ccadddd --- /dev/null +++ b/.config/nvim/lua/custom/globals.lua @@ -0,0 +1,25 @@ +function Notify(title, message, level) + local notify = require('notify') + notify(message, level, { title = title }) +end + +function ToggleWrap() + if vim.wo.wrap then + vim.wo.wrap = false + Notify('Wrap disabled', 'info') + else + vim.wo.wrap = true + vim.wo.number = false + Notify('Wrap enabled', 'info') + 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', 'info') + else + Notify('Inlay Hints enabled', 'info') + end +end -- cgit v1.3.1