Created
August 17, 2017 13:36
-
-
Save davlgd/82436e431935a7d83dff00ccd38ff217 to your computer and use it in GitHub Desktop.
atom-gpg tuning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.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