How do I write a custom command in Atom? -
i want write command atom composes 2 or more pre-existing commands, "select line" , "cut". how do that?
you can add following code init.coffee
file:
atom.commands.add 'atom-text-editor', 'custom:cut-line', -> editor = atom.workspace.getactivetexteditor() editor.selectlinescontainingcursors() editor.cutselectedtext()
you can code execute source searching strings in command palette. , once have command created, can map key editing keymap.cson
file:
'atom-text-editor': 'alt-cmd-z': 'custom:cut-line'
Comments
Post a Comment