AutoWrapStrings
A sublime text package to split long string on save on python
Details
Installs
- Total 33
 - Win 23
 - Mac 6
 - Linux 4
 
| Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | Oct 20 | Oct 19 | Oct 18 | Oct 17 | Oct 16 | Oct 15 | Oct 14 | Oct 13 | Oct 12 | Oct 11 | Oct 10 | Oct 9 | Oct 8 | Oct 7 | Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 
| Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 
| Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 
Readme
- Source
 - raw.githubusercontent.com
 
AutoWrapStrings
AutoWrapStrings is a Sublime Text package that automatically wraps long Python string literals to fit within a specified maximum line length. The plugin processes both single/double-quoted strings and triple‑quoted strings, adjusting the content to avoid exceeding the defined column width.

[!WARNING]
While AutoWrapStrings aims to reformat Python string literals accurately, it may contain edge cases where the wrapping does not behave as expected. Use with caution and consider reviewing changes after applying auto wrap.
Installation
You only need to place the packages files in a folder named AutoWrapStrings in your Sublime Text Packages directory.
Usage
Manual Wrapping:
Open the Command Palette (viaCtrl+Shift+PorCmd+Shift+Pon macOS) and run the command AutoWrap: Apply Auto Wrap to File to manually trigger auto wrapping.Auto-Wrap on Save:
When you save a Python file, if the settingapply_on_saveis enabled (default is disabled), the plugin will automatically reformat string literals to ensure no line exceeds themax-line-length(default is 79).Configurable Settings:
Customize the maximum line length and enable or disable auto-wrapping on save through the settings available inPreferences/Package Settings\AutoWrapStrings\Settings.
Note
AutoWrapStrings has been made completely for Python script.
For a more general plugin that wrapped lines you can use Wrap Plus. It might works better for general purposes, but in a python context AutoWrapStrings might be more appropriate, for example:
long_f_string = f" mollis. Suscipit nisl suspendisse senectus at laoreet efficitur per consectetur. Posuere potenti sollicitudin metus dictum dictum neque magnis. Accumsan, {long_string}! "
is wrapped like this with WrapPlus:
long_f_string = f" mollis. Suscipit nisl suspendisse senectus at laoreet
    efficitur per consectetur. Posuere potenti sollicitudin metus dictum
    dictum neque magnis. Accumsan, {long_string}! "
Which break the python code. While AutoWrapStrings does it like that:
long_f_string = f" mollis. Suscipit nisl suspendisse senectus at laoreet"
    f"efficitur per consectetur. Posuere potenti sollicitudin metus dictum"
    f"dictum neque magnis. Accumsan, {long_string}!"
Trying to not break the code.