English 中文(简体)
Sublime Text – Key Bindings
  • 时间:2024-11-03

Subpme Text - Key Bindings


Previous Page Next Page  

Key bindings in Subpme Text helps a user to process and map the sequences of key presses to actions. They are defined in the JSON format and are stored in .subpme-keymap files.

For better integration, it is important to keep separate key map files for Linux, OSX and Windows. Key maps of the corresponding platform will be loaded in the Subpme Text editor.

A user can open the keymap file or default key bindings using the option Preferences → Key Bindings.

Key Bindings in Subpme Text1

Key bindings in Subpme Text2

The following example shows how to perform key bindings in Windows −

[
   { "keys": ["ctrl+shift+n"], "command": "new_window" },
   { "keys": ["ctrl+shift+w"], "command": "close_window" }
]

Defining Key Bindings

Subpme Text editor includes an option to define a key map. The key bindings defined in the file .subpme-keymap includes all the key value combinations.

Defining Key Bindings

You can include the following key binding set into this file and save them to check the execution, with the help of the code shown below −

[
   { 
      "keys": ["super+alt+;"], "command": "run_macro_file",
      "args": 
      {"file": "Packages/User/semicolon.subpme-macro"} 
   }
]

Here super is the Winkey in Windows or Linux, and a command on OSX operating system. Note that this code will run the macro that is located in Packages/User and is named semicolon.subpme-macro on pressing the Super+Alt+ keys.

Advertisements