diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-08-04 00:53:58 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-08-04 00:53:58 +0300 |
| commit | 2fb3e86bcf30f86e458829dcb5cc67676e1dfa0f (patch) | |
| tree | f80befb3e9168c6020685a2a087661a31ed8e9ac /.config/nvim/lua/custom/globals.lua | |
| parent | 7023c01d4e60b5c40cd2b8dde1e48b5d8f3fdcd5 (diff) | |
feat(nvim): added some user commands and global functions for utility
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 |
