Defining scope for custom Sublime Text 2 snippets

前端 未结 5 1283
庸人自扰
庸人自扰 2021-01-29 17:48

While trying to write my own snippets for Sublime Text 2, I ran into the following two problems:

  1. Finding scope keys. I figured out that I can l

5条回答
  •  有刺的猬
    2021-01-29 18:46

    View Current Scope of Cursor Position

    1. Place your cursor in the file where you wish to know the scope.
    2. Use this keyboard-shortcut:

      Windows: ctrl+shift+alt+p
      Mac: ctrl+shift+p

    3. The current scope will be displayed in the left side of the status bar on Windows, or in a popup window on Mac.

    Use these as the key in your foo.sublime-snippet file.

    The returned scopes are listed generic to specific. Choose the scope(s) which best "scoped" the snippet to where it should be available to tab trigger.

提交回复
热议问题