How to set shortcut for `Copy file path` in sublime text 3

How to set shortcut for Copy file path in sublime text 3? I tried:

[
    { "keys": ["super+i"], "command": "copy_file_path" }
]   

But seemingly command copy_file_path not valid.

shortcut for "Copy file path" in sublime text 3


All you need to do is change "copy_file_path" to "copy_path".


To discover this, I hit Ctrl` to open the console, then ran

sublime.log_commands(True) 

to have all actions logged to the console. I then right-clicked and selected Copy File Path, and

command: copy_path 

showed up. I assigned the key combination, ran it, and it worked. To finish up, I run

sublime.log_commands(False) 

so the console doesn't get clogged with unnecessary info, then hit Ctrl` again to close the console.


For those like me that need a shortcut to copy the relative path,

  • I installed the Copy Relative Path package,
  • and added this keybinding:

{ "keys": ["alt+p"], "command": "copy_relative_path" }