diff --git a/Default.sublime-commands b/Default.sublime-commands index eb2046c..95e7e51 100644 --- a/Default.sublime-commands +++ b/Default.sublime-commands @@ -1,6 +1,11 @@ [ { - "caption": "Clear Text", + "caption": "TextCleaner: Clean Text", "command": "text_cleaner" + }, + { + "caption": "TextCleaner: Settings", + "command": "open_file", + "args": {"file": "${packages}/TextCleaner/TextCleaner.sublime-settings"} } -] \ No newline at end of file +] diff --git a/LICENSE.txt b/LICENSE.txt index f14b40e..9c7bc4a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -4,4 +4,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of 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. \ No newline at end of file +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/Main.sublime-menu b/Main.sublime-menu new file mode 100644 index 0000000..caec12d --- /dev/null +++ b/Main.sublime-menu @@ -0,0 +1,18 @@ +[ + { + "id": "preferences", + "children": [ + { + "id": "package-settings", + "children": [ + { + "caption": "TextCleaner: Settings", + "command": "open_file", + "args": {"file": "${packages}/TextCleaner/TextCleaner.sublime-settings"} + } + ] + } + ] + } +] + diff --git a/README.md b/README.md index 42e67c5..e844359 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ TextCleaner is a Sublime Text 4 plugin that cleans up your document by performing several text transformations. It converts tabs to spaces, replaces invisible characters, standardizes quotes, trims extra whitespace, collapses multiple spaces, removes duplicate empty lines, and cleans up empty lines around brackets. +## Usage + +Run the **TextCleaner: Clean Text** command from the Command Palette to tidy up the current file. You can open the plugin settings via the same palette or through the **Preferences → Package Settings → TextCleaner** menu. + ## Settings You can customize which transformations are applied through the configuration file ([TextCleaner.sublime-settings](/TextCleaner.sublime-settings)). Below is a description of each setting: @@ -22,4 +26,4 @@ This project is licensed under the [MIT License](/LICENSE.txt). ## Credits -Developed by **Valentin Popov** ([valentin@popov.link](mailto:valentin@popov.link)). \ No newline at end of file +Developed by **Valentin Popov** ([valentin@popov.link](mailto:valentin@popov.link)). diff --git a/TextCleaner.py b/TextCleaner.py index fd92f80..95d6e6b 100644 --- a/TextCleaner.py +++ b/TextCleaner.py @@ -48,4 +48,4 @@ class TextCleanerCommand(sublime_plugin.TextCommand): content = re.sub(r'\n\s*\n+([)\]}])', r'\n\1', content) # Replace the document text with the cleaned content. - self.view.replace(edit, entire_region, content) \ No newline at end of file + self.view.replace(edit, entire_region, content) diff --git a/TextCleaner.sublime-settings b/TextCleaner.sublime-settings index 9a16e38..ee140d4 100644 --- a/TextCleaner.sublime-settings +++ b/TextCleaner.sublime-settings @@ -19,4 +19,4 @@ // Remove empty lines after opening brackets and before closing brackets. "remove_empty_lines_around_brackets": true -} \ No newline at end of file +}