Open DavidSnider opened 8 years ago
I'm just toggling it twice at the moment, but I'd love a command that opens/focuses the terminal if it's not focused, and closes it if it is focused. terminal-plus:dwim-toggle? :-)
It would be pretty useful.
Hacky way to toggle between active editor pane and an open terminal-plus view
in init.coffee
atom.commands.add 'atom-workspace',
'editor:focus-main', ->
p = atom.workspace.getActivePane()
term = null
#p.activate()
panels = atom.workspace.getBottomPanels()
for pan in panels
if pan.item.constructor.name == 'TerminalPlusView'
term = pan.item
break
if term and p.focused isnt false
term.focus()
else if term and p.focused is false
p.activate()
then assign to a key in keymap.cson
Thanks for the tip, @jlerche. To follow up, here's how to assign to a key in keymap.cson
:
'atom-workspace':
'ctrl-1': 'editor:focus-main'
I assigned ctrl-1
because it's right beside the default toggle window mapping ctrl-`
.
Is it possible to switch between the active terminal window and the regular text editing window with a keybinding? Also the other direction?