Quickly wrap text in any text editor.
- Download wrap.py.
pip install keyboard pyperclip
.- Run the code with
py wrap.py
orpython3 wrap.py
. This will not wrap text yet; it just adds a temporary keyboard shortcut. - Select text and press ctrl+' or cmd+' to wrap it!
- Press ctrl+c or cmd+c on the script when you're done wrapping.
If you will use this often, you might want to create a custom terminal command.
The default wrap width is 88 characters. You can change the wrap width by changing the WRAP_WIDTH
variable near the top of wrap.py.
You can also change the keyboard shortcut for wrapping by changing the WRAP_SHORTCUT
variable near the top of wrap.py.