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

eskk introduces side effects (<C-j> mapping) #229

Open
x-yuri opened this issue May 12, 2020 · 9 comments
Open

eskk introduces side effects (<C-j> mapping) #229

x-yuri opened this issue May 12, 2020 · 9 comments

Comments

@x-yuri
Copy link
Contributor

x-yuri commented May 12, 2020

I occasionally execute some commands by first typing them in a buffer, e.g.: a:!ls<Esc>YY@". With eskk YY copies :!ls^J into the " register, but when it comes to executing the command (@"), ^J gets interpreted by eskk which enables hiragana mode, instead of executing the command. That is, I need to additionally press <Enter> for it to work. And after that hiragana mode remains enabled. I'm using <C-j> for another purpose anyway, so I mapped:

imap <Leader>j <Plug>(eskk:toggle)

But <C-j> was still getting interpreted. So I did:

let g:eskk#no_default_mappings = 1

In other words, I've found a workaround, so I'm not sure if I should've reported this.

Also, I have a couple of questions, such as:

  1. Do I need g:eskk#dictionary for it to work? Or having just g:eskk#large_dictionary would suffice?
  2. Does eskk change the dictionaries? If so, under which circumstances?
  3. g:eskk#start_completion_length is 3 by default. I understand why it's usually done, but in this case if I want to convert a 2 kana word like ある, いう, or あう to kanji, I have to change the default. On the other hand, I don't see 有る, 言う, or 会う in the SKK-JISYO.L dictionary. Okay, some words are probably generally written in kana, which might be the case here. But aren't there "< 3" kana words that are usually written in kanji? In other words, does one usually wants to set the default to 1?

Is it okay to ask them here? Or is there a better place?

In any case, thanks for your work :)

@Shougo
Copy link
Collaborator

Shougo commented May 12, 2020

In other words, I've found a workaround, so I'm not sure if I should've reported this.

Hm. I get it.
It seems Vim's macro executing feature. It cannot be fixed by eskk side.

But was still getting interpreted. So I did:

Hm. But why it is needed?
eskk check the mappings.

  if s:hasmapto('<Plug>(eskk:toggle)', 'i')
    silent! imap <unique> <C-j>   <Plug>(eskk:toggle)
  endif

Please upload the minimal vimrc. I will test it later.

@Shougo
Copy link
Collaborator

Shougo commented May 12, 2020

Do I need g:eskk#dictionary for it to work?

Yes. Because, it is used for user learning.
The large dictionary does not have user learning information.
But it has default value. You don't need to set it manually.

g:eskk#dictionary			*g:eskk#dictionary*
							(Default: See below)
	User dictionary's information.

@Shougo
Copy link
Collaborator

Shougo commented May 12, 2020

Does eskk change the dictionaries? If so, under which circumstances?

eskk only writes user dictionary.
eskk does not change large dictionary file.

@Shougo
Copy link
Collaborator

Shougo commented May 12, 2020

In other words, does one usually wants to set the default to 1?

You can change the value. But I don't change the value.
Because you can change the value and if change the value, henkan will be slower to search candidates. It should not be default.

Is it okay to ask them here? Or is there a better place?

Unfortunately, other place does not exists...

@x-yuri
Copy link
Contributor Author

x-yuri commented May 12, 2020

But was still getting interpreted. So I did:

let g:eskk#no_default_mappings = 1

Hm. But why it is needed?
eskk check the mappings.

  if s:hasmapto('<Plug>(eskk:toggle)', 'i')
    silent! imap <unique> <C-j>   <Plug>(eskk:toggle)
  endif

Please upload the minimal vimrc. I will test it later.

Good point. I needed it because I didn't cmap <Plug>(eskk:toggle) (only imap). That is, when I do cmap <Leader>j <Plug>(eskk:toggle), let g:eskk#no_default_mappings = 1 is no longer needed.

Do I need g:eskk#dictionary for it to work?

Yes. Because, it is used for user learning.

Oh, to be frank initially I thought g:eskk#dictionary must point to SKK-JISYO.S. Now I see that it keeps track of words I autocompleted.

The large dictionary does not have user learning information. But it has default value. You don't need to set it manually.

The thing is my journey started here, where they suggest to download the dictionary. But now that you mention it, I can see OS packages with the dictionaries:

https://www.archlinux.org/packages/community/any/skk-jisyo/
https://packages.ubuntu.com/eoan/skkdic
https://packages.ubuntu.com/eoan/skkdic-extra

Which makes me think, that /usr/share/skk/SKK-JISYO.L would be a better default. /usr/local suggests that one has to build some package from source (make install) to install the dictionary.

You can change the value. But I don't change the value (g:eskk#start_completion_length).

Can you possibly explain why? Haven't you ever needed to convert a 1- or 2-kana word to kanji? If so, what did you do?

Any chance you can suggest an IM framework/engine? From what I can see the most popular ones are Fcitx, IBus, SCIM, uim, Anthy, libkkc, Mozc, SKK. And probably a font(s)?

@Shougo
Copy link
Collaborator

Shougo commented May 13, 2020

Which makes me think, that /usr/share/skk/SKK-JISYO.L would be a better default. /usr/local suggests that one has to build some package from source (make install) to install the dictionary.

Hm. I have checked my configuration and I have set it to /usr/share/skk/SKK-JISYO.L.
I also think it is better default.

@tyru What do you think?

Can you possibly explain why? Haven't you ever needed to convert a 1- or 2-kana word to kanji? If so, what did you do?

Yes. Because if it is short word, I don't need the completion.

Any chance you can suggest an IM framework/engine? From what I can see the most popular ones are Fcitx, IBus, SCIM, uim, Anthy, libkkc, Mozc, SKK. And probably a font(s)?

I use fcitx + mozc or eskk in Vim.

@Shougo
Copy link
Collaborator

Shougo commented May 13, 2020

Good point. I needed it because I didn't cmap (eskk:toggle) (only imap). That is, when I do cmap j (eskk:toggle), let g:eskk#no_default_mappings = 1 is no longer needed.

Uh, I get it. You have used <C-j> for other feature...

@x-yuri
Copy link
Contributor Author

x-yuri commented May 16, 2020

Yep, and not for vim's feature, if you ask me. I use <C-j>/<C-k> to switch between tmux windows (I rarely run vim not under tmux). So I decided to use a <Leader> mapping. I needed it only for insert mode, so I didn't bother with cmap'ping <Plug>(eskk:toggle). Which is why eskk cmap'ped <C-j>, and that interfered with me running commands.

Sorry for being persistent, but it seems like I'm missing something important here:

Because if it is short word, I don't need the completion.

Is there a way to enter a kanji without autocompletion?

@Shougo
Copy link
Collaborator

Shougo commented May 16, 2020

Is there a way to enter a kanji without autocompletion?

You can press <Space> to convert hiragana to kanji.

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

2 participants