Shortcut to type |>?

The piping operator |> is very useful, especially when working in the REPL. However I do not find it convenient to type, it requires some finger gymnastic and it’s not very fast. Maybe it is the case because I have a french keyboard.

Does anyone knows a VSCode plugin that creates a shortcut to insert it ?

Thanks <3

1 Like

I map it to ctrl-shift-m which is how RStudio maps %>%

Ha sweet, how do you do that ?

Hard to describe but google how to map keyboard shortcuts vscode

For future reference:

Adding the following in the keybindings.json file works in editor but does not in the REPL.
Tutorial:

[{
    "key": "ctrl+shift+m",
    "command": "type",  
    "args": { "text": "|>" },
    "when": "editorTextFocus && editorLangId == 'julia'"
},{
    "key": "ctrl+shift+m",
    "command": "type",
    "args": { "text": "|>" },
    "when": "terminalFocus && terminalProcessSupported"
}
]
4 Likes