max397574 / better-escape.nvim

Map keys without delay when typing
GNU General Public License v3.0
629 stars 19 forks source link

Rewrite #61

Closed max397574 closed 3 months ago

max397574 commented 4 months ago

If you don't want the rewrite pin the v1.0.0 tag or the commit 7e86edafb8c7e73699e0320f225464a298b96d12. There was a big rewrite which allows much more flexibility now. You can now define mappings in most modes and also use functions.

The biggest change was that the mapping config option was removed. Check the default configuration below to see the new structure.

This also deprecated the clear_empty_lines setting. You can replicate this behavior with a function like this:

k = function()
    vim.api.nvim_input("<esc>")
    local current_line = vim.api.nvim_get_current_line()
    if current_line:match("^%s+j$") then
        vim.schedule(function()
            vim.api.nvim_set_current_line("")
        end
    end
end
UbeCc commented 3 months ago

Hi! I wonder how to eliminate the warning when starting nvim? Thanks!

max397574 commented 3 months ago

fix your config

if you need help with that you can open a discussion