Copy current file's file path or dir path with Unix file separators

Compatible with: IntelliJ IDEA Android Studio
Oct 19, 2014
1 757

Very simple plugin that copies current file's path or its dir path to the →clipboard with always Unix and never Windows path separators regardless.

If your IDE runs under Windows, then standard Idea "Copy Path" feature will copy you the backslashed Windows path, but if you run a Unix terminal into your Windows paths (like Cygwin or a virt with shared folders), then it is very hard to use the backslashed Windows path with Unix shell scripts, that's when this plugin can help.

And if you have the Windows Services for Unix installed, you'll be able to use the paths provided by this plugin in Windows as well, in Explorer and the CMD.EXE shell and the PowerShell.

This plugin adds 2 menu items to the editor popup menu, but I also remapped the standard Idea's "Edit → Copy Path" action's keyboard shortcuts to my plugin's too.

On top of that:
Starting @version 1.0.4, also adds settings to transform paths by a regex for a project. For example, substituting this: ^[A-Z]:/dir/(.+)$ with this: /mount/wf_dir/$1 will turn this Windows path: C:\dir\meh\blah\file.ext into this on the clipboard: /mount/wf_dir/meh/blah/file.ext

Download plugin

Recent change notes

  • 1.0.5 - Sat 2014-Oct-18; small UX fixes, typos, cosmetics etc. No functional changes.
  • 1.0.4 - Sat 2014-Oct-18; provided optional path substitution
  • 1.0.3 - Sat 2014-Oct-11; Issue #1: Eliminated one class, simplified code.
  • 1.0.2 - recompiled for JDK 7 for folks who are still on 7
  • 1.0.1 - added directory path copy action
  • 1.0.0 - initial release, built for JDK 8