Git Product home page Git Product logo

im-select's Introduction

im-select

Switch your input method from terminal. This project is a basic support for VSCodeVim. It provides the command line program for VSCodeVim's autoSwitchIM function

Installation

macOS

Run following command in your terminal:

curl -Ls https://raw.githubusercontent.com/daipeihust/im-select/master/install_mac.sh | sh

The im-select program will be downloaded to your /usr/local/bin/ path.

windows

Download the im-select.exe, and move it to the proper path.(If you need the 64 bit version, you can download this one.)

linux

You don't have to install this for linux. linux have tools to switch input methods

Usage

macOS

If your PATH contains /usr/local/bin, you can just use im-select instead of /usr/local/bin/im-select

To get current input method key

/usr/local/bin/im-select

To switch current input method

/usr/local/bin/im-select imkey

For example /usr/local/bin/im-select com.apple.keylayout.US

linux

ibus

@mengbo provided this configuration for ibus

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "xkb:us::eng",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/ibus engine",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/ibus engine {im}"

xkb-switch

@VEL4EG provided this configuration for xkb-switch

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "us",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/local/bin/xkb-switch",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/xkb-switch -s {im}"

fcitx

@yunhao94 provided this configuration for fcitx

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "1",
"vim.autoSwitchInputMethod.obtainIMCmd": "/usr/bin/fcitx-remote",
"vim.autoSwitchInputMethod.switchIMCmd": "/usr/bin/fcitx-remote -t {im}",

gdbus

@d-r-q

Put gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().currentSource.index" | awk -F'[^0-9]*' '{print $2}' into get-im.sh.

Put gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval "imports.ui.status.keyboard.getInputSourceManager().inputSources[$1].activate()" into set-im.sh.

"vim.autoSwitchInputMethod.enable": true,
"vim.autoSwitchInputMethod.defaultIM": "0"
"vim.autoSwitchInputMethod.obtainIMCmd": "<path to get-im.sh>",
"vim.autoSwitchInputMethod.switchIMCmd": "<path to set-im.sh> {im}",

windows

The im-select.exe is command line program, but it can't work in cmd or powershell. It's microsoft's fault, the keyboard API doesn't support in cmd and powershell. I recommend you git-bash.

Note: The git-bash is not required. It's only used to get current input method key, which needed in VSCodeVim's configuration.

To get current keyboard locale

/path/to/im-select.exe

To switch current keyboard locale

/path/to/im-select.exe locale

Note: The path in windows is like: C:\Users\path\to\file

im-select's People

Contributors

daipeihust avatar yunhao94 avatar

Watchers

James Cloos avatar

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.