Sublime Text 2 Comment/Doc Block

后端 未结 2 1414
南笙
南笙 2021-01-31 16:25

Recently, I decided to try out Sublime Text 2 as a TextMate alternative (which it is). I\'m absolutely loving it but the only issue that bugs me is that it doesn\'t continue the

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 16:45

    Just had the same problem and wrote a little snippet. Since it is a keybinding it has to be stored in a .sublime-keymap File. If you're on a Mac just goto Sublime Text 2 > Preferences > Key Bindings - User or similar on some other OS.

    Here is my Code:

    [
    {"keys": ["enter"], "command": "insert", "args" : {"characters": "\n * "}, "context": [
        {"key": "selection_empty", "operator": "equal", "operand": true},
        {"key": "preceding_text", "operator": "regex_contains", "operand": "\\/\\*\\*$", "match_all": true}
    ]},
    {"keys": ["enter"], "command": "insert", "args" : {"characters": "\n* "}, "context": [
        //{"key": "selection_empty", "operator": "equal", "operand": true},
        {"key": "preceding_text", "operator": "regex_contains", "operand": "^[\t ]*\\*[^\\/]", "match_all": true}
    ]}
    ]
    

提交回复
热议问题