Skip to content

Instantly share code, notes, and snippets.

@davlgd
Created August 17, 2017 13:36
Show Gist options
  • Save davlgd/82436e431935a7d83dff00ccd38ff217 to your computer and use it in GitHub Desktop.
Save davlgd/82436e431935a7d83dff00ccd38ff217 to your computer and use it in GitHub Desktop.
atom-gpg tuning
getGnuPGed = (event) ->
if event.type is ('custom:gpg-full-encrypt' or 'custom:gpg-full-decrypt' or 'custom:gpg-full-sign')
encEditor = atom.workspace.getActiveTextEditor()
encEditor.moveToTop()
encEditor.selectAll()
setTimeout ( -> encEditor.copySelectedText())
, 100
atom.commands.add 'atom-text-editor', 'custom:gpg-full-encrypt', ->
editor = atom.workspace.getActiveTextEditor()
editor.selectAll()
editorElement = atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(editorElement, 'atom-gpg:encrypt-selections')
atom.commands.onDidDispatch(getGnuPGed)
atom.commands.add 'atom-text-editor', 'custom:gpg-full-decrypt', ->
editor = atom.workspace.getActiveTextEditor()
editor.selectAll()
editorElement = atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(editorElement, 'atom-gpg:decrypt-selections')
atom.commands.onDidDispatch(getGnuPGed)
atom.commands.add 'atom-text-editor', 'custom:gpg-full-sign', ->
editor = atom.workspace.getActiveTextEditor()
editor.selectAll()
editorElement = atom.views.getView(atom.workspace.getActiveTextEditor())
atom.commands.dispatch(editorElement, 'atom-gpg:sign-selections')
atom.commands.onDidDispatch(getGnuPGed)
'.editor':
'ctrl-shift-e':'custom:gpg-full-encrypt'
'ctrl-shift-d':'custom:gpg-full-decrypt'
'ctrl-shift-s':'custom:gpg-full-sign'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment