import { op } from "https://deno.land/x/ddc_vim@v3.9.1/deps.ts";
const { langmap } = op;
This option allows switching your keyboard into a special language
mode. When you are typing text in Insert mode the characters are
inserted directly. When in Normal mode the 'langmap' option takes
care of translating these special characters to the original meaning
of the key. This means you don't have to change the keyboard mode to
be able to execute Normal mode commands.
This is the opposite of the 'keymap' option, where characters are
mapped in Insert mode.
Also consider setting 'langremap' to off, to prevent 'langmap' from
applying to characters resulting from a mapping.
This option cannot be set from a modeline
or in the sandbox
, for
security reasons.
Example (for Greek, in UTF-8):
:set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz
Example (exchanges meaning of z and y for commands):
:set langmap=zy,yz,ZY,YZ
The 'langmap' option is a list of parts, separated with commas. Each part can be in one of two forms:
- A list of pairs. Each pair is a "from" character immediately followed by the "to" character. Examples: "aA", "aAbBcC".
- A list of "from" characters, a semi-colon and a list of "to" characters. Example: "abc;ABC" Example: "aA,fgh;FGH,cCdDeE" Special characters need to be preceded with a backslash. These are ";", ',', '"', '|' and backslash itself.
This will allow you to activate vim actions without having to switch back and forth between the languages. Your language characters will be understood as normal vim English characters (according to the langmap mappings) in the following cases: o Normal/Visual mode (commands, buffer/register names, user mappings) o Insert/Replace Mode: Register names after CTRL-R o Insert/Replace Mode: Mappings Characters entered in Command-line mode will NOT be affected by this option. Note that this option can be changed at any time allowing to switch between mappings for different languages/encodings. Use a mapping to avoid having to type it each time!
(default "")
only available when compiled with the +langmap
feature