Skip to content

Commit

Permalink
Added package
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Picolo committed May 22, 2014
0 parents commit 48c7c76
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
4 changes: 4 additions & 0 deletions Context.sublime-menu
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
{ "caption": "-", "id": "file" },
{ "command": "copy_relative_path", "caption":"Copy Relative Path"}
]
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -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.
Empty file added README.md
Empty file.
10 changes: 10 additions & 0 deletions copy_relative_path.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 48c7c76

Please sign in to comment.