Skip to content

Integration Guide

Josh Peterson edited this page Jun 15, 2024 · 1 revision

Integration with ZenMode and True Zen

Typewriter.nvim works seamlessly with ZenMode and True Zen to provide a distraction-free environment. Follow the configuration guidelines below to integrate Typewriter.nvim with these plugins.

Integration with ZenMode

ZenMode is a Neovim plugin that provides a distraction-free coding environment by opening the current buffer in a new full-screen floating window. Follow these steps to integrate Typewriter.nvim with ZenMode:

  1. Add ZenMode to your Packer configuration:

    Open your init.lua or init.vim configuration file and add the following lines:

    use {
        'folke/zen-mode.nvim',
        opts = {
            on_open = function()
                vim.cmd('TWEnable')
            end,
            on_close = function()
                vim.cmd('TWDisable')
            end
        }
    }
  2. Configure Typewriter.nvim to integrate with ZenMode:

    Add the following lines to your configuration file:

    require('typewriter').setup({
        enable_with_zen_mode = true,
    })

With this setup, Typewriter mode will automatically enable when you enter ZenMode and disable when you exit.

Integration with True Zen

True Zen is another Neovim plugin that offers multiple modes to unclutter your screen, including Ataraxis mode, which provides a distraction-free environment. Follow these steps to integrate Typewriter.nvim with True Zen:

  1. Add True Zen to your Packer configuration:

    Open your init.lua or init.vim configuration file and add the following lines:

    use {
        'pocco81/true-zen.nvim',
        config = function()
            require("true-zen").setup {
                modes = {
                    ataraxis = {
                        callbacks = {
                            open_pre = function()
                                vim.cmd('TWEnable')
                            end,
                            close_pos = function()
                                vim.cmd('TWDisable')
                            end
                        }
                    }
                }
            }
        end
    }
  2. Configure Typewriter.nvim to integrate with True Zen:

    Add the following lines to your configuration file:

    require('typewriter').setup({
        enable_with_true_zen = true,
    })

With this setup, Typewriter mode will automatically enable when you enter True Zen's Ataraxis mode and disable when you exit.

By following these instructions, you can easily integrate Typewriter.nvim with ZenMode and True Zen to enhance your distraction-free writing and coding experience in Neovim.

Clone this wiki locally