Vim mode for the OmegaT computer-aided translation tool
Download the jar file from the latest release and copy it to your OmegaT plugin directory.
The next time you start OmegaT, the translation editor pane will be in Vim mode.
To uninstall, simply remove the jar file from the plugin directory. When you restart OmegaT, your editing window will no longer be in Vim mode.
Vimish implements a large subset of Vim's features, including:
- Normal, insert, visual and replace modes.
- Character-wise, word-wise and text-object movement/deletion/changes.
- Yanking and putting using the system clipboard or registers.
- Repeating searches, finds and changes.
- Key mappings.
It also implements key chords (mapping two simultaneous key presses to a Vim sequence). Among other things, this lets you map the key combination j
k
in insert mode to <Esc>
(to switch to normal mode). Here's how.
General settings, key mappings and key chords can be viewed and changed in the Vimish options menu, Options -> Preferences -> Plugins -> Vimish
(Vimish
is under the Plugins
subheading in the left-hand pane).
Key maps are equivalent to Vim's noremap mappings (they do not map recursively). Key combos and their respective mappings can be of any length. Any word or punctuation character, as well as the special keys <Esc>
, <CR>
, <BS>
, <Del>
, <Tab>
, <S-Tab>
, <Left>
, <Right>
, <Up>
and <Down>
, can be used as part of the key combo or its mapping.
Key chords are two-key combinations that can map to key sequences of any length. Key chord combos cannot contain special characters, but the mapping they trigger can. For example, we can map the key chord jk
to <Esc>
.
The keys in key chord combos must be pressed simultaneously for their mappings to trigger.
- Go to the Vimish options menu:
Options -> Preferences -> Plugins -> Vimish
(Help me find it). - In the
Key Chords
section, chooseInsert
from theMode
dropdown menu. - Click on the
Add
button to the right. - Type
jk
under theKeys
heading, and<Esc>
under theMapped to
heading, like so: - Click on the
Ok
button at the bottom of the dialog to confirm.
- In the editor window, type
/
or?
to begin a forward/backward search, enter the word to search for (or a unique part of it) and press return to go to the word. - Type
ciw
(mnemonic: change in word), type your replacement word, and hit the<Esc>
key to return to normal mode. - Repeat the search by pressing the
n
key (orN
to repeat the search in the opposite direction). - Hit the period/dot key (
.
) to repeat the last change. - Repeat steps 3 and 4 until done.
Vim control-key combinations are not implemented. On the one hand, this makes things less complicated because all the OmegaT ctrl-key shortcuts will work as expected. On the other, I expect that some users will miss certain Vim ctrl-key functions. In a future version, the user will be able to optionally enable Vim control keys.
Clone repository, then execute:
./gradlew build
(Linux/Mac)
or
gradlew build
(Windows)
from the Vimish
base directory.
The plugin jar file will be created in Vimish/build/libs/
(or Vimish\build\libs\
on Windows).