jeremyramin / terminal-plus

A terminal package for Atom, complete with themes and more.
https://atom.io/packages/terminal-plus
MIT License
481 stars 254 forks source link

switching between terminal window and regular text editing window with a keybinding #325

Open DavidSnider opened 8 years ago

DavidSnider commented 8 years ago

Is it possible to switch between the active terminal window and the regular text editing window with a keybinding? Also the other direction?

ktosiek commented 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? :-)

sadhu89 commented 8 years ago

It would be pretty useful.

jlerche commented 7 years ago

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

johnbailon commented 7 years ago

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-`.