Wansmer / langmapper.nvim

A plugin that makes Neovim more friendly to non-English input methods 🤝
MIT License
128 stars 7 forks source link

dd, yy,.. - does not work #2

Closed v-sim closed 1 year ago

v-sim commented 1 year ago

dd (delete line), yy (copy line),.. - (in translate) does not work after last update.

and prefix 'Langmapper: translate ...' for '--desc' — difficult to read. maybe postfix is ​​better? or in conf?

Wansmer commented 1 year ago

dd and yy – it is built-ins nvim sequence. It should be work with vim.opt.langmap even without langmapper. (I tested it now – work for me with and without langmapper)

Show your langmapper config and value of langmap, I will see, why it could happen.

v-sim commented 1 year ago

Show your langmapper config and value of langmap, I will see, why it could happen.

Sorry, i am using LazyVim and this has already happened with pure dd,yy,.. but now only with translated. Previous version (with specials_keys,..) work fine. Thanks anyway, I'll look into solutions.

ps: my workaround:

      local map = require("langmapper").map
      map("n", "dd", "dd")
      map("n", "yy", "yy")
Wansmer commented 1 year ago

ps: my workaround:

      local map = require("langmapper").map
      map("n", "dd", "dd")
      map("n", "yy", "yy")

I understand, what is happens.

You should add options { remap = true } or best way, remove these mappings, remove local map = require("langmapper").map and try new feature require('langmapper').automapping() at the end of your init.lua. See README for more info. It is big update for more automation.

v-sim commented 1 year ago

remap = true require('langmapper').automapping()

Does not help. In my case there are many points of failure - lazyvim include noice, mini.ai, which-key,.. folding, "text objects" also don't work. In my case only working:

      local map = require("langmapper").map
      map("n", "dd", "dd")
      map("n", "yy", "yy")
      map("n", "zo", "zo")
      map("n", "zc", "zc")
      map("n", "zf", "zf")
      map("n", "ci", "ci")
      map("n", "di", "di")
      map("n", "vi", "vi")
      map("n", "yi", "yi")
      …

ps: Your new architecture is definitely better (but not for me yet). Of course, I will continue to try options (without downgrade to previous version) and if I find a solution, I will write here. Thanks for the quick response.

v-sim commented 1 year ago

only when i set hack_keymap = false, work like a charm. thanks.

Wansmer commented 1 year ago

Great!

Wansmer commented 1 year ago

@v-sim, I did an example, how to use Langmapper + LazyNvim with hack_keymap = true: https://github.com/Wansmer/LazyWithLangmapper

If still relevant, checks init.lua, config/options.lua, plugings/which-key.lua and plugins/langmapper.lua. It is a temporary solution, but maximum of your use cases works.