hardtime.nvim helps you establish a better command workflow and eliminate bad habits while using Neovim. With features like blocking repeated keys, providing hints for optimal commands, and customizable options, it’s designed to enhance your productivity and create a smoother editing experience.
hardtime.nvim is a powerful Neovim plugin designed to enhance your command workflow while helping you eliminate bad habits. By utilizing this tool, you can improve your efficiency and precision in navigating and editing in Neovim.
✨ Key Features
- Key Repetition Blocking: Prevents the accidental repetition of commands within a specified time frame.
- Command Hints: Provides insightful suggestions for better commands, guiding you to use alternatives, such as recommending
ci"
instead ofdi"i
. - Customizable Restrictions: Tailor the plugin's functionality by configuring restricted keys, disabled keys, and more to suit your preferences.
- Habit Reporting: Gain insights into your most frequent "bad habits" to help you focus on improvement areas.
Recommended Workflow
To maximize your productivity, follow these guidelines:
- Limit mouse and arrow key usage when not at the home row of your keyboard.
- Use relative jump commands (e.g.,
5j
,12-
) for efficient vertical screen navigation. - Employ
CTRL-U
,CTRL-D
,CTRL-B
,CTRL-F
,gg
, andG
for smooth vertical movements outside the visible area. - Utilize word motions (
w
,W
,b
,B
,e
,E
,ge
,gE
) for short horizontal adjustments. - For medium to long-distance horizontal movements, use commands like
f
,F
,t
,T
,;
,0
,^
, and$
. - Combine operators with motions/text-objects (e.g.,
ci{
,y5j
,dap
) whenever possible. - Use
%
and bracket commands to navigate between brackets effectively.
For a deeper understanding, check out this detailed blog post.
⚡ Requirements
- Neovim version 0.10.0 or higher (Release Notes).
🚀 Usage
Out of the box, hardtime.nvim
is enabled. You can easily manage it using the following commands:
:Hardtime enable
- Activateshardtime.nvim
.:Hardtime disable
- Deactivates it.:Hardtime toggle
- Toggles the plugin's state.- To view the most common hints you have encountered, use
:Hardtime report
.
Additionally, your logs are accessible at ~/.local/state/nvim/hardtime.nvim.log
.
🔧 Configuration
Customize your plugin experience by passing a configuration table into the setup()
function or through opts
if using lazy.nvim. Here's an example:
-- Add "oil" to the disabled file types
disabled_filetypes = { "qf", "netrw", "NvimTree", "lazy", "mason", "oil" },
You can modify options to overwrite default settings. For instance:
-- Disable <Up> keys and append <Space> to disabled keys
disabled_keys = {
["<Up>"] = {},
["<Space>"] = { "n", "x" },
},
Options Overview
Option Name | Type | Default Value | Meaning |
---|---|---|---|
max_time | number | 1000 | Maximum time (ms) for repeated key presses. |
max_count | number | 3 | Maximum number of allowed repeat key presses. |
disable_mouse | boolean | true | Toggle mouse support. |
hint | boolean | true | Toggle command hints. |
notification | boolean | true | Toggle notifications for restricted keys. |
enabled | boolean | true | Whether the plugin is enabled by default. |
For a complete list of options and their configurations, visit the default config.
Join our Community and Contribute
We welcome everyone to contribute and improve hardtime.nvim
. Please read our CONTRIBUTING.md for more details. 👥
Become part of our growing community of contributors and transform your Neovim experience!
I remember spending an entire weekend just adjusting my neovim config :P Nice project.
Sign in to comment.