diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/Context.sublime-menu b/Context.sublime-menu new file mode 100644 index 0000000..f768b5a --- /dev/null +++ b/Context.sublime-menu @@ -0,0 +1,4 @@ +[ + { "caption": "-", "id": "file" }, + { "command": "copy_relative_path", "caption":"Copy Relative Path"} +] diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..e86ced6 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Benjamin Picolo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/copy_relative_path.py b/copy_relative_path.py new file mode 100644 index 0000000..5efc557 --- /dev/null +++ b/copy_relative_path.py @@ -0,0 +1,10 @@ +import sublime, sublime_plugin + +class CopyRelativePathCommand(sublime_plugin.TextCommand): + def run(self, edit): + if len(self.view.file_name()) > 0: + sublime.set_clipboard( sublime.active_window().active_view().file_name().replace( sublime.active_window().folders()[0] + '/', '' )) + sublime.status_message("Copied relative path") + + def is_enabled(self): + return self.view.file_name() and len(self.view.file_name()) > 0