Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using Vim as an input method for X11 apps

NotificationsYou must be signed in to change notification settings

algon-320/vime

Repository files navigation

Using Vim as aninput method editor for X11 applications.

  • Like other IMEs, you can use vime (almost) anywhere you need to input text.
  • Unlike other IMEs, vime itself does not provide any text conversion to different languages.

demo

In the above demo, I usedfcitx with vime to input Japanese sentences.

Installation

  1. Clone this repo recursively, and then apply patches to the dependencies:
$ git clone https://github.com/algon-320/vime.git --recursive$ ./apply_patches.sh
  1. Copy the configuration files:
$ mkdir -p ~/.config/vime$ cp config_example/* ~/.config/vime
  1. Install the terminfo fortoyterm, which is a terminal emulator vime uses to run Vim:
$ tic -x -o ~/.terminfo/ toyterm/toyterm.info
  1. (Optionally) Install vime:
$ cargo install --path ./vime

To uninstall vime, do the opposite:

$ cargo uninstall vime$ rm -r ~/.config/vime$ rm ~/.terminfo/t/toyterm.info

Usage

  1. Start a vime process:
$ cargo run --release

or if you installed vime:

$ vime

Note for those who are using another input method, you can use it with vime.To do that, please make sure$XMODIFIERS is defined properly for the vime process.For example to usefcitx with vime:

$ XMODIFIERS="@im=fcitx" vime
  1. (Open another terminal and) set the following environment variables:
$ export XMODIFIERS="@im=vime" # for X11 apps$ export GTK_IM_MODULE="xim"   # for GTK apps$ export  QT_IM_MODULE="xim"   # for Qt apps

NOTE: vime might not work in Qt apps for now.I am going to create a Qt plugin to work properly, but it is WIP yet.

  1. Start your favorite application (e.g. Firefox).
  2. Focus any input field (e.g. HTML form).
  3. HitAlt+RightShift key to trigger (toggle) vime.
  4. Write some text and save it with:wq normally.
  5. The text you've just written would be inserted in the input field.

Customization

vimrc

Since vime starts a Vim with~/.config/vime/vimrc by default,you can customize vim behavior by editing it.

different text editor

If your favorite text editor is runnable in a terminal, then you should be able to use it as input method.To change the editor to use, setVIME_EDITOR environment variable for the vime process.If the variable is not defined, vime will use/usr/bin/vim -u ~/.config/vime/vimrc instead.

The following example shows how to use Emacs as an input method:

$ VIME_EDITOR='/usr/bin/emacs -nw' vime

trigger key

To change the key combination to trigger vime, edittrigger_key_state andtrigger_key_keycode fields in~/.config/vime/config.toml.

  • trigger_key_state is the state of modifier keys.
  • trigger_key_keycode is the keycode of the key.
  • Note that these values can differ for different physical keyboards.

You can use thexev utility to lookup the values of your favorite key combination.

terminal appearance

You can also configure the terminal by editing~/.config/vime/config.toml.

See thetoyterm repo for details about toyterm.

License

  • patches/xcb-imdkit-rs.patch, the patch file forxcb-imdkit-rs, is licensed under LGPLv2.1
  • patches/winit.patch, the patch file forwinit, is licensed under Apache-2.0
  • the other parts are licensed under Apache-2.0

Architecture

architecture

About

Using Vim as an input method for X11 apps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp