Sublime Forum

How to be set a key binding to "%>%" (R pipeline operator)?

#1

New to Sublime Text.

Just want to set “Ctrl + Shift + m” to quick input %>% in R, like RStudio.

Key binging seems only to take command. It is definitely not a sort of snippet.

Any help, Thanks

0 Likes

#2

An example key binding that does that is this:

    { "keys": ["ctrl+shift+m"], "command": "insert",
      "args": { "characters": "%>%" },
      "context": [
          { "key": "selector", "operator": "equal", "operand": "source.r" },
      ],
    },

The characters argument to the insert command indicates what to insert; the context makes the binding only active while the current file is an R file.

1 Like

#3

work perfectly!
playing with more key bindings now.
Thanks! @OdatNurd

0 Likes