joshuadanpeterson / typewriter.nvim

A Neovim plugin that emulates a typewriter, keeping the cursor centered on the screen for a focused writing experience.
MIT License
23 stars 0 forks source link

Enhance Release Workflow, Documentation, and State Management #6

Closed joshuadanpeterson closed 2 months ago

joshuadanpeterson commented 2 months ago

Pull Request: Merge dev into main

Overview

This pull request merges the dev branch into the main branch, incorporating several improvements, bug fixes, and new features to enhance the functionality and robustness of the typewriter.nvim plugin.

Latest Changes

  1. .github/workflows/release.yml:

    • Improved the release workflow to handle existing releases by checking if the release tag already exists and updating the existing release if it does.
    • Added logic to remove duplicate entries in the changelog and improve the changelog generation process.
    • Added a step to update the existing release if it already exists.
  2. CHANGELOG.md:

    • Updated changelog for v0.4.16 with the latest changes.
    • Improved the changelog format and removed duplicate entries.
  3. README.md:

    • Added new features and linked to relevant wiki articles.
    • Enhanced documentation with details about state tracking and comprehensive in-editor help documentation.
    • Improved formatting and readability.
  4. doc/tags:

    • Updated documentation tags to reflect the latest changes and new functions.
  5. lua/typewriter/commands.lua:

    • Refactored commands to use the new state management functions.
    • Improved the logic for enabling, disabling, and toggling typewriter mode.
    • Enhanced the center_cursor function to check the active state using the new utility function.
  6. lua/typewriter/utils.lua:

    • Added state management functions for typewriter mode: is_typewriter_active, set_typewriter_active, and toggle_typewriter_active.
    • Refactored existing functions to utilize the new state management logic.
    • Improved the center_cursor_horizontally function with detailed comments and enhanced logic.

How to Use

  1. Installation:

    • Add the plugin to your Neovim configuration using your preferred plugin manager.
    • Example using Packer:
      use {
       'joshuadanpeterson/typewriter.nvim',
       requires = 'nvim-treesitter/nvim-treesitter',
       config = function()
           require('typewriter').setup()
       end
      }
  2. Commands:

    • :TWEnable, :TWDisable, :TWToggle, :TWCenter, :TWTop, :TWBottom.
  3. Configuration:

    • Customize the plugin by overriding the default settings in your setup function.

Acknowledgments

By merging this pull request, I aim to provide a more robust and feature-rich typewriter experience in Neovim. I welcome feedback and suggestions for further improvements.