├── Default.sublime-commands ├── LICENSE ├── Main.sublime-menu ├── README.md ├── SingleTrailingNewLine.py ├── SingleTrailingNewLine.sublime-settings ├── Sublime_Text_2221_Syntax_List ├── Sublime_Text_3114_Syntax_List ├── messages.json └── messages ├── 1.1.5.txt └── install.txt /Default.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { "caption": "Single Trailing NewLine", 3 | "command": "single_trailing_new_line" }, 4 | 5 | { "caption": "Single Trailing NewLine: Add Current Syntax", 6 | "command": "single_trailing_new_line_add_syntax" }, 7 | 8 | { "caption": "Single Trailing NewLine: Remove Current Syntax", 9 | "command": "single_trailing_new_line_remove_syntax" }, 10 | 11 | { "caption": "Single Trailing NewLine: Run For All Syntaxes", 12 | "command": "single_trailing_new_line_enable_for_all_syntaxes_setting", 13 | "args": {"value": true} }, 14 | 15 | { "caption": "Single Trailing NewLine: Do Not Run For All Syntaxes", 16 | "command": "single_trailing_new_line_enable_for_all_syntaxes_setting", 17 | "args": {"value": false} }, 18 | 19 | { "caption": "Single Trailing NewLine: Copy Current Syntax", 20 | "command": "single_trailing_new_line_copy_syntax" } 21 | ] 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | 'Single Trailing Newline - Package for Sublime Text' is licensed under The MIT License. 3 | 4 | Urls: 5 | https://packagecontrol.io/packages/SingleTrailingNewLine 6 | https://github.com/mattst/sublime-single-trailing-new-line 7 | 8 | The MIT License (MIT) 9 | 10 | Copyright (c) 2016 mattst - https://github.com/mattst 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 13 | software and associated documentation files (the "Software"), to deal in the Software 14 | without restriction, including without limitation the rights to use, copy, modify, merge, 15 | publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 16 | to whom the Software is furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all copies or 19 | substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 23 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 24 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 25 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 26 | DEALINGS IN THE SOFTWARE. 27 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences", 4 | "mnemonic": "n", 5 | "id": "preferences", 6 | "children": 7 | [ 8 | { 9 | "caption": "Package Settings", 10 | "mnemonic": "P", 11 | "id": "package-settings", 12 | "children": 13 | [ 14 | { 15 | "caption": "SingleTrailingNewLine", 16 | "children": 17 | [ 18 | { 19 | "command": "open_file", 20 | "args": {"file": "${packages}/SingleTrailingNewLine/SingleTrailingNewLine.sublime-settings"}, 21 | "caption": "Settings – Default" 22 | }, 23 | { 24 | "command": "open_file", 25 | "args": {"file": "${packages}/User/SingleTrailingNewLine.sublime-settings"}, 26 | "caption": "Settings – User" 27 | } 28 | ] 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | ] 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ## Single Trailing Newline - Package for Sublime Text 3 | 4 | This Sublime Text package makes sure that there is exactly one trailing newline at the end of a file. 5 | 6 | All the whitespace and trailing newlines at the end of the file (if any) are removed and then a single newline is inserted. 7 | 8 | Empty files, those with a file size of zero, are deliberately ignored and a newline will not be inserted into them. 9 | 10 | Note: This is different from the `ensure_newline_at_eof_on_save` setting which makes sure that there is *at least one trailing newline* at the end of the file, rather than making sure that there is *exactly one trailing newline* at the end of the file. 11 | 12 | ### Features 13 | 14 | - It can be set to run automatically every time a file is saved. This is disabled by default but by changing the settings it can be enabled either for all files or for only files of specific syntaxes. 15 | 16 | - Command palette entries are provided to change the package's settings; adding/removing the syntaxes that will trigger the plugin, and to allow or prevent the plugin from running with all syntaxes. 17 | 18 | - It can also be run by using its command palette entry or by assigning it to a key binding. In both these cases the settings file is ignored and it will work with all files. 19 | 20 | ### Requirements 21 | 22 | - Sublime Text v2 or v3 23 | - Tested with: v2 build 2221 and v3 builds 3114 and 3083 24 | 25 | ### Installation Instructions 26 | 27 | #### Package Control 28 | 29 | - Open the command palette and select: `Package Control: Install Package` 30 | - Wait for the package list to be updated and then select: `SingleTrailingNewLine` 31 | 32 | #### Manual Installation 33 | 34 | - Download the package's [zip file](https://github.com/mattst/sublime-single-trailing-new-line/archive/master.zip) and extract it, or use `git clone` to get the package from its [GitHub page](https://github.com/mattst/sublime-single-trailing-new-line). 35 | - Move the package's folder to your Sublime Text *config* `Packages` folder. [*Where is that?*](http://docs.sublimetext.info/en/latest/basic_concepts.html#the-data-directory) 36 | - Rename it from `sublime-single-trailing-new-line-master` to `SingleTrailingNewLine`. 37 | - You should end up with this folder: `Packages/SingleTrailingNewLine/` 38 | 39 | ### Setup and Usage 40 | 41 | The plugin was designed to be run automatically when a file is saved, rather than by manually running it from the command palette or with a key binding. However some users may prefer to run it manually on an as-needed basis, or to have that option available for syntaxes they have not added to the syntaxes list setting. 42 | 43 | #### Command Palette 44 | 45 | The package includes several command palette commands: 46 | 47 | - `Single Trailing New Line`: ensure there is exactly one trailing newline at the end of the file. When run from the command palette the plugin will work with all files, the settings file will be ignored. 48 | 49 | - `Single Trailing New Line: Add Current Syntax`: adds the full syntax name of the current file to the syntax list setting. 50 | 51 | - `Single Trailing New Line: Remove Current Syntax`: removes the full syntax name of the current file from the syntax list setting. 52 | 53 | - `Single Trailing NewLine: Run For All Syntaxes`: sets the enable for all syntaxes setting to true. 54 | 55 | - `Single Trailing NewLine: Do Not Run For All Syntaxes`: sets the enable for all syntaxes setting to false. 56 | 57 | - `Single Trailing New Line: Copy Current Syntax`: copies the full syntax name of the current file into the clipboard. [*Legacy: No longer really needed now that syntaxes can be added/removed using the command palette.*] 58 | 59 | #### Key Bindings 60 | 61 | When run from a key binding the plugin will work with all files, the settings file will be ignored. 62 | 63 | Add the key binding of your choice to your user key bindings file (`Menu --> Preferences --> Key Bindings - User`): 64 | 65 | { "keys": ["ctrl+whatever"], "command": "single_trailing_new_line" } 66 | 67 | There are now so many Sublime Text packages available that key conflicts are commonplace, it is therefore best for users to decide their own keys for small packages like this one. 68 | 69 | Not sure? You could try: `"ctrl+k", "ctrl+n"` (which is not in use on my system). 70 | 71 | For users who would like to use keys for all the features here are the available commands: 72 | 73 | - `single_trailing_new_line`: ensures there is exactly one trailing newline at the end of the file. 74 | - `single_trailing_new_line_add_syntax`: adds the current syntax to the syntaxes list setting. 75 | - `single_trailing_new_line_remove_syntax`: removes the current syntax from the syntaxes list setting. 76 | - `single_trailing_new_line_copy_syntax`: copies the current syntax into the clipboard. 77 | - `single_trailing_new_line_enable_for_all_syntaxes_setting`: sets the enable for all syntaxes setting to true or false. 78 | - Requires an arg called `"value"` to be set to true or false, e.g. `"args": {"value": true}`. 79 | 80 | #### Settings / Running Automatically 81 | 82 | The plugin can be run automatically every time a file is saved to ensure that the file is saved with exactly one trailing newline but this is disabled by default. It can be enabled for either all files or for only files of specific syntaxes by changing the default settings in the package's user settings file. 83 | 84 | The path of the package's user settings file, in your Sublime Text config folders ([*where is that?*](http://docs.sublimetext.info/en/latest/basic_concepts.html#the-data-directory)), must be: 85 | 86 | Packages/User/SingleTrailingNewLine.sublime-settings 87 | 88 | The default and user settings files can be accessed from the Sublime Text menu: 89 | 90 | Menu --> Preferences --> Package Settings --> SingleTrailingNewLine --> Settings - Default 91 | Menu --> Preferences --> Package Settings --> SingleTrailingNewLine --> Settings - User 92 | 93 | When changing the settings make sure you use the user settings file. 94 | 95 | There are 2 settings: 96 | 97 | - `enable_for_all_syntaxes`: *true* / *false*. If this is set to *true* the plugin will be active for all files, regardless of their syntax, every time any file is saved the plugin will be run. Default: *false*. It is important to note that setting this to *false* does not disable the plugin completely, it just prevents it from running for all syntaxes. When it is set to *false* the plugin will still run for the syntaxes listed in the `enable_for_syntaxes_list` setting. 98 | 99 | - `enable_for_syntaxes_list`: *a list of strings*. If one or more syntax names are added to this list, the plugin will be run every time a file, whose syntax matches one of the syntax names, is saved. Default: `[]` - *an empty list*. This setting will be ignored if the `enable_for_all_syntaxes` setting is set to *true*. There is further information about this setting below the example settings file. 100 | 101 | The `.sublime-syntax` syntax file format was introduced by Sublime Text v3 build 3084, from that version onwards all built-in syntax files use that format, with the exception of `Packages/Text/Plain text.tmLanguage`. Other `.tmLanguage` syntax files may be on your system if a syntax package that includes them has been installed, e.g. `PythonImproved`. Sublime Text v2 and v3 builds earlier than 3084 use only `.tmLanguage` syntax files. 102 | 103 | Here is an example `Packages/User/SingleTrailingNewLine.sublime-settings` file: 104 | 105 | { 106 | "enable_for_all_syntaxes": false, 107 | "enable_for_syntaxes_list": 108 | [ 109 | "Packages/C++/C.sublime-syntax", 110 | "Packages/C++/C++.sublime-syntax", 111 | "Packages/Java/Java.sublime-syntax", 112 | "Packages/JavaScript/JSON.sublime-syntax", 113 | "Packages/Python/Python.sublime-syntax", 114 | "Packages/Python Improved/PythonImproved.tmLanguage", 115 | "Packages/Rails/", 116 | "Packages/XML/XML.sublime-syntax" 117 | ] 118 | } 119 | 120 | The following information about the `enable_for_syntaxes_list` entries should be noted: 121 | 122 | - They are case sensitive and neither regular expressions nor wildcards are accepted. 123 | 124 | - It is generally advisable to use full syntax names, as shown in the example file above. Partial syntax names will work, e.g. `"XML.sublime-syntax"`, but only full syntax names will be added and removed when using the palette commands. 125 | 126 | - In fact any case sensitive substring match will work; e.g. the list `["C++", "Java", "Python", "Rails", "XML"]` would match all of the syntaxes shown in the example file above, but it would also match a whole lot more (17 of the ST v3 default syntaxes). 127 | 128 | - `"C.sublime-syntax"` would match both `"Packages/C++/C.sublime-syntax"` and `"Packages/Objective-C/Objective-C.sublime-syntax"`. Using just `"C"` on its own would be inadvisable because it would match any syntax containing an upper-case letter C (16 of the ST v3 default syntaxes). 129 | 130 | - All of the syntaxes in a (multi-syntax) package can be matched by using the syntax's path component on its own. e.g. `"Packages/Rails/"` would match all 5 syntaxes from the `Rails` package, i.e. `"Packages/Rails/Ruby on Rails.sublime-syntax"` as well as the other 4. 131 | 132 | - Using just `"Java"` would match all 7 syntaxes from the `Java` and `JavaScript` packages, as would `"Packages/Java"` but not `"Packages/Java/"` because the trailing slash would not match `"Packages/JavaScript/"`. 133 | 134 | For reference use only, 2 lists of Sublime Text built-in syntaxes are provided: 135 | 136 | - [Sublime Text v2 build 2221 syntax list](https://github.com/mattst/sublime-single-trailing-new-line/blob/master/Sublime_Text_2221_Syntax_List) 137 | - [Sublime Text v3 build 3114 syntax list](https://github.com/mattst/sublime-single-trailing-new-line/blob/master/Sublime_Text_3114_Syntax_List) 138 | 139 | Those using Sublime Text v3 builds earlier than 3084 should refer to the v2 list. 140 | 141 | ### License 142 | 143 | This package is licensed under The MIT License (MIT). See the [LICENSE file](https://github.com/mattst/sublime-single-trailing-new-line/blob/master/LICENSE). 144 | -------------------------------------------------------------------------------- /SingleTrailingNewLine.py: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Name: Single Trailing Newline 4 | # 5 | # Requirements: Sublime Text v2 and v3 6 | # 7 | # Written by: mattst - https://github.com/mattst 8 | # 9 | # Homepage: https://github.com/mattst/sublime-single-trailing-new-line 10 | # 11 | # License: MIT License 12 | # 13 | 14 | 15 | import sublime, sublime_plugin 16 | 17 | 18 | SETTINGS_FILE = "SingleTrailingNewLine.sublime-settings" 19 | ENABLE_FOR_ALL_SYNTAXES_SETTING = "enable_for_all_syntaxes" 20 | ENABLE_FOR_SYNTAXES_LIST_SETTING = "enable_for_syntaxes_list" 21 | 22 | 23 | class SingleTrailingNewLineListener(sublime_plugin.EventListener): 24 | """ 25 | Calls the "single_trailing_new_line" command when a pre-save event occurs but only if the plugin 26 | has been enabled in the settings file for all files or for the syntax of the current file. 27 | 28 | Note: The EventListener class does not implement the is_enabled() method, unlike all the rest of 29 | the sublime_plugin classes, so the is_plugin_enabled() method serves as a replacement. 30 | """ 31 | 32 | def on_pre_save(self, view): 33 | """ Called immediately before the file in the view is saved. """ 34 | 35 | if self.is_plugin_enabled(view): 36 | # A TextCommand derived class is needed to get an edit object. 37 | view.run_command("single_trailing_new_line") 38 | 39 | 40 | def is_plugin_enabled(self, view): 41 | """ Determines whether the plugin should be run automatically for the file in the view. """ 42 | 43 | # This method does not result in a disk file read every time a file is 44 | # saved; the settings are loaded into memory at start-up and whenever 45 | # the settings file is modified, so this method is not time expensive. 46 | 47 | try: 48 | settings = sublime.load_settings(SETTINGS_FILE) 49 | 50 | if settings.get(ENABLE_FOR_ALL_SYNTAXES_SETTING, False): 51 | return True 52 | 53 | syntax_current_file = view.settings().get("syntax") 54 | 55 | for syntax in settings.get(ENABLE_FOR_SYNTAXES_LIST_SETTING, []): 56 | if len(syntax) > 0 and syntax in syntax_current_file: 57 | return True 58 | 59 | return False 60 | 61 | except Exception: 62 | return False 63 | 64 | 65 | class SingleTrailingNewLineCommand(sublime_plugin.TextCommand): 66 | """ Deletes all trailing whitespace at the end of the file and inserts a single newline. """ 67 | 68 | def run(self, edit): 69 | 70 | # Ignore empty files. 71 | if self.view.size() < 1: 72 | return 73 | 74 | # Work backwards from the end of the file to find 75 | # the last significant (non-whitespace) character. 76 | 77 | last_sig_char = self.view.size() - 1 78 | 79 | while last_sig_char >= 0 and self.view.substr(last_sig_char).isspace(): 80 | last_sig_char -= 1 81 | 82 | erase_region = sublime.Region(last_sig_char + 1, self.view.size()) 83 | self.view.erase(edit, erase_region) 84 | self.view.insert(edit, self.view.size(), "\n") 85 | 86 | 87 | class SingleTrailingNewLineAddSyntaxCommand(sublime_plugin.TextCommand): 88 | """ Adds the current file's syntax to the syntaxes list setting. """ 89 | 90 | def run(self, edit): 91 | 92 | try: 93 | settings = sublime.load_settings(SETTINGS_FILE) 94 | 95 | syntax_current_file = self.view.settings().get("syntax") 96 | enable_for_syntaxes = settings.get(ENABLE_FOR_SYNTAXES_LIST_SETTING, []) 97 | 98 | if syntax_current_file not in enable_for_syntaxes: 99 | enable_for_syntaxes.append(syntax_current_file) 100 | enable_for_syntaxes.sort() 101 | settings.set(ENABLE_FOR_SYNTAXES_LIST_SETTING, enable_for_syntaxes) 102 | sublime.save_settings(SETTINGS_FILE) 103 | msg = "Syntax added to the syntax list" 104 | sublime.status_message(msg) 105 | else: 106 | msg = "Syntax already in the syntax list" 107 | sublime.status_message(msg) 108 | 109 | except Exception: 110 | msg = "The SingleTrailingNewLine.sublime-settings file is invalid" 111 | sublime.status_message(msg) 112 | 113 | 114 | class SingleTrailingNewLineRemoveSyntaxCommand(sublime_plugin.TextCommand): 115 | """ Removes the current file's syntax from the syntaxes list setting. """ 116 | 117 | def run(self, edit): 118 | 119 | try: 120 | settings = sublime.load_settings(SETTINGS_FILE) 121 | 122 | syntax_current_file = self.view.settings().get("syntax") 123 | enable_for_syntaxes = settings.get(ENABLE_FOR_SYNTAXES_LIST_SETTING, []) 124 | 125 | if syntax_current_file in enable_for_syntaxes: 126 | enable_for_syntaxes.remove(syntax_current_file) 127 | enable_for_syntaxes.sort() 128 | settings.set(ENABLE_FOR_SYNTAXES_LIST_SETTING, enable_for_syntaxes) 129 | sublime.save_settings(SETTINGS_FILE) 130 | msg = "Syntax removed from the syntax list" 131 | sublime.status_message(msg) 132 | else: 133 | msg = "Syntax was not in the syntax list" 134 | sublime.status_message(msg) 135 | 136 | except Exception: 137 | msg = "The SingleTrailingNewLine.sublime-settings file is invalid" 138 | sublime.status_message(msg) 139 | 140 | 141 | class SingleTrailingNewLineEnableForAllSyntaxesSettingCommand(sublime_plugin.TextCommand): 142 | """ Sets the enable for all syntaxes setting to a boolean value. """ 143 | 144 | def run(self, edit, **kwargs): 145 | 146 | try: 147 | arg_value = kwargs.get("value", None) 148 | 149 | if not isinstance(arg_value, bool): 150 | msg = "Invalid args" 151 | sublime.status_message(msg) 152 | return 153 | 154 | settings = sublime.load_settings(SETTINGS_FILE) 155 | 156 | if arg_value: 157 | settings.set(ENABLE_FOR_ALL_SYNTAXES_SETTING, True) 158 | msg = "Enable For All Syntaxes - True" 159 | 160 | else: 161 | settings.set(ENABLE_FOR_ALL_SYNTAXES_SETTING, False) 162 | msg = "Enable For All Syntaxes - False" 163 | 164 | sublime.save_settings(SETTINGS_FILE) 165 | sublime.status_message(msg) 166 | 167 | except Exception: 168 | msg = "The SingleTrailingNewLine.sublime-settings file is invalid" 169 | sublime.status_message(msg) 170 | 171 | 172 | class SingleTrailingNewLineCopySyntaxCommand(sublime_plugin.TextCommand): 173 | """ Copies the current file's syntax into the clipboard. """ 174 | 175 | def run(self, edit): 176 | 177 | syntax_current_file = self.view.settings().get("syntax") 178 | sublime.set_clipboard(syntax_current_file) 179 | 180 | msg = "Syntax copied to the clipboard" 181 | sublime.status_message(msg) 182 | -------------------------------------------------------------------------------- /SingleTrailingNewLine.sublime-settings: -------------------------------------------------------------------------------- 1 | 2 | // Put your settings in this package's user settings file, path below, which 3 | // will override the default settings in this file which prevent the single 4 | // trailing newline plugin from running automatically when files are saved. 5 | // 6 | // Path in config folder: User/SingleTrailingNewLine.sublime-settings 7 | // Prefs -> Package Settings -> SingleTrailingNewLine -> Settings - User 8 | // 9 | // Docs: https://github.com/mattst/sublime-single-trailing-new-line 10 | 11 | { 12 | "enable_for_all_syntaxes": false, 13 | "enable_for_syntaxes_list": [] 14 | } 15 | -------------------------------------------------------------------------------- /Sublime_Text_2221_Syntax_List: -------------------------------------------------------------------------------- 1 | 2 | A list of all the built-in syntaxes from Sublime Text version 2221: 3 | 4 | Packages/ActionScript/ActionScript.tmLanguage 5 | Packages/AppleScript/AppleScript.tmLanguage 6 | Packages/ASP/ASP.tmLanguage 7 | Packages/ASP/HTML-ASP.tmLanguage 8 | Packages/Batch File/Batch File.tmLanguage 9 | Packages/C#/Build.tmLanguage 10 | Packages/C#/C#.tmLanguage 11 | Packages/C++/C++.tmLanguage 12 | Packages/C++/C.tmLanguage 13 | Packages/Clojure/Clojure.tmLanguage 14 | Packages/CSS/CSS.tmLanguage 15 | Packages/D/D.tmLanguage 16 | Packages/Diff/Diff.tmLanguage 17 | Packages/Erlang/Erlang.tmLanguage 18 | Packages/Erlang/HTML (Erlang).tmLanguage 19 | Packages/Go/Go.tmLanguage 20 | Packages/Graphviz/DOT.tmLanguage 21 | Packages/Groovy/Groovy.tmLanguage 22 | Packages/Haskell/Haskell.tmLanguage 23 | Packages/Haskell/Literate Haskell.tmLanguage 24 | Packages/HTML/HTML.tmLanguage 25 | Packages/Java/Java Server Pages (JSP).tmLanguage 26 | Packages/Java/Java.tmLanguage 27 | Packages/Java/JavaDoc.tmLanguage 28 | Packages/Java/JavaProperties.tmLanguage 29 | Packages/JavaScript/JavaScript.tmLanguage 30 | Packages/JavaScript/JSON.tmLanguage 31 | Packages/LaTeX/Bibtex.tmLanguage 32 | Packages/LaTeX/LaTeX Beamer.tmLanguage 33 | Packages/LaTeX/LaTeX Log.tmLanguage 34 | Packages/LaTeX/LaTeX Memoir.tmLanguage 35 | Packages/LaTeX/LaTeX.tmLanguage 36 | Packages/LaTeX/TeX Math.tmLanguage 37 | Packages/LaTeX/TeX.tmLanguage 38 | Packages/Lisp/Lisp.tmLanguage 39 | Packages/Lua/Lua.tmLanguage 40 | Packages/Makefile/Makefile.tmLanguage 41 | Packages/Markdown/Markdown.tmLanguage 42 | Packages/Markdown/MultiMarkdown.tmLanguage 43 | Packages/Matlab/Matlab.tmLanguage 44 | Packages/Objective-C/Objective-C++.tmLanguage 45 | Packages/Objective-C/Objective-C.tmLanguage 46 | Packages/OCaml/camlp4.tmLanguage 47 | Packages/OCaml/OCaml.tmLanguage 48 | Packages/OCaml/OCamllex.tmLanguage 49 | Packages/OCaml/OCamlyacc.tmLanguage 50 | Packages/Perl/Perl.tmLanguage 51 | Packages/PHP/PHP.tmLanguage 52 | Packages/Python/Python.tmLanguage 53 | Packages/Python/Regular Expressions (Python).tmLanguage 54 | Packages/R/R Console.tmLanguage 55 | Packages/R/R.tmLanguage 56 | Packages/R/Rd (R Documentation).tmLanguage 57 | Packages/Rails/HTML (Rails).tmLanguage 58 | Packages/Rails/JavaScript (Rails).tmLanguage 59 | Packages/Rails/Ruby Haml.tmLanguage 60 | Packages/Rails/Ruby on Rails.tmLanguage 61 | Packages/Rails/SQL (Rails).tmLanguage 62 | Packages/Regular Expressions/RegExp.tmLanguage 63 | Packages/RestructuredText/reStructuredText.tmLanguage 64 | Packages/Ruby/Ruby.tmLanguage 65 | Packages/Scala/Scala.tmLanguage 66 | Packages/ShellScript/Shell-Unix-Generic.tmLanguage 67 | Packages/SQL/SQL.tmLanguage 68 | Packages/TCL/HTML (Tcl).tmLanguage 69 | Packages/TCL/Tcl.tmLanguage 70 | Packages/Text/Plain text.tmLanguage 71 | Packages/Textile/Textile.tmLanguage 72 | Packages/XML/XML.tmLanguage 73 | Packages/XML/XSL.tmLanguage 74 | Packages/YAML/YAML.tmLanguage 75 | -------------------------------------------------------------------------------- /Sublime_Text_3114_Syntax_List: -------------------------------------------------------------------------------- 1 | 2 | A list of all the built-in syntaxes from Sublime Text version 3114: 3 | 4 | Packages/ActionScript/ActionScript.sublime-syntax 5 | Packages/AppleScript/AppleScript.sublime-syntax 6 | Packages/ASP/ASP.sublime-syntax 7 | Packages/ASP/HTML-ASP.sublime-syntax 8 | Packages/Batch File/Batch File.sublime-syntax 9 | Packages/C#/Build.sublime-syntax 10 | Packages/C#/C#.sublime-syntax 11 | Packages/C++/C++.sublime-syntax 12 | Packages/C++/C.sublime-syntax 13 | Packages/Clojure/Clojure.sublime-syntax 14 | Packages/CSS/CSS.sublime-syntax 15 | Packages/D/D.sublime-syntax 16 | Packages/Diff/Diff.sublime-syntax 17 | Packages/Erlang/Erlang.sublime-syntax 18 | Packages/Erlang/HTML (Erlang).sublime-syntax 19 | Packages/Go/Go.sublime-syntax 20 | Packages/Graphviz/DOT.sublime-syntax 21 | Packages/Groovy/Groovy.sublime-syntax 22 | Packages/Haskell/Haskell.sublime-syntax 23 | Packages/Haskell/Literate Haskell.sublime-syntax 24 | Packages/HTML/HTML.sublime-syntax 25 | Packages/Java/Java Server Pages (JSP).sublime-syntax 26 | Packages/Java/Java.sublime-syntax 27 | Packages/Java/JavaDoc.sublime-syntax 28 | Packages/Java/JavaProperties.sublime-syntax 29 | Packages/JavaScript/JavaScript.sublime-syntax 30 | Packages/JavaScript/JSON.sublime-syntax 31 | Packages/JavaScript/Regular Expressions (JavaScript).sublime-syntax 32 | Packages/LaTeX/Bibtex.sublime-syntax 33 | Packages/LaTeX/LaTeX Beamer.sublime-syntax 34 | Packages/LaTeX/LaTeX Log.sublime-syntax 35 | Packages/LaTeX/LaTeX Memoir.sublime-syntax 36 | Packages/LaTeX/LaTeX.sublime-syntax 37 | Packages/LaTeX/TeX Math.sublime-syntax 38 | Packages/LaTeX/TeX.sublime-syntax 39 | Packages/Lisp/Lisp.sublime-syntax 40 | Packages/Lua/Lua.sublime-syntax 41 | Packages/Makefile/Make Output.sublime-syntax 42 | Packages/Makefile/Makefile.sublime-syntax 43 | Packages/Markdown/Markdown.sublime-syntax 44 | Packages/Markdown/MultiMarkdown.sublime-syntax 45 | Packages/Matlab/Matlab.sublime-syntax 46 | Packages/Objective-C/Objective-C++.sublime-syntax 47 | Packages/Objective-C/Objective-C.sublime-syntax 48 | Packages/OCaml/camlp4.sublime-syntax 49 | Packages/OCaml/OCaml.sublime-syntax 50 | Packages/OCaml/OCamllex.sublime-syntax 51 | Packages/OCaml/OCamlyacc.sublime-syntax 52 | Packages/Pascal/Pascal.sublime-syntax 53 | Packages/Perl/Perl.sublime-syntax 54 | Packages/PHP/PHP Source.sublime-syntax 55 | Packages/PHP/PHP.sublime-syntax 56 | Packages/Python/Python.sublime-syntax 57 | Packages/Python/Regular Expressions (Python).sublime-syntax 58 | Packages/R/R Console.sublime-syntax 59 | Packages/R/R.sublime-syntax 60 | Packages/R/Rd (R Documentation).sublime-syntax 61 | Packages/Rails/HTML (Rails).sublime-syntax 62 | Packages/Rails/JavaScript (Rails).sublime-syntax 63 | Packages/Rails/Ruby Haml.sublime-syntax 64 | Packages/Rails/Ruby on Rails.sublime-syntax 65 | Packages/Rails/SQL (Rails).sublime-syntax 66 | Packages/Regular Expressions/RegExp.sublime-syntax 67 | Packages/RestructuredText/reStructuredText.sublime-syntax 68 | Packages/Ruby/Ruby.sublime-syntax 69 | Packages/Rust/Cargo.sublime-syntax 70 | Packages/Rust/Rust.sublime-syntax 71 | Packages/Scala/Scala.sublime-syntax 72 | Packages/ShellScript/Shell-Unix-Generic.sublime-syntax 73 | Packages/SQL/SQL.sublime-syntax 74 | Packages/TCL/HTML (Tcl).sublime-syntax 75 | Packages/TCL/Tcl.sublime-syntax 76 | Packages/Text/Plain text.tmLanguage 77 | Packages/Textile/Textile.sublime-syntax 78 | Packages/XML/XML.sublime-syntax 79 | Packages/YAML/YAML.sublime-syntax 80 | -------------------------------------------------------------------------------- /messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "install": "messages/install.txt", 3 | "1.1.5": "messages/1.1.5.txt" 4 | } 5 | -------------------------------------------------------------------------------- /messages/1.1.5.txt: -------------------------------------------------------------------------------- 1 | 2 | Single Trailing Newline - Package for Sublime Text 3 | -------------------------------------------------- 4 | 5 | Changes to version 1.1.5. 6 | 7 | Two new palette commands have been added: 8 | 9 | "Single Trailing NewLine: Run For All Syntaxes" 10 | "Single Trailing NewLine: Do Not Run For All Syntaxes" 11 | 12 | These allow the user to change the "enable_for_all_syntaxes" setting to true 13 | and false respectively. 14 | 15 | Please note that setting "enable_for_all_syntaxes" to false does not disable 16 | the plugin completely, it just prevents it from running for all syntaxes. 17 | 18 | When it is set to false the plugin will still run for the syntaxes listed in 19 | the "enable_for_syntaxes_list" setting (if there are any). 20 | 21 | Links to the package's documentation: 22 | https://packagecontrol.io/packages/SingleTrailingNewLine 23 | https://github.com/mattst/sublime-single-trailing-new-line 24 | -------------------------------------------------------------------------------- /messages/install.txt: -------------------------------------------------------------------------------- 1 | 2 | Single Trailing Newline - Package for Sublime Text 3 | -------------------------------------------------- 4 | 5 | Thank you for installing the Single Trailing Newline package. 6 | 7 | This Sublime Text package makes sure that there is exactly one trailing newline 8 | at the end of a file. 9 | 10 | All the whitespace and trailing newlines at the end of the file, if there are 11 | any, are removed and a single newline is inserted. 12 | 13 | Empty files (a file size of zero) are deliberately ignored and will not have a 14 | newline inserted into them. 15 | 16 | The plugin has been designed to run automatically every time a file is saved, 17 | either for all files or for only files with the syntaxes that you specify. This 18 | will only start happening if you enable the plugin for all syntaxes or add one 19 | or more syntaxes that you want to trigger the plugin (see the documentation). 20 | 21 | Palette commands are provided to run the plugin and to change its settings; 22 | adding/removing syntaxes that will trigger the plugin, and to allow or prevent 23 | the plugin from working with all syntaxes. 24 | 25 | No keymap file is provided but any users who would prefer to run the plugin 26 | manually, on an as-needed basis, can setup a key binding to do so easily (see 27 | the documentation). 28 | 29 | ***************************************************************************** 30 | New users should read the documentation which you can find at the urls below: 31 | ***************************************************************************** 32 | 33 | https://packagecontrol.io/packages/SingleTrailingNewLine 34 | https://github.com/mattst/sublime-single-trailing-new-line 35 | --------------------------------------------------------------------------------