Skip to content
Josh Peterson edited this page Jun 30, 2024 · 3 revisions

Typewriter Mode and Code Block Navigation Demo

To see Typewriter.nvim in action, check out our demos below. These demos showcase how the plugin keeps the cursor centered on the screen and provides advanced code block navigation, enhancing your writing and coding experience by maintaining focus and reducing distractions.

Typewriter Demo

For a more interactive demonstration, you can watch the Typewriter.nvim demo on Asciinema. This demo provides a step-by-step look at how Typewriter.nvim works, including enabling, disabling, and toggling the typewriter mode.

Watch the Typewriter.nvim Demo on Asciinema

Additionally, the Center Code Block feature demo highlights how the :TWCenter command centers the view around the current code block or function, leveraging Tree-sitter for intelligent code block detection.

Center Code Block Demo

For a detailed video demonstration of the Center Code Block feature, check out the demo on Asciinema.

Watch the Center Code Block Demo on Asciinema

Furthermore, we've added new commands for advanced code block navigation. The :TWTop and :TWBottom commands allow you to move the top or bottom of the current code block to the top or bottom of the screen, respectively. Here's a demo of these new features:

TWTop and TWBottom Demo

For an interactive demonstration of the TWTop and TWBottom commands, watch this Asciinema demo:

Watch the TWTop and TWBottom Demo on Asciinema

What You Will See in the Demos:

  1. Enabling Typewriter Mode:

    • The cursor will be centered on the screen, creating a typewriter-like experience where your text stays in the middle as you type.
  2. Navigating with Typewriter Mode:

    • Watch how the cursor remains centered even as you navigate through the text, helping you maintain focus on your current line of work.
  3. Disabling Typewriter Mode:

    • The demo shows how to disable typewriter mode and return to the default cursor behavior, providing flexibility based on your needs.
  4. Toggling Typewriter Mode:

    • See how easy it is to switch between enabling and disabling typewriter mode with a simple command, adapting quickly to different writing or coding scenarios.
  5. Using Center Code Block:

    • The demo illustrates how the :TWCenter command centers the view around significant code blocks, such as functions, loops, and classes.
    • See how Tree-sitter is used to intelligently detect the current code block and center it on the screen, enhancing readability and focus.
  6. Using TWTop and TWBottom:

    • Watch how the :TWTop command moves the top of the current code block to the top of the screen, allowing you to see the entire block and what follows.
    • See the :TWBottom command in action as it moves the bottom of the current code block to the bottom of the screen, giving you a view of the entire block and what precedes it.
    • Notice how these commands maintain the cursor's relative position within the code block, allowing for seamless navigation and editing.

By watching these demos, you'll get a comprehensive understanding of how Typewriter.nvim enhances your Neovim experience with its typewriter mode and advanced code block navigation features. Whether you're a writer looking for a distraction-free environment or a coder seeking to improve focus and code navigation, Typewriter.nvim can help you achieve a more productive workflow. Feel free to try it out and see the difference it makes!