Skip to content

A vim plugin to switch the input method when entering and leaving insert mode for macOS.

License

Notifications You must be signed in to change notification settings

madmansnest/swim.vim

 
 

Repository files navigation

Swim.vim

License

A Vim/Neovim plugin that can switch the current input method when enter and quit insert mode.

Great thanks to swim.

Installation

Using your favorite manager.

dein#add('madmansnest/swim.vim', { 'build', './build.sh' })

Or using Plug.

Plug 'madmansnest/swim.vim', { 'do': './build.sh' }

Usage

All the things works well by default.

When you are leaving insert mode, it will record your current input method and switch to the default one(com.apple.keylayout.ABC by default. Set g:swim_default_input_method variable to change it).

And when you re-enter the insert mode, it will restore your previous input method automatically.

<Leader>q is mapped to toggle the plugin on or off. In case you want to run a macro that enters and exits insert mode multiple times, you can disable the plugin to speed up the macro execution. To change the mapping to <leader>x, add the following command to your vimrc file:

nnoremap <leader>x :call swim#toggle()<cr>

See swim for more detail.

License

The content of this repository are licensed under the MIT License unless otherwise noted. Please read LICENSE for the detail.

About

A vim plugin to switch the input method when entering and leaving insert mode for macOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 88.1%
  • Vim Script 11.0%
  • Shell 0.9%