Sublimetext3 如何在Sublime Text 3代码段中自动拥有多个光标?

Sublimetext3 如何在Sublime Text 3代码段中自动拥有多个光标?,sublimetext3,code-snippets,cursors,Sublimetext3,Code Snippets,Cursors,我有一个Sublime Text 3的控制台日志片段 { "keys": ["alt+super+l"], "command": "insert_snippet", "args": { "contents": "console.log('$1', $2)" }, "context": [ { "key": "selection_empty", "operator": "equal", "operand": true, "m

我有一个Sublime Text 3的控制台日志片段

{
    "keys": ["alt+super+l"],
    "command": "insert_snippet", 
    "args": {
        "contents": "console.log('$1', $2)"
    },
    "context": [
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
    ]
}
我希望有多个游标,因此,当我调用此代码段的键时,游标同时位于$1和$2位置,因为我通常只想在控制台中记录变量名和变量值。我如何管理这个

在两个地方都使用(或仅使用)。对于您的特定代码段,它将类似于:

{ ...
        "contents": "console.log('${1:variable}', ${1:variable})"
    ...
}
如果您不需要占位符,只需要将光标放在两个位置,它将如下所示:

{ ...
        "contents": "console.log('$1', $1)"
    ...
}
让我知道这是否适合您。

在这两个地方都使用(或仅使用)。对于您的特定代码段,它将类似于:

{ ...
        "contents": "console.log('${1:variable}', ${1:variable})"
    ...
}
如果您不需要占位符,只需要将光标放在两个位置,它将如下所示:

{ ...
        "contents": "console.log('$1', $1)"
    ...
}

让我知道这是否适用于您。

例如,使用相同的变量
$1
。例如,使用相同的变量
$1