Giter Club home page Giter Club logo

imtoggle.nvim's Introduction

imtoggle.nvim

An input method switcher for wsl.

Usage

Download the dependencies

Download im-select.exe and make it visible in ${PATH}.

Config

require("imtoggle").setup()

It enables the plugin by default.

Enable

:lua require("imtoggle").enable()

Disable

:lua require("imtoggle").disable()

Acknowledgement

imtoggle.nvim's People

Contributors

meijieru avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

imtoggle.nvim's Issues

macOS 用户可以考虑我的 macism.vim 插件

suliveevil/macism.vim

使用的是 sis 作者和 Mac-input 作者的代码。

Vim 能够检测当前光标和光标之前的 Unicode 字符,感觉如果能找到一个好的触发条件就能够支撑起一个根据当前编辑状态自动切换输入法的插件了。

https://stackoverflow.com/a/64981366
下面这段代码作者关于中文的吐槽:jdhao/nvim-config#26

matchstr(getline('.'), '\%' . col('.') . 'c.')
function! CharAtIdx(str, idx) abort                                       
  " Get char at idx from str. Note that this is based on character index  
  " instead of the byte index.                                            
  return strcharpart(a:str, a:idx, 1)                                     
endfunction
                                                                          
function! CursorCharIdx() abort                                           
  " A more concise way to get character index under cursor.               
  let cursor_byte_idx = col('.')                                          
  if cursor_byte_idx == 1                        
    return 0                      
  endif                                                                   
                             
  let pre_cursor_text = getline('.')[:col('.')-2]                         
  return strchars(pre_cursor_text)                                        
endfunction 

let cur_char_idx = CursorCharIdx()
let cur_char = CharAtIdx(getline('.'), cur_char_idx)

目前 Emacs 上有两个插件 sis 和 pyim 有“探针”功能。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.