更新时间:2022-12-11 17:21:58
您可以将以下代码添加到您的 init.coffee
文件中:
You can add the following code to your init.coffee
file:
atom.commands.add 'atom-text-editor', 'custom:cut-line', ->
editor = atom.workspace.getActiveTextEditor()
editor.selectLinesContainingCursors()
editor.cutSelectedText()
您可以通过在命令面板中搜索字符串来从源代码中获取要执行的代码.一旦你创建了一个命令,你可以通过编辑你的 keymap.cson
文件来将一个键映射到它:
You can get the code to execute from the source by searching for strings in the command palette. And once you have a command created, you can map a key to it by editing your keymap.cson
file:
'atom-text-editor':
'alt-cmd-z': 'custom:cut-line'