As developers, we often seek ways to improve our proficiency with the tools we use daily. One such tool is the text editor, and for many, Vim (and by extension, Neovim) stands out as the editor of choice. Yet, Vim has a steep learning curve, and it's easy to rely on familiar habits. However, there's a unique way to force yourself out of your comfort zone: Enter the "Hard Mode."

In this post, we'll explore how to enable "Hard Mode" in Neovim, which involves disabling keys like arrow keys, backspace, and delete. While it sounds intimidating, it's a great way to challenge yourself to rely more on Vim's powerful movement and editing commands.

What is "Hard Mode"?

"Hard Mode" is essentially a self-imposed challenge where you disable certain keys that you often rely upon, forcing you to use more efficient, native Vim commands. For instance, instead of using arrow keys for movement, you'd use , , , and . Instead of backspace or delete to remove characters or words, you'd use Vim's native delete and change commands.

Why Embrace the Challenge?

  1. Improve Muscle Memory: By eliminating the "easy way out," you force yourself to repeatedly use Vim's native commands, cementing them in your muscle memory.
  2. Efficiency: Native Vim commands are often more efficient than their conventional counterparts.
  3. Skill Enhancement: It's a fun and effective way to progress from a Vim beginner to an intermediate or advanced user.

Setting Up "Hard Mode" in Neovim

To set up "Hard Mode," we'll be working with Neovim's configuration file . If you haven't switched to Lua for configuring Neovim, now might be a good time! Lua offers performance benefits and is increasingly becoming the configuration method of choice.

Step-by-Step Instructions:

  1. Navigate to Neovim's Configuration: Open your Neovim configuration by navigating to .

  2. Insert the Code: Copy and paste the following Lua code snippet into your :

  1. Understanding the Code:

    • The variable acts as a switch. Setting it to enables the hard mode, and disables it.
    • The variable holds the command that will flash "KEY DISABLED" in a styled message on the command line whenever a disabled key is pressed.
    • The function is then used to remap the keys we want to disable.
  2. Save and Restart Neovim: After adding the code, save the file and restart Neovim. Try pressing any of the disabled keys. You should see the "KEY DISABLED" message!

Embrace the Challenge!

Enabling "Hard Mode" can be a daunting challenge, but remember, it's all about growth. Stick with it, practice regularly, and soon you'll find your Vim proficiency reaching new heights. Happy coding!

Full neovim config

Place a file at and add the following to disable backspace, delete, and arrow keys in neovim.