Importing default sublime text commands into a custom command
<p>I'm writing a command that needs to copy the current file's path. Sublime Text already has a <a href="https://github.com/cj/sublime/blob/master/Default/copy_path.py" rel="nofollow">copy_path command</a> that achieves this. Is it possible to import that command into my command's file? I have tried <code>import copy_path</code> and <code>import CopyPathCommand</code>. I have also tried calling the command as if it were a method on the <code>sublime</code> module, i.e. <code>sublime.copy_path()</code> but all of these attempts have resulted in errors.</p>

<p>To import the command you can write <code>from Default.copy_path import CopyPathCommand</code>.
<em>However</em> it sounds as if you run the command for which you don't need to import it. Just write <code>self.view.run_command("copy_path")</code> inside your <code>TextCommand</code> and it will be executed.</p>

python sublimetext3 sublimetext sublime-text-plugin