Super full and super detailed Rime input method configuration guide

Posted by Darkness31 on Tue, 01 Feb 2022 21:11:08 +0100

1. Why RIME

There are many input methods on the market. Whether Sogou or QQ input methods are basically the same, but RIME is a special existence among many input methods.

The reason why it is special is that most input method tools are shaped when they leave the factory. There are only some custom options, which are also defined when they leave the factory. However, RIME is different. It is a local input method (without cloud). It can be highly customized and realize many functions, including the size and skin of candidate boxes, thesaurus and phrases. By modifying the local configuration file, it will finally be polished into an input method that fully conforms to your input habits.

For example, after customization, you can enter the name of your school through Pinyin; By entering your name, your own name appears; Enter QQ, your own QQ number appears, and so on. Of course, the functions of RIME are far more than these. You can also specify the extended thesaurus. When you enter, which words appear and which do not appear are customized by you; RIME can also define some small functions for comparison, such as obtaining the current time and date

Acquisition time:

Date of acquisition:

However, RIME input method also has a certain threshold. It is precisely because this advantage is its disadvantage - the difficulty brought by high customization, which has persuaded a large number of people to retreat.

Therefore, this paper hopes to help people who need customized input methods get started quickly and finally carve into what you want through some logical and relatively simple configuration methods.

2.RIME installation

resources

RIME official website

Rim installation package download

Input scheme Download

Take the Windows platform as an example

  1. Rime input method has different names in different system platforms:

    platformnameTranslated name
    UnixRimeZhongzhou intonations
    WindowsWeaselWolf hair
    MacSquirrelRat whisker tube
    AndroidTrimeTongwen

    Different platforms, different names, installation methods and customization methods also have the corresponding characteristics of each platform, but the use experience is the same.

  2. Download the windows software installation package on the official website and follow the installation wizard to complete the installation. One thing to note during the installation process is that on the user folder page, the default location is in the windows personal folder ~ \ AppData\Roaming\Rime. You can also select me to specify the location, fill in the absolute path of the folder you specify in the blank box below, and the user folder is used to store custom configuration files.

  1. After the IME input method is installed, this is the default

Obviously, this is beautiful enough, and the font is traditional. The later content will explain beautification in detail.

  1. Right click the rim icon and click input method setting to select your favorite default input method scheme and default skin.

Choose your common input method scheme

Choose your favorite skin

To switch the input method scheme, press F4, and then select the corresponding number to select the input method scheme you use.

  1. So far, the IME input method can be basically used. Of course, we will not be satisfied with this. The configuration of this input method is the key. The customization of this input method will be described in detail below.

3. Rim configuration file

The customization of RIME input method is to realize the required functions by editing the configuration file. The configuration file is a file in yaml format, which is encoded by UTF-8 YAML Text, which is written in YAML, a highly readable data description language. To understand YAML document format, please visit The Official YAML Web Site.

The following is a brief introduction to the basic knowledge of Rime input method:

  1. User configuration folder location

    The user configuration folder stores all configuration files of rime input method. The location of the folder can be opened by right clicking the desktop rim icon and clicking the user folder.

    When the installation is just completed, the contents of the folder are as follows:

    Note: do not modify the contents in the build folder. Other files are configuration files.

  2. Redeployment

    Redeployment is a function that we must know. Whenever we modify the configuration file, the corresponding function will not be realized immediately, but will not be realized until we redeploy. You can understand redeployment as refresh. The method of redeployment is as follows:

  3. Rime user data file format

    When configuring our own data, we cannot directly modify the important configuration files generated by default in the software, because various settings and preset input schemes will be upgraded when the software is upgraded. If we add some of our settings to these documents, these documents will be overwritten with a higher version during update, resulting in data loss.

    Therefore, in order to ensure no data loss, when modifying the configuration file, create a file name whose main part is the same as the file to be customized and whose secondary extension is custom customized documents:

    Example:

    To modify the configuration file, default yaml

    Then create a new defarlt custom. Yaml for configuration

    When you're in * custom. The yaml file has been modified. After clicking redeploy, the settings of the file will be modified as the patch * Yaml file.

  4. Distribution and function of Rime user data files

  • [global setting] default yaml

  • [release setting] weasel yaml

  • [defau lt input scheme copy] < scheme ID > schema. yaml

  • ※ [installation information] installation yaml

  • ※ [user status information] user yaml

Binary files generated by compiling the input scheme:

  • [Rime prism] < scheme identification > prism. bin

  • [Rime solid state dictionary] < dictionary name > table. bin

  • [Rime reverse dictionary] < dictionary name > reverse. bin

Documents recording users' writing habits:

  • ※ [user dictionary] < dictionary name > userdb. kct

  • ※ [user dictionary snapshot] < dictionary name > userdb. Txt, < < dictionary name > userdb. kct. The snapshot can be found in the synchronization folder

And the user's own settings:

  • ※ [user customized information for global settings] default custom. yaml

  • ※ [user's customized information for preset input scheme] < scheme identification > custom. yaml

  • ※ [user-defined input scheme] and supporting dictionary source files

Note: the above documents marked with "※" and "bold" contain user data. You should pay attention to backup when cleaning the documents!

4. Installation of more input schemes

  1. Click on the website Input scheme Download Download the input method scheme you need;

Here, take Shuangpin as an example to download the Shuangpin input scheme.

  1. Introduction to input scheme

    ① Complete spelling

    ② Double spelling: one key for initials and one key for vowels can improve typing efficiency. You need to remember the position of vowel keys. There are more than one schemes for double spelling input. I use Xiaohe double spelling.

    ③ Earth Pinyin input scheme: it is convenient to input earth Pinyin, that is, Pinyin with tone. Examples are as follows:

    Earth Pinyin scheme RIme address input method

    ④ Five strokes: input words according to strokes. You need to remember the root of words. There are many online tutorials.

    ⑤ Cangjie: similar to Wubi, it is based on strokes, but Cangjie is more used for traditional Chinese character input.

  2. Example: installation of double splicing

    download  rime-double-pinyin , copy the yaml ending file of the corresponding double spelling in the folder to the user's folder, and click the icon to open the input method setting and open the double spelling.

5. Appearance setting

User appearance settings need to be modified weasel Yaml file, as mentioned earlier, cannot be modified directly Yaml, need to create a new weasel custom. yaml.

Note: the newly created yaml file should be encoded in UTF-8 (the same is true for the newly created file below, which will not be repeated). After the new file is created, open it and click Save as to display the encoding method

After new creation, add content. The content of my profile is as follows. See notes for corresponding functions:

patch:

  app_options/cmd.exe:
    ascii_mode: true

  app_options/photoshop.exe:
    ascii_mode: true

 #Scheme I
  "preset_color_schemes/xiluo":
     name: xiluo
     author: "Jankin <jhtt@gmail.com>"
     back_color: 0xFFFFFF           # Background color
     border_color: 0xE2E2E2         # The border color is the same as the background color, which is the effect of no border
     text_color: 0x424242           # Text color of the selected area 0x424242 # 0xFFFFFF
     hilited_text_color: 0x000000   # Selected area letter color
     hilited_back_color: 0xFFFFFF   # Internal selection area letter background color
     hilited_candidate_back_color: 0xf9cb8b  #Activate the text background color of the candidate
 # 0xe7a23f  0xFFD6AC 0xffcf9a  0xd77800 0xb76a00  0xdaa45a 0xCE7539 
 # 0xdaa45a 0xED9564 0xFFF0E4 0xffcc33 0xb76a00  0xe89f00   0xED9564   
     hilited_candidate_text_color: 0x000000  #Activate the text color of the candidate 0xFFFFFF
     candidate_text_color: 0x000000           # Other candidate text colors
     comment_text_color: 0xbdaead  #Pinyin and other prompt text color e4dfd7 999999 0xb7a091
     label_color: 0xcac9c8    #Serial number color dad4cb 0xcac9c8
     
   "style/color_scheme": xiluo      #Color scheme
   "style/font_face": "Hanyi Zhengyuan-55W" #typeface
   "style/font_point": 14           #font size
   "style/label_font_face": "Fira Code"
   "style/label_font_point": 28     
   "style/inline_preedit": true     # Embedded candidate window single line display
   "style/horizontal": true         #Candidate row
   "style/display_tray_icon" : true #The tray icon is displayed. false is recommended, otherwise two icons appear
   "style/layout/border": 0
   "style/layout/border_width": 0 
   "style/layout/candidate_spacing": 28  # Candidate word spacing
   "style/layout/hilite_padding": 11    #Candidate word background color block height if you want the candidate word background color block to fill the candidate box without boundary, you only need its height to be consistent with the upper and lower margins of the candidate word
   "style/layout/hilite_spacing": 3     # Interval between sequence number and candidate word
   "style/layout/margin_x": 10       #Left and right margins of candidate words
   "style/layout/margin_y": 10       #Top and bottom margins of candidate words
   "style/layout/round_corner": 25    #Candidate word background color block fillet amplitude
   "style/layout/spacing": 10
   # Scheme II
   "preset_color_schemes/Wii2":
     author: PYatoo
     back_color: 0xefefef
     border_color: 0xefefef
     candidate_text_color: 0x575759
     comment_text_color: 0xcac9c8
     hilited_back_color: 0xefefef
     hilited_candidate_back_color: 0xED9564
     hilited_candidate_text_color: 0xffffff
     hilited_comment_text_color: 0xffffff
     hilited_text_color: 0xED9564
     label_color: 0xcac9c8
     name: Wii2
     text_color: 0x575759
   "style/color_scheme": Wii2
   "style/display_tray_icon": true
   "style/font_face": "Microsoft YaHei "
   "style/font_point": 12
   "style/horizontal": false
   "style/inline_preedit": false
   "style/layout/border": 0
   "style/layout/border_width": 0
   "style/layout/candidate_spacing": 12
   "style/layout/hilite_padding": 8
   "style/layout/hilite_spacing": 3
   "style/layout/margin_x": 8
   "style/layout/margin_y": 8
   "style/layout/round_corner": 7
   "style/layout/spacing": 10

Color matching is explained as follows:

The final effect of configuration is as follows:

6. User global settings

Similarly, create a new default in the user folder custom. Yaml file, fill in the following, the contents of the file are as follows, and the corresponding functions are shown in the notes:

customization:
  distribution_code_name: Weasel
  distribution_version: 0.14.3
  generator: "Rime::SwitcherSettings"
  modified_time: "1 May 20, 2014:52:14 2022"

patch:
#Left Shift key input characters directly switch to English on the screen, and the input state changes to English.
  ascii_composer/good_old_caps_lock: true
  ascii_composer/switch_key:
    Caps_Lock: noop       #noop is telling Caps_Lock key failure
    Shift_L: commit_code
    Shift_R: inline_ascii
    Control_L: clear      #Press this key after inputting a paragraph of characters, the characters will be cleared, and the RIME input state will be switched to English input.
    Control_R: commit_text    #Press this key, the text will appear on the screen, and RIME will switch to English input

  "key_binder/bindings":        #Use [] to page candidates
    - {accept: bracketleft, send: Page_Up, when: paging}
    - {accept: bracketright, send: Page_Down, when: has_menu}

  "menu/page_size": 9       #Number of candidate words

  "switcher/hotkeys":       #Change the F4 hotkey to ctrl+~
    - "Control+grave"
    
  schema_list:
    - {schema: luna_pinyin_simp}
    - {schema: easy_en}
    - {schema: double_pinyin_flypy}

  "translator/enable_user_dict": true
  "translator/enable_encoder": true #Whether to turn on automatic word formation (table only)_ Translator valid]
  "translator/encode_commit_history": true #Whether to automatically generate words for words that have been added (table only)_ Translator effect
  "translator/enable_sentence": true #Whether to turn on automatic sentence making

The options that can be set by ctrl and shift shortcut keys are described as follows:

inline_ascii: input letters, numbers, symbols, spaces, etc. in the temporary western language editing area of the input method, and automatically reset to Chinese after entering the screen. commit_text: enter the candidate text on the screen and switch to the western language input mode. commit_code: enter the coded characters on the screen and switch to the western language input mode. noop: mask the switch key.

clear: # enter a character and press this key, the character will be cleared, and the RIME input status will be switched to English input.

Press esc to clear and keep Chinese

7. User input scheme setting

This file is the most important file for configuration. Most settings are in this file. Here, take Xiaohe Shuangpin as an example to configure. First, you need to create a new file double_pinyin_flypy.custom.yaml, refer to the code below for the contents of the document, with notes

If you need to know the meaning of each statement in detail, you can refer to website

# Rime schema
# encoding: utf-8
patch:
#This code is to set the extended thesaurus to Xiluo Shuangpin Dict.yaml, which will be introduced later
  'translator/dictionary': xiluo shuangpin

  translator/initial_quality: 1 # The priority of the main translator is set to 1
  translator/enable_completion: true # Turn on key by key prompt
  translator/preedit_format: {} # When entering double spelling, it will not be converted to full spelling
# Turn on relevant settings of automatic word formation
  translator/enable_sentence: true          # Turn off sentence input
  translator/enable_user_dict: true         # Whether to open user dictionary (record word frequency and user word)
  translator/enable_encoder: true           # Automatic word making
  translator/encode_commit_history: true     # Whether to automatically create words for words on the screen

  translator:
    dictionary: wubi86.extended    #Dictionary file
    user_dict: wb86    #Locally generated user dictionary name
    db_class: tabledb  #User dictionary format, tabledb (text) or userdb (binary)
    initial_quality: 0.5    #Output priority of this translator
    enable_completion: true    #Code gradually prompt switch; Coding tips
    enable_charset_filter: true    #Character set filtering, low weight shape code is not needed
    enable_sentence: false  #Whether the whole sentence is typed continuously and whether the sentence is made automatically, otherwise it will be four yards automatically on the screen
    enable_encoder: true    #Whether to automatically create words
    encode_commit_history: true    #Integrate the content on the screen into entries and see the demand
    max_phrase_length: 10    #Maximum number of words for automatic word formation
    enable_user_dict: true    #Whether to open the user dictionary to record the dynamic word frequency and user word frequency
    disable_user_dict_for_patterns:
    #  - "^z.*$"  #This is the original default setting
      - "^[a-y]{1,3}$"  #Automatic frequency modulation and word formation are not used for code 3 and below
    comment_format:
      - xform/^~//
      - xform/^([a-zA-Z]{4,})/✽/

#Yan character github, which is also introduced below
  switches/@next:
    name: emoji_suggestion
    reset: 1
    states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
  'engine/filters/@before 0':
    simplifier@emoji_suggestion
  emoji_suggestion:
    opencc_config: emoji.json
    option_name: emoji_suggestion
    tips: all

  #Realize English input, both Chinese mixed input, and the expansion of thesaurus is also introduced below
  # Load easy_en dependence
  "schema/dependencies/@next": easy_en 
  # Load the code table translator that translates english and call it english
  "engine/translators/@next":  table_translator@english 
  # Settings for english translator
  english: 
    dictionary: easy_en 
    spelling_hints: 9 
    enable_completion: true
    enable_sentence: false 
    initial_quality: -1

#Custom phrase file, new custom under user folder_ phrase. Txt file, which is also introduced below
  custom_phrase: 
    dictionary: ""
    user_dict: custom_phrase
    db_class: stabledb
    enable_completion: true
    enable_sentence: true
    initial_quality: 1

#  Symbols can be quickly displayed on the screen and can be set according to your own needs. For the most comprehensive symbol content, please refer to symbal Yaml file
  punctuator:
    import_preset: symbols
    half_shape:
      "#": "#"
      "`": "`"
      "~": "~"
      "@": "@"
      "=": "="
      "/": ["/", "÷"]
      '\': [",", '\']
      "'": {pair: ["「", "」"]}
      "[": ["[", "["]
      "]": ["]", "]"]
      "$": ["¥", "$", "€", "£", "¢", "¤"]
      "<": ["<", "〈", "«", "<"]
      ">": [">", "〉", "»", ">"]
  recognizer:
    patterns:
      email: "^[A-Za-z][-_.0-9A-Za-z]*@.*$"
      uppercase: "[A-Z][-_+.'0-9A-Za-z]*$"
      url: "^(www[.]|https?:|ftp[.:]|mailto:|file:).*$|^[a-z]+[.].+$"
      punct: "^/([a-z]+|[0-9]0?)$"
#  'recognizer/patterns/punct': "^/([a-z]+|[0-9])$"

#The translator can realize many small functions, such as obtaining time. For the configuration of this item, see the configuration of lua file below
  'engine/translators':
    - punct_translator
    - reverse_lookup_translator
    #- table_translator
    - table_translator@custom_phrase
    - lua_translator@date_translator
    - lua_translator@time_translator
    - lua_translator@number_translator
    - lua_translator@week_translator
    - lua_translator@lunar_translator
    - lua_translator@alltime_translator
    - lua_translator@calculate_translator 
    - lua_translator@number1_translator
    - lua_translator@number2_translator
    - script_translator
    #- table_translator@custom_phrase #Indicates calling custom_ Phase segment coding
    #- table_translator 

  "engine/processors/@before 0": lua_processor@select_character_processor   #Word determination
  key_binder/+:
    select_first_character: 'Left'   #Left click the first word on the screen
    select_last_character: 'Right'     #Right click the second word

About the above key_ The key names corresponding to binder are as follows

BackSpace	Backspace
Tab	Horizontal locator
Linefeed	Line feed
Clear	eliminate
Return	Carriage return
Pause	Pause
Sys_Req	Printing screen
Escape	sign out
Delete	Delete
Home	in situ
Left	Left arrow
Up	Up arrow
Right	Right arrow
Down	Down arrow
Prior,Page_Up	Upturning
Next,Page_Down	Turn down
End	last place
Begin	Starting position
Shift_L	Left Shift
Shift_R	right Shift
Control_L	Left Ctrl
Control_R	right Ctrl
Meta_L	Left Meta
Meta_R	right Meta
Alt_L	Left Alt
Alt_R	right Alt
Super_L	Left Super
Super_R	right Super
Hyper_L	Left Hyper
Hyper_R	right Hyper
Caps_Lock	Capital lock
Shift_Lock	Upper gear lock
Scroll_Lock	Rolling lock
Num_Lock	Small key plate lock
Select	Select
Print	Print 
Execute	Execute
Insert	insert
Undo	Restore
Redo	redo
Menu	Menu
Find	Search
Cancel	cancel
Help	Help
Break	Interrupt
space
exclam	!
quotedbl	"
numbersign	#
dollar	$
percent	%
ampersand	&
apostrophe	'
parenleft	(
parenright	)
asterisk	*
plus	+
comma	,
minus	-
period	.
slash	/
colon	:
semicolon	;
less	<
equal	=
greater	>
question	?
at	@
bracketleft	[
backslash	
bracketright	]
asciicircum	^
underscore	_
grave	`
braceleft	{
bar	|
braceright	}
asciitilde	~


KP_Space	Small key board space
KP_Tab	Small keyboard horizontal locator
KP_Enter	Small key board enter
KP_Delete	Small key board deletion
KP_Home	Small key plate in situ
KP_Left	Small key board left arrow
KP_Up	Arrow on small key board
KP_Right	Small key board right arrow
KP_Down	Small key board down arrow
KP_Prior,KP_Page_Up	Small key board up
KP_Next,KP_Page_Down	Small key board down
KP_End	Last position of small key plate
KP_Begin	Start position of small key plate
KP_Insert	Small key board insertion
KP_Equal	Small keyboards equal to
KP_Multiply	Small key board multiplier
KP_Add	Small key board plus sign
KP_Subtract	Small key board minus sign
KP_Divide	Small key board division
KP_Decimal	Small key board decimal point
KP_0	Small key board 0
KP_1	Small key plate 1
KP_2	Small key plate 2
KP_3	Small key plate 3
KP_4	Small key plate 4
KP_5	Small key plate 5
KP_6	Small key plate 6
KP_7	Small key plate 7
KP_8	Small key plate 8
KP_9	Small key plate 9

8. Thesaurus

  1. Thesaurus settings

Rime can expand many thesauruses. You can expand the thesaurus you need. When using the thesaurus, you can call the total thesaurus through recursive call method and input method, and then call each thesaurus. Each thesaurus does not affect each other

For detailed configuration of thesaurus, please visit the article: RIME input method thesaurus expansion (Sogou thesaurus, QQ Pinyin thesaurus, Tsinghua thesaurus, dismantling thesaurus, U mode, etc.)_ Shilo Jankin's blog CSDN blog

  1. Remove a phrase from the user's Dictionary

First move the word selection cursor (with the up and down arrow keys) to the user phrase to be deleted, and then press Shift+Delete or Control+Delete (Shift+Fn+Delete for Apple Keyboard).

  1. custom phrase

① Create a new custom under the user folder_ phrase. txt

② Copy the following code to the txt file. If you are not sure, please be careful not to delete the text after the pound sign.

# Rime table
# coding: utf-8
#@/db_name custom_phrase.txt
#@/db_type tabledb

# It is used for the input scheme of the series of [ZhuYue Pinyin]
# [xiaolanghao] above 0.9.21

# Please save the file in UTF-8 as
# Rime user folder / custom_phrase.txt
# The fields of the code table are separated by tabs
# The order is: text, code and weight (determine the order of heavy codes, optional)
# Although it is convenient to edit the text code table, it is not suitable for importing a large number of entries
# no comment

#Add your favorite phrases below
#Format: output phrase 	 Key letter 	 Phrase frequency
#Note: these characters are separated by the Tab key
#eg
 The strongest University in the universe	xtxn	10   #Shuangpin
 The strongest University in the universe	xuexiao	10   #full pinyin

Then you need to turn on the function. The user-defined phrase has been turned on in double_pinyin_flypy.custom.yaml file configuration.

  1. Install emoji

download rime-emoji , copy the yaml file and opencc folder under this folder to the user folder.

And Emoji_ suggestion. Add the content in yaml to the custom document of the scheme you want to add Emoji (* if you use Xiaohe Shuangpin, add the content in emoji_suggestion.yaml to double_pinyin_fly.custom.yaml. The code above already exists)

#Yan character github
  switches/@next:
    name: emoji_suggestion
    reset: 1
    states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
  'engine/filters/@before 0':
    simplifier@emoji_suggestion
  emoji_suggestion:
    opencc_config: emoji.json
    option_name: emoji_suggestion
    tips: all

Note: remove the patch: from the source file. Only one patch: is allowed in an input scheme custom file;

  1. Word splitting mode

The word splitting mode is also a very practical function. When you encounter a word that is very difficult to write and don't know, you can input it by spelling it.

Download the word splitting thesaurus and add it to the thesaurus. The detailed configuration has been described in the thesaurus configuration article RIME input method thesaurus expansion (Sogou thesaurus, QQ Pinyin thesaurus, Tsinghua thesaurus, dismantling thesaurus, U mode, etc.)_ Shilo Jankin's blog CSDN blog

Enter u and then enter the split word. If Xin is composed of three gold, we can enter u and enter the Pinyin of three gold: spell ujinjinjin completely; Small cranes compete ujbjbjb.

Take the Xiaohe double spelling and word splitting thesaurus as an example:

9. Translator LUA configuration

This configuration file is implemented in lua language. It is usually used to automatically output multi format dates, automatically convert numbers to uppercase, and so on.

Please visit the article for detailed configuration RIME input method lua configuration to obtain the current time (I)_ Shilo Jankin's blog CSDN blog

10. Synchronization

Open the file installation. In the user folder Yaml, add a line of code on the last side as follows:

sync_dir: 'E:\Rime Tongbu'    	Within quotation marks is your synced folder

Then upload the above synchronized folders to nut cloud.

The above is today's content. This article can help you. It is the meaning of my writing. If you have any questions, you can comment or write private letters. Of course, your praise and attention are also my greatest support and affirmation, and also the source of motivation for me to continue writing.

Learn more about the official account of IT.

Topics: Windows lua