Skip to content

msansoni/atom-path-copy

Repository files navigation

Build Status

Add context menu options to the tab context menu to copy the open editor file path.

Atom Package: https://atom.io/packages/path-copy

apm install path-copy

Or Settings/Preferences ➔ Packages ➔ Search for path-copy

Available Commands

  • Full Path
  • Full Name
  • Short Name
  • Extension
  • Folder Path
  • Project Path
  • Relative Path

Usage

Open the Tab Context Menu, and select which file path you would like to copy from the Path Copy sub-menu.

The benefit of path-copy is that the package uses the path of the tab where the context menu was called, rather than only being able to retrieve the path of the active tab.

Preview

Path Copy in Action

Configuration

Context menu items can easily be set to visible/hidden by clicking the checkboxes in the package settings. To add functionality/de-clutter the path-copy sub-menu.

  • Atom Package Settings
    AtomPreferences ➔ Search for path-copy

The configuration page also allows users to set quotation characters such as "" or '' to enclose path strings.

Notifications can also be toggled on/off to show successful path-copy commands and the paths that have been added to the clipboard.

Keyboard Shortcut

All path-copy functions are available directly via keyboard shortcuts, for example: Cmd-Alt-W as a shortcut to copy the current editor's full file path.

Custom Keyboard Shortcuts

The default key-bindings can be modified in your keymap.cson file. See Keymaps In-Depth for more details.

For example:

'atom-text-editor':
  'alt-cmd-w': 'path-copy:current-fullpath'

License

MIT © Michael Sansoni