Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/math2001/textwidth
My Sublime Text adaptation of VIM's textwidth option.
https://github.com/math2001/textwidth
python sublime-text vim
Last synced: 21 days ago
JSON representation
My Sublime Text adaptation of VIM's textwidth option.
- Host: GitHub
- URL: https://github.com/math2001/textwidth
- Owner: math2001
- License: mit
- Created: 2017-10-09T06:58:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-11T07:21:01.000Z (over 7 years ago)
- Last Synced: 2024-11-10T07:41:24.282Z (3 months ago)
- Topics: python, sublime-text, vim
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `textwidth`
A little Sublime Text 3 plugin to automatically insert line breaks at a
specific column. It just splits *before* the word. It's my adaptation of vim's
`textwidth` setting (which is the reason for this package name).## Usage
This plugin is useful for writing text (markdown, plain text, etc), as it
automatically insert a line break at x characters or less (it wouldn't split a
word).### Enabling automatic wrapping
If you want to enable this behaviour everywhere, just add this to your global
settings:```json
"textwidth": 80
```I wouldn't recommend doing that though, it might be annoying when you're
programming. If you just want this to work in Markdown for example:1. open a markdown file
2. open the command palette (ctrl+shift+p)
3. type `settings syntax specific` and hit enter
4. add the same code as above (`"textwidth": 80`) in thereDone!
### Manual reorganizing
Sometimes, you write a paragraph, but then you change some words, and the
wrapping is just wrong.Well, you don't have to re do everything manually: you just need to run
`textwidth` command. It'll reorganize the selection if there is some, or the
paragraph you have a cursor in.#### Add it to the command palette
Create a file called `Default.sublime-commands` in your `User` directory, and
write this:```json
[
{ "caption": "Text Width: Wrap", "command": "textwidth" }
]
```#### Bind a shortcut to it
In your keybinding file
```json
{
"keys": ["alt+w"],
"command": "textwidth"
}
```### For VIM users
If you use a vim emulating package, `gq` will re-wrap the selection. You can use
`gqap` to wrap the current paragraph you're in (`gq` a paragraph).---
Hope you like it :heart: