SublimeText3 程式碼片段中的雙反斜杠

SublimeText3 程式碼片段中的雙反斜杠

我在 LaTeX 工作中使用 SublimeText3 和 LaTeXTools,並希望它在我按 ctrl+enter 時插入雙反斜線+換行符。像這樣:

asdf\\
foobar

我嘗試將以下內容插入“Default (Linux).sublime-keymap”:

{
    "keys": ["ctrl+enter"],
    "command": "insert_snippet",
    "args": {"contents": "\\\\\n"},
    "context":
        [
            {"key": "selector", "operator": "equal", "operand": "text.tex.latex"}
        ]
}

但它在 ctrl+enter 上創建的是:

asdf\
foobar

這是為什麼?

答案1

解決方案(感謝卡蘭):

插入“預設(Linux).sublime-keymap”:

{
    "keys": ["ctrl+enter"],
    "command": "insert_snippet",
    "args": {"contents": "\\\\\\\\\n"},
    "context":
        [
            {"key": "selector", "operator": "equal", "operand": "text.tex.latex"}
        ]
}

相關內容