rlue / vim-barbaric

Automatic input method switching for vim
206 stars 15 forks source link

Will vim-barbaric support macism? #22

Open suliveevil opened 2 years ago

suliveevil commented 2 years ago

https://github.com/laishulu/macism/

It's simple and reliable on macOS.

# show current Input Method
macism
# change IM to 简体拼音
macism com.apple.inputmethod.SCIM.ITABC

# change IM to ABC(English)
macism com.apple.keylayout.ABC
rlue commented 2 years ago

Hi, so sorry, don't know how I missed this. Please try the feature/macism-support branch and tell me if it works!

suliveevil commented 2 years ago

Couldn't work.

/Users/XXXXXX/.vim/pack/macvim/start/vim-barbaric/plugin/barbaric.vim
Line 69:
E171: endif
rlue commented 2 years ago

Whoops, silly mistake. Unfortunately, I can't push the fix right now because I'm on my work laptop, which doesn't have my personal git credentials—but perhaps I could ask you to apply the change manually and tell me if it works then?

Option 1: in your editor

On L27 of /Users/XXXXXX/.vim/pack/macvim/start/vim-barbaric/plugin/barbaric.vim:

--- a/plugin/barbaric.vim
+++ b/plugin/barbaric.vim
@@ -24,7 +24,7 @@ if !exists('g:barbaric_ime')

   if g:barbaric_uname == 'Darwin' && executable('xkbswitch')
     let g:barbaric_ime = 'mac-xkbswitch'
-  if g:barbaric_uname == 'Darwin' && executable('macism')
+  elseif g:barbaric_uname == 'Darwin' && executable('macism')
     let g:barbaric_ime = 'macism'
   elseif exists('g:barbaric_libxkbswitch')
     let g:barbaric_ime = 'xkb-switch'

Option 2: using sed

$ sed -i 's/\(if.*macism\)/else\1/' /Users/XXXXXX/.vim/pack/macvim/start/vim-barbaric/plugin/barbaric.vim
suliveevil commented 2 years ago

I haven't using vim for about two years, couldn't even understand vimrc config now. Maybe I'd better using my macism.vim instead of taking care of other Operating Systems.