https://github.com/gjjvdburg/stringwrap.vim
Simple vim plugin to nicely wrap long strings
https://github.com/gjjvdburg/stringwrap.vim
string-formatter vim vim-plugin
Last synced: about 1 year ago
JSON representation
Simple vim plugin to nicely wrap long strings
- Host: GitHub
- URL: https://github.com/gjjvdburg/stringwrap.vim
- Owner: GjjvdBurg
- License: gpl-3.0
- Created: 2022-06-12T14:51:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-09T15:34:47.000Z (almost 2 years ago)
- Last Synced: 2025-01-03T17:45:41.115Z (about 1 year ago)
- Topics: string-formatter, vim, vim-plugin
- Language: Python
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StringWrap.vim
This is a *very* simple Vim plugin to wrap or unwrap long strings (mainly
intended for Python). It will help you turn this:
```python
a = (
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
)
```
into this (visually select the string or stand on the line and run
`:StringWrap`):
```python
a = (
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
"veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea "
"commodo consequat. Duis aute irure dolor in reprehenderit in voluptate "
"velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
"occaecat cupidatat non proident, sunt in culpa qui officia deserunt "
"mollit anim id est laborum."
)
```
and back again (using visual selection and `:StringUnwrap`). The maximum width
is equal to your Vim `textwidth` setting. It will not work if the string is
not on its own line.
## Installation
Using Vundle:
```vim
Plugin 'gjjvdburg/StringWrap.vim'
```
## Notes
For licensing information, see the LICENSE file.
To run the tests, use:
```
PYTHONPATH=./python/ python -m unittest test/test_string_wrap.py
```
Written by [Gertjan van den Burg](https://gertjan.dev)