Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Generic Input MethodNew to Visual Studio Code? Get it now.
Generic Input Method

Generic Input Method

Hiromi ISHII

|
8,322 installs
| (3) | Free
A generic input method which is suitable for YaTeX-like image completion for LaTeX or Unicode Symbol input for theorem provers such as Lean or Agda.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Generic Input Method for VSCode

Visual Studio Marketplace Visual Studio Marketplace

This extension provides a generic input method within VSCode. It can be used as a YaTeX-like image completion for LaTeX or Unicode Math input for theorem provers such as Agda or Lean.

Features

  • ~~YaTeX-like image-completion for LaTeX~~
    • Since version 0.0.8, LaTeX-related functionalities are moved to CaTeX extension.
  • Unicode Math input for Markdown
  • Ability to configure your own custom input methods!
  • Automatic configuration update

Demos

Unicode Math Input

GIF Anime

Configuration

You can define and/or modify input methods in generic-input-method.input-methods. This must be an array of input method. Each input method is defined as follows:

{
  // Unique name for the input method
  "name": "Example Math Input",

  // Languages where the IM is activated.
  "languages": ["markdown", "latex"],

  // Characters to trigger conversion
  "triggers": ["\\"],

  // How to render each items?
  // Available: "string" or "snippet"; other extension can add more.
  // `string` just prints the content of "body" property.
  // See `defaults/images.json` for examples.
  // You can also define custom expander for render.
  "renderMode": "string",

  // Suffix for a text-editor command;
  // you can invoke it as `extension.complete.custom.example-math`.
  "commandName": "custom.example-math",

  // An array of items or a reference to the default dictionary.
  "dictionary": [
    // Default Math dictionary shipped with this extension
    "defaults/math.json",

    // Push `\||-` to input `\Vvdash`.
    // Shows `⊪` as a preview.
    { "label": "|||-", "body": "\\Vvdash", "description": "⊪" }
  ]
}

Currently, you can only refer to the default dictionaries shipped with the generic-input-method extension.

External API

This extension provides an API to un/register custom input methods.

Registering a new Input Method dynamically

import { extensions, ExtensionContext } from "vscode";

function async activate(context: ExtensionContext) {
  let ims = extensions.getExtension("mr-konn.generic-input-method");
  if (gim) {
    const api: any = await gim.activate();
    const im: any = {
      name: "My Great IM Dynamically Registered",
      languages: ["redtt"],
      triggers: ["\\"],
      dictionary: ["defaults/math.json", { label: "to", body: "→" }]
    };
    api.registerInputMethod(im);
  }
}

See CaTeX and redtt-diagnostics for an example usage.

Invoking Input Method Forcedly

You can use api.invokeInputMethod(editor?, nameOrIM?) to invoke an input method, regardless of the language of editor.

TODOs

  • Cool screenshot GIFs
  • Underlining converted input
  • Contextual completion based on scopes
  • Split LaTeX-related input methods as an external extension?
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft