Git Product home page Git Product logo

Comments (7)

NStefan002 avatar NStefan002 commented on June 21, 2024 1

I did go over the API, forums, LLMs, for all 3 of these, and couldn't find an elegant way to resolve this 😅

I was just about to type this.

The only other way I thought of was to do something like this:

local keys_to_disable =
    { "a", "A", "i", "I", "o", "O", "s", "S", "x", "d", "D", "c", "C", "p", "P", "u", "U", "J", "r", "R", ".", }
for _, key in pairs(keys_to_disable) do
    vim.keymap.set("n", key, "<nop>", { buffer = 0 })
end

But it's very hacky, there are a lot of edge cases that aren't covered.

Also, when I tried using the solution you proposed in PR, I noticed that the error it was throwing was not the same as the ones that block your Neovim instance (I don't know what are they called), as I thought at first. So I think this solution is good enough until the better one emerges.

PS: I will not merge your PR, because it uses the API function that is deprecated in nightly versions, and the "use instead" function already exists in versions 0.9.x

from speedtyper.nvim.

gerazov avatar gerazov commented on June 21, 2024 1

Yeah that is a hell of a hack but it could do the trick - as long as the user can't enter insert mode 👍

Great that it got solved - thanks 🙏

from speedtyper.nvim.

NStefan002 avatar NStefan002 commented on June 21, 2024

Thanks again for the help 😁. The solution you proposed in PR makes sense, but I would like to suppress the error, I'll look into it and try to come up with a different solution. If I don't make any progress, I will merge the PR (it's much better than the current state 😀).

from speedtyper.nvim.

gerazov avatar gerazov commented on June 21, 2024

Yeah - it would be better for sure 👍

I did go over the API, forums, LLMs, for all 3 of these, and couldn't find an elegant way to resolve this 😅

Maybe you have better luck 😉

from speedtyper.nvim.

gerazov avatar gerazov commented on June 21, 2024

I keep getting the E21 errors all the time 😅

Can you still merge the hack that disables all inserting commands? 🙏

from speedtyper.nvim.

NStefan002 avatar NStefan002 commented on June 21, 2024

Do you mind testing it now, @gerazov? I will leave this issue open for now.

from speedtyper.nvim.

gerazov avatar gerazov commented on June 21, 2024

Works great - thanks 🤟

from speedtyper.nvim.

Related Issues (11)

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.