Skip to content

Instantly share code, notes, and snippets.

@stewhouston
Created May 17, 2016 17:16
Show Gist options
  • Save stewhouston/77d0fbd0e42486bc71363b969295f7d1 to your computer and use it in GitHub Desktop.
Save stewhouston/77d0fbd0e42486bc71363b969295f7d1 to your computer and use it in GitHub Desktop.
Custom atom command to toggle the atom-typescript (TypeStrong) panel
# Atom Init Script (atom/init.coffee)
atom.commands.add 'atom-text-editor', 'custom:toggle-typescript-pane', ->
editor = atom.workspace.getActiveTextEditor()
tsPane = document.querySelector('.atomts')
if (!tsPane)
return
isHidden = tsPane.classList.contains('atomts-hidden')
if (!isHidden)
tsPane.classList.add('atomts-hidden')
else
tsPane.classList.remove('atomts-hidden')
# Atom Keymap (atom/keymap.cson)
'atom-text-editor':
'f1': 'custom:toggle-typescript-pane'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment