m4xshen / hardtime.nvim

Establish good command workflow and quit bad habit
MIT License
1.35k stars 27 forks source link

Custom hint for <BS> or <BSpace> #104

Closed supportcdl closed 1 month ago

supportcdl commented 1 month ago

Firstly, thanks for making this amazing plugin, appreciate it!

This is more for the hardtime community: I have been playing around with custom opts and I was wondering if anyone has managed to create a custom hint for the backspace (\<BS> or \<BSpace>)? This is my terrible attempt:

    opts = {
      hints = {
        ["[<BSpace>]"] = {
          message = function(keys)
             return "Don't use BSpace."
          end,
          length = 1,
        },
      },
    },
m4xshen commented 1 month ago

HI, @supportcdl you can config like this:

["<BS>"] = {
   message = function()
      return "Don't use <BS>."
   end,
   length = 4,
},

However this only works in normal mode. Hardtime currently only supports hints in normal mode