I am trying to bind ctrl+| to Show Console in Sublime Text 2 on a Norwegian keyboard using the following line in the (json?) configuration file:

{ "keys": ["ctrl+|"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },

This doesn't work, and the pipe symbol also has a slightly darker tint than the rest of the configuration text, as if it is special.

I tried to escape it using "ctrl+\|" and "ctrl+\\|" none of which work. Binding it to something else like "ctrl+p" works fine.

Any idea of how to bind functionality with the pipe-key? It's the top left key on the keyboard, left to the 1 key.


I asked the question over at the sublime text forum. The user mlf gave me the answer which lead me to the solution:

Manually open the console: View -> Show Console

Enter sublime.log_input(True) then hit the key combination ctrl+|.

This produces the output chr evt: FS (0x1c). Here FS stands in for the File Separator character. You can produce it using alt+028 on the numpad in Windows.

Enter/past it into key bindings config file. It should look like the following:

{ "keys": ["FS"], "command": "show_panel", "args": {"panel": "console", "toggle": true} },

Note that you cannot simply copy-paste the above line, you have to actually paste/produce the FS character yourself.

When done you can turn logging of with the command sublime.log_input(False) in the console.

  • To add more clarity for people with Nordic keyboards, the File Separator character is protected in Sublime Text, which means you need to escape it with another File Separator. So to use ctrl + "Key next to 1" on your Nordic keyboard you use: { "keys": ["ctrl+\\"], "command": "show_panel", "args": {"panel": "console", "toggle": true} } – kristang May 16 '17 at 11:28

Unfortunately, the pipe symbol | is not one of Sublime's bindable keys, even on a US keyboard.

  • If this is the case, and there are no workarounds, then this is a bug. Because letting me bind the so called "tilde" key to functionality is expected functionality from a $70 software. – André Christoffer Andersen Jul 14 '14 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.