Skip to content

Enable Notifications

Josh Peterson edited this page Jul 1, 2024 · 1 revision

Overview

The enable_notifications configuration option allows you to control whether notifications are displayed when certain actions occur within the typewriter.nvim plugin. By default, notifications are enabled, but you can turn them off if you prefer a quieter experience.

Configuration

To configure enable_notifications, you can pass it as part of the setup configuration in your Neovim configuration file.

Example

Here's an example of how to set up the typewriter.nvim plugin with enable_notifications enabled or disabled:

Enabling Notifications
require('typewriter').setup({
    enable_notifications = true,  -- Enable notifications
})
Disabling Notifications
require('typewriter').setup({
    enable_notifications = false,  -- Disable notifications
})

Notifications

When enable_notifications is set to true, the following actions will trigger notifications:

  • Enabling Typewriter Mode: A notification with the message "Typewriter mode enabled" will be displayed.
  • Disabling Typewriter Mode: A notification with the message "Typewriter mode disabled" will be displayed.
  • Centering the Code Block: A notification with the message "Code block centered" will be displayed when the :TWCenter command is used.
  • Aligning the Code Block with the Top: A notification with the message "Code block aligned with the top" will be displayed when the :TWTop command is used.
  • Aligning the Code Block with the Bottom: A notification with the message "Code block aligned with the bottom" will be displayed when the :TWBottom command is used.

Benefits

  • Immediate Feedback: Notifications provide immediate feedback, helping you to know the status of the typewriter mode and the position of code blocks.
  • Customizable Experience: By enabling or disabling notifications, you can customize your Neovim experience to suit your preferences.

Integration with Other Plugins

If you are using notification plugins like Noice or Notify, these notifications will be captured and displayed according to the configuration of those plugins, providing a seamless and integrated experience.

Conclusion

The enable_notifications option is a flexible way to enhance your interaction with the typewriter.nvim plugin. Whether you prefer having notifications for immediate feedback or a quieter workspace, this option gives you the control to tailor your environment to your needs.