XVimProject / XVim2

Vim key-bindings for Xcode 9
MIT License
2.31k stars 182 forks source link

imap on Option(Alt/Meta) modifier like <M-j> does not work #317

Open ypresto opened 3 years ago

ypresto commented 3 years ago

I often use Alt+j/k/h/l to exit insert mode on regular vim.

But with XVim2 mapping on <M-...> in insert mode (like inoremap <M-j> <Esc>j) does not work.

It is because passing ∆/˚/˙/¬ to handleXVimString method, instead of raw key j/k/h/l with modifier flag. https://github.com/XVimProject/XVim2/blob/6356710fdf4a7edc816d49474ad6c415afc70897/XVim2/XVim/XVimWindow.m#L417

I tried to fix by using self.event.toXVimString but I could not find the way to get characters with modifier (∆/˚/˙/¬) from raw keys (j/k/h/l). So we should choose one of below to solve this.