Vim input

From The Toaq Wiki
Revision as of 04:04, 22 September 2024 by Neaqbua (talk | contribs) (minor clarification)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This article explains how to write Toaq in the text editor vim.

Using a keymap

Copy the contents below into a file called toaq.vim inside a folder named keymap in your .vim directory (create it if it doesn’t exist). Then, in insert mode, you may use any of the two-keystroke “combinations” and have them replaced with accented letters on the fly. (See :help mbyte-keymap for more detailed information.)

Without underdot With underdot
falling tone .
rising tone / '
glottal tone : "
hiatus tone > ^
Toaq vim keymap

Using digraphs

Alternatively, for sporadic usage, you can enter Toaq characters using Ctrl+K followed by two keystrokes (see :help digraph). Ꝡ is not available to input using this method.

Character Combo
rising tone Ctrl+K vowel '
glottal tone Ctrl+K vowel :
hiatus tone Ctrl+K vowel >
dotless i (ı) Ctrl+K . i
left quote («) Ctrl+K < <
right quote (») Ctrl+K > >

Using an existing keyboard layout

If you already have a Toaq keyboard layout (for example, by following the XKB instructions), then you can :source the following script to make vim automatically switch layouts depending on vim's current mode. This functionality is toggled on or off each time you source the script in the same buffer.

Follow the TODO instructions to make it work on your system. If you use an XKB method, be sure to use the name you gave your layout in evdev.lst and evdev.xml.

.vimrc-toaq

You might want to add mappings to your ~/.vimrc to quickly source the script:

noremap <Leader>t :source ~/.vimrc-toaq<CR> " toggle in current buffer
noremap <Leader>T :windo source ~/.vimrc_toaq<CR> " toggle in every window