Home Download Buy Blog Forum Support

[solved] mode / scope specific key binding?

[solved] mode / scope specific key binding?

Postby anhil on Thu Apr 05, 2012 10:25 am

Hello (lot's of questions today),

I would like to insert my own keybindings for a specific scope (text.tex.latex). My binding looks like this:

Code: Select all
[
   { "keys": ["ctrl+x", "ctrl+i"], "command": "insert_snippet", "args": {"name": "Packages/User/mysnippet.sublime-snippet"} }
]


Now where should I put this information? How do I select the scope?

Thanks

anhil
Last edited by anhil on Thu Apr 05, 2012 10:40 am, edited 1 time in total.
anhil
 
Posts: 13
Joined: Sun Apr 01, 2012 8:07 pm

Re: mode / scope specific key binding?

Postby anhil on Thu Apr 05, 2012 10:40 am

anhil wrote:Hello (lot's of questions today),

I would like to insert my own keybindings for a specific scope (text.tex.latex). My binding looks like this:

Code: Select all
[
   { "keys": ["ctrl+x", "ctrl+i"], "command": "insert_snippet", "args": {"name": "Packages/User/mysnippet.sublime-snippet"} }
]


Now where should I put this information? How do I select the scope?

Thanks

anhil


I've got it to work:

Code: Select all
[
   { "keys": ["ctrl+x", "ctrl+i"],
     "command": "insert_snippet",
     "args": {"name": "Packages/User/mysnippet.sublime-snippet"},
     "context": [ {"key": "selector", "operator": "equal", "operand": "text.tex.latex"} ]
   }
]
anhil
 
Posts: 13
Joined: Sun Apr 01, 2012 8:07 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 26 guests