diff options
Diffstat (limited to '.config/nvim/lua/custom/globals.lua')
| -rw-r--r-- | .config/nvim/lua/custom/globals.lua | 25 |
1 files changed, 25 insertions, 0 deletions
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 |
