Giter Club home page Giter Club logo

Comments (6)

directormac avatar directormac commented on August 23, 2024 1

Yup you are right, i'm expecting the other one for normal mode to work normally where it can delete a blank line.
still tho the workaround is fine for me you can close this one! Thanks @m4xshen !

from hardtime.nvim.

m4xshen avatar m4xshen commented on August 23, 2024

Please make sure you update it to the lateset version and remove the event = "VeryLazy", which is not needed anymore.
See the updated README.

from hardtime.nvim.

directormac avatar directormac commented on August 23, 2024

Please make sure you update it to the lateset version and remove the event = "VeryLazy", which is not needed anymore. See the updated README.

I noticed that now! Thank you so much for the awaited fix now only the rebind isn't working ^_^ i just updated few minutes ago.

from hardtime.nvim.

m4xshen avatar m4xshen commented on August 23, 2024

Could you please clarify again what the current issue after updating?

from hardtime.nvim.

directormac avatar directormac commented on August 23, 2024

Well its was the same as before on lazyvim i belive the keymap.lua is set afterwards all the plugins have loaded so maybe its conflicting with the reset keys used by hardtime on the resetting keys i removed the x here to reproduce,

if x is removed from resetting keys the remap of x works.

  {
    "m4xshen/hardtime.nvim", --hardtime practice
    dependencies = "neovim/nvim-lspconfig",
    opts = {
      },
    },
  },
local map = require("config.util").map
map("v", "x", "_x", { noremap = true, silent = true, desc = "Delete character without yanking" })
map(
  "n",
  "x", -- Also let's allow 'x' key to delete blank lines in normal mode.
  function()
    if vim.fn.col(".") == 1 then
      local line = vim.fn.getline(".")
      if line:match("^%s*$") then
        vim.api.nvim_feedkeys("dd", "n", false)
        vim.api.nvim_feedkeys("$", "n", false)
      else
        vim.api.nvim_feedkeys('"_x', "n", false)
      end
    else
      vim.api.nvim_feedkeys('"_x', "n", false)
    end
  end,
  { noremap = true, silent = true, desc = "Delete character without yanking" }
)

This is my current workaround

  {
    "m4xshen/hardtime.nvim", --hardtime practice
    dependencies = "neovim/nvim-lspconfig",
    opts = {
      max_time = 2000,
      max_count = 3,
      resetting_keys = {
        ["1"] = { "n", "v" },
        ["2"] = { "n", "v" },
        ["3"] = { "n", "v" },
        ["4"] = { "n", "v" },
        ["5"] = { "n", "v" },
        ["6"] = { "n", "v" },
        ["7"] = { "n", "v" },
        ["8"] = { "n", "v" },
        ["9"] = { "n", "v" },
        ["c"] = { "n" },
        ["C"] = { "n" },
        ["d"] = { "n" },
        -- ["x"] = { "n" },
        ["X"] = { "n" },
        ["y"] = { "n" },
        ["Y"] = { "n" },
        ["p"] = { "n" },
        ["P"] = { "n" },
      },
    },
  },

from hardtime.nvim.

m4xshen avatar m4xshen commented on August 23, 2024

map("v", "x", "_x", { noremap = true, silent = true, desc = "Delete character without yanking" })

I think the right hand side of the map should be "_x. You missed a ".

from hardtime.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.