Created
March 20, 2014 20:22
-
-
Save jbenner-radham/9673001 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
from pprint import pprint | |
class ExampleCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
#print(vars(self.view.window())) | |
# This gets all the text on the page, but it seems a bit excessive... | |
reg = sublime.Region(0, self.view.size()) | |
print(self.view.substr(reg)) | |
# Current loaded file. | |
print(self.view.file_name()) | |
# Returns 'Windows' for win style line breaks, etc. | |
print(self.view.line_endings()) | |
# Returns the number of characters in a file. | |
print (self.view.size()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment