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
- Full Path
- Full Name
- Short Name
- Extension
- Folder Path
- Project Path
- Relative Path
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.
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
Atom
➔Preferences
➔ Search forpath-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.
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.
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'