Sublime Text: how to make shortcut for inserting text?

后端 未结 4 1716
灰色年华
灰色年华 2020-12-13 13:50

I need make a shortcut that will be adding certain text at the cursor, eg {sometext}, how can this be done?

4条回答
  •  佛祖请我去吃肉
    2020-12-13 14:48

    If you already have a snippet file written, say at Packages/User/myFunction.sublime-snippet, you can use

    Add this to Preferences > Key Bindings - User

    { "keys": ["ctrl+1"], "command": "insert_snippet", "args": {"name": "Packages/User/myFunction.sublime-snippet"} }
    

    This example binds the snippet to CTRL + 1.

    I found the info on Christopher Millward's blog.

提交回复
热议问题