m4xshen / hardtime.nvim

Establish good command workflow and quit bad habit
MIT License
1.38k stars 26 forks source link

'yy' and 'p' don't work. #37

Closed neuromaancer closed 1 year ago

neuromaancer commented 1 year ago

Describe the bug When I used this plugin, I found the normal yank and paste functions don't work, for example 'yy' and 'p' as follows.

Config options

  "m4xshen/hardtime.nvim",
  lazy = false,
  dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
  opts = { -- Add "oil" to the disabled_filetypes
    disabled_filetypes = { "qf", "netrw", "NvimTree", "lazy", "mason", "oil" },
    restricted_keys = {
      ["h"] = {},
      ["j"] = {},
      ["k"] = {},
      ["l"] = {},
    },
  },
m4xshen commented 1 year ago

Are you using any Neovim distro?

neuromaancer commented 1 year ago

LazyVim actually. But I don't think there is a conflict?

m4xshen commented 1 year ago

Does dd and then p work?

neuromaancer commented 1 year ago

No, dd works as expected, but not the p.

neuromaancer commented 1 year ago

more info: why I said yy doesn't work, because I have set 'highlight on yank' autocmd, but yy didn't highlight the text, shift+y did.

m4xshen commented 1 year ago

Please try yyp again with the following config:

  "m4xshen/hardtime.nvim",
  lazy = false,
  dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
  opts = { -- Add "oil" to the disabled_filetypes
    disabled_filetypes = { "qf", "netrw", "NvimTree", "lazy", "mason", "oil" },
    restricted_keys = {
      ["h"] = {},
      ["j"] = {},
      ["k"] = {},
      ["l"] = {},
    },
    resetting_keys = {
      ["y"] = {},
      ["p"] = {},
   }
  },
m4xshen commented 1 year ago

Also do you have any keymap related to y or d?

neuromaancer commented 1 year ago

Yes, this works, but I think this is a compromised way to do it, right? I checked my remaps (also the LazyVim's), there is no keymap related to y or d.

m4xshen commented 1 year ago

Yeah this is just for debugging.

neuromaancer commented 1 year ago

Sorry I just find I have a plugin concerning yank and paste action, but it is inside the LazyVim, called yanky.nvim. I bet this is not the issue.

Concrete mapping: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/plugins/extras/coding/yanky.lua

Hope that this is helpful!

m4xshen commented 1 year ago

Fixed in ab488fa. Thanks for the feedback!