Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare to functionality provided by built-in keymap #2

Closed
Konfekt opened this issue Nov 15, 2017 · 2 comments
Closed

compare to functionality provided by built-in keymap #2

Konfekt opened this issue Nov 15, 2017 · 2 comments

Comments

@Konfekt
Copy link

Konfekt commented Nov 15, 2017

This plug-in seems to solve a problem similar to :help mbyte-keymap. How about explaining the differences in README.md ?

@Konfekt Konfekt changed the title comparte to functionality provided by built-in keymap compare to functionality provided by built-in keymap Nov 15, 2017
@rlue
Copy link
Owner

rlue commented Nov 15, 2017

Thanks for the suggestion. I've linked this thread in the README. Please let me know if there are any errors.

My understanding

The +keymap feature is basically an IME built into vim that works by loading files that map input keystrokes (or sets of keystrokes) to output characters. Thus, loading a keymap with this rule:

B	Б	CYRILLIC CAPITAL LETTER BE

would make “B” come out as “Б”. These mappings can be toggled with <C-^>, and apply:

  • in Insert mode,
  • when entering a search query for the / command,
  • or otherwise inserting text,

but do not apply:

  • in Normal mode, or
  • when entering a : command

Vim includes 70-odd keymap files by default (in $VIMRUNTIME/keymap), for languages ranging from Arabic to Hebrew to Tamil to Magyar, as well as same-script mappings to simulate different keyboard layouts (e.g., QWERTY to Dvorak) and maps for entering Latin letters with diacritics.

My take

It's wonderfully thoughtful to include this functionality natively, but for anyone who actually uses a dedicated system IME for anything other than vim, it's hard to imagine wanting mbyte-keymaps on top. Now you have two layers of IM management to think about: there might be subtle differences in layout, behavior, or visual feedback; there will most certainly be two different keyboard shortcuts for toggling IMs; and vim offers no visual indication for which keymap is active. For non-alphabetic languages like Chinese, keymaps would be virtually impossible to implement.

@rlue rlue closed this as completed Nov 15, 2017
rlue added a commit that referenced this issue Nov 15, 2017
@thestumbler
Copy link

I have been trying to get Korean / English working more smoothly, and from my experience I can address two reasons why keycap and it's sister langmap aren't helpful for me.

langmap would allow me to keep the system IME in Korean (Hangul) all the time in INSERT mode, but would map keystrokes in NORMAL mode. When I tried to implement this, I discovered a problem (for Korean)... some Korean letters don't have a separate SHIFT value. So there was no way to distinguish between the different APPEND commands, for example: the Korean letter 'ㅁ' is the same, whether you press the SHIFT key or not.

keycap does the opposite, it provides a mapping only in INSERT mode, so you could leave your system IME in English, for example. I tried that, and while it worked, I quickly realized that the system IME does more for me than simply mapping keypresses, in the case of Hangul. Korean syllables are constructed from between 2 to 3 individual letters. The system IME "builds" the syllables as you type. Here's an example using the word 안녕 which is a very casual "hello" in Korean.

With the system IME, as you type the six letters of the word, they are progressively displayed as follows:

  • ㅇ ㅇ
  • ㅏ 아
  • ㄴ 안
  • ㄴ 안ㄴ
  • ㅕ 안녀
  • ㅇ 얀녕

Without this functionality, my simplistic keymap just presented me with:

  • ㅇ ㅏ ㄴ ㄴ ㅕ ㅇ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants