ci"
instead of di"i
Recommended workflow:
5j
12-
) for vertical movement within the screen.CTRL-U
CTRL-D
CTRL-B
CTRL-F
gg
G
for vertical movement outside the screen.w
W
b
B
e
E
ge
gE
) for short-distance horizontal movement.f
F
t
T
,
;
0
^
$
for medium to long-distance horizontal movement.ci{
y5j
dap
) whenever possible.%
and square bracket commands (see :h [
) to jump between brackets.Learn more in this blog post
-- lazy.nvim
{
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
opts = {}
},
init.lua
. This step is not needed with lazy.nvim if opts
is set as above.require("hardtime").setup()
If you want to see the hint messages in insert and visual mode, set the 'showmode'
to false.
But if you want to see both the hint message and current mode you can setup with one of the following methods:
'showmode'
to false. You can do this with some statusline plugin such as lualine.nvim.'cmdheight'
to 2 so that the hint message won't be replaced by mode message.hardtime.nvim is enabled by default. You can change its state with the following commands:
:Hardtime enable
enable hardtime.nvim:Hardtime disable
disable hardtime.nvim:Hardtime toggle
toggle hardtime.nvimYou can view the most frequently seen hints with :Hardtime report
.
Your log file is at ~/.local/state/nvim/hardtime.nvim.log
.
You can pass your config table into the setup()
function or opts
if you use lazy.nvim.
If the option is a boolean, number, or array, your value will overwrite the default configuration.
Example:
-- Add "oil" to the disabled_filetypes
disabled_filetypes = { "qf", "netrw", "NvimTree", "lazy", "mason", "oil" },
If the option is a table with a key = value
pair, your value will overwrite the default if the key exists, and the pair will be appended to the default configuration if the key doesn't exist. You can set key = {}
to remove the default key-value pair.
Example:
-- Remove <Up> keys and append <Space> to the disabled_keys
disabled_keys = {
["<Up>"] = {},
["<Space>"] = { "n", "x" },
},
Option Name | Type | Default Valuae | Meaning |
---|---|---|---|
max_time |
number | 1000 |
Maximum time (in milliseconds) to consider key presses as repeated. |
max_count |
number | 3 |
Maximum count of repeated key presses allowed within the max_time period. |
disable_mouse |
boolean | true |
Disable mouse support. |
hint |
boolean | true |
Enable hint messages for better commands. |
notification |
boolean | true |
Enable notification messages for restricted and disabled keys. |
allow_different_key |
boolean | true |
Allow different keys to reset the count. |
enabled |
boolean | true |
Whether the plugin is enabled by default or not. |
resetting_keys |
table of strings/table pair | See Config | Keys in what modes that reset the count. |
restricted_keys |
table of strings/table pair | See Config | Keys in what modes triggering the count mechanism. |
restriction_mode |
string ("block" or "hint" ) |
"block" |
The behavior when restricted_keys trigger count mechanism. |
disabled_keys |
table of strings/table pair | See Config | Keys in what modes are disabled. |
disabled_filetypes |
table of strings | See Config | hardtime.nvim is disabled under these filetypes. |
hints |
table | See Config | key is a string pattern you want to match, value is a table of hint message and pattern length. Learn more about Lua string pattern. |
callback |
function(text) | vim.notify |
callback function can be used to override the default notification behavior. |
force_exit_insert_mode |
boolean | false |
Enable forcing exit Insert mode if user is inactive in Insert mode. |
max_insert_idle_ms |
number | 5000 |
Maximum amount of idle time, in milliseconds, allowed in Insert mode. |
hints
exampleThese are two default hints:
hints = {
["k%^"] = {
message = function()
return "Use - instead of k^" -- return the hint message you want to display
end,
length = 2, -- the length of actual key strokes that matches this pattern
},
["d[tTfF].i"] = { -- this matches d + {t/T/f/F} + {any character} + i
message = function(keys) -- keys is a string of key strokes that matches the pattern
return "Use " .. "c" .. keys:sub(2, 3) .. " instead of " .. keys
-- example: Use ct( instead of dt(i
end,
length = 4,
},
}
Check out some examples of custom hint in discussion!
Please read CONTRIBUTING.md.