Skip to content

Instantly share code, notes, and snippets.

@piascikj
Last active August 15, 2022 07:30
Show Gist options
  • Save piascikj/a6bd286512653a49073e to your computer and use it in GitHub Desktop.
Save piascikj/a6bd286512653a49073e to your computer and use it in GitHub Desktop.
Atom copy filename

In ~/.atom/keymap.cson

'atom-text-editor':
  'ctrl-shift-a': 'jaceklaskowski:copy-file-name'

In ~/.atom/init.coffee

path = require 'path'
atom.commands.add 'atom-text-editor', 'jaceklaskowski:copy-file-name', ->
  return unless editor = atom.workspace.getActiveTextEditor()

  selection = editor.getLastSelection()
  atom.clipboard.write(atom.workspace.getActivePaneItem().getPath().split(path.sep).pop())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment