Wansmer / langmapper.nvim

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

the character " i " becomes " ' " in insert mode. #27

Closed agoodfellow123 closed 4 months ago

agoodfellow123 commented 4 months ago

Hello, me again! I haven't changed anything on this particular plugins settings but the letter " i " become " ' " in insert mode today. This plugin was my last suspect, after eliminating everything else I disabled the langmapper plugin and noticed that the issue is solved. Which is weird since the plugin was updated a week ago. Perhaps it's fighting with another plugin. As a side note I did some tests and tried to see where i was mapped this was the result: :imap i image Then I read your issue #25 and thought it might be fixed, unfortunately it is still there.

Wansmer commented 4 months ago

Hi! By default, langmapper should not affect mappings in insert mode:

  ---@type string[] Usually you don't want insert mode commands to be translated when hacking.
  ---This does not affect normal wrapper functions, such as `langmapper.map`
  disable_hack_modes = { 'i' },

If you have not changed this parameter in the settings and the problem is still reproduced, please provide a minimally reproducible example that contains settings for langmapper and for cmp only, without any other plugins.

agoodfellow123 commented 4 months ago

Hello, I checked the line line you provided and it is the same on my config, here is all the lines I changed:

local tr = [["qwertyuıopğüasdfghjklşi,zxcvbnmöç.]] local tr_shift = [[éQWERTYUIOPĞÜASDFGHJKLŞİ;ZXCVBNMÖÇ:]]

escape(tr_shift) .. ';' .. escape(en_shift), escape(tr) .. ';' .. escape(en),

  use_layouts = {"tr"},
  ---@type table Fallback layouts
  layouts = {
    ---@type table Fallback layout item. Name of key is a name of language
    tr = {
      ---@type string Name of your second keyboard layout in system.
      ---It should be the same as result string of `get_current_layout_id()`
      id = 'tr',
      ---@type string Fallback layout to translate. Should be same length as default layout
      layout = [[éQWERTYUIOPĞÜASDFGHJKLŞİ;ZXCVBNMÖÇ:"qwertyuıopğüasdfghjklşi,zxcvbnmöç.]],  -- vi layout
      ---@type string if you need to specify default layout for this fallback layout
    },
  },

Moreover, you can check my config here: https://github.com/agoodfellow123/NEON/blob/main/lua/plugins/5-z-lang-mapper.lua

agoodfellow123 commented 4 months ago

I have realized that the " , " button and the down arrow are also mapped to the" ' " character.

agoodfellow123 commented 4 months ago

Heya! I have solved the problem, but not with langmapper. Check this out: https://github.com/agoodfellow123/NEON/blob/main/lua/base/4-z-mappings.lua

As I was binding ş to i (because I use jklş instead of hjkl) i realized that nvim doesn't accept i there and will be an invalid binding. So instead i bind ş to i's American keyboard equivalent, which is ' same for any key that required foreign keys in the right hand side.

Hope this will help you in some way.

Wansmer commented 4 months ago

Ok, so this is not a langmapper issue. Then I close the issue.