Add textwidth configuration variable.

This commit is contained in:
johnfn 2016-12-03 19:50:03 -05:00
parent 1b2feba428
commit 7f0fbab2f7
4 changed files with 11 additions and 1 deletions

View File

@ -105,6 +105,10 @@ The following is a subset of the supported configurations; the full list is desc
* Copy indent from current line when starting a new line
* Type: Boolean (Default: `true`)
#### textwidth
* Width to word-wrap to when using `gq`.
* Type: number (Default: `80`)
## Configure
Vim options are loaded in the following sequence:

View File

@ -297,6 +297,11 @@
"description": "keywords contain alphanumeric characters and '_'",
"default": "/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-"
},
"vim.textwidth": {
"type": "number",
"description": "Width to word-wrap to when using gq.",
"default": 80
},
"vim.ignorecase": {
"type": "boolean",
"description": "Ignore case in search patterns.",

View File

@ -3979,7 +3979,7 @@ class ActionVisualReflowParagraph extends BaseCommand {
}
public reflowParagraph(s: string, indentLevel: number): string {
let maximumLineLength = 80 - indentLevel - 2;
const maximumLineLength = Configuration.getInstance().textwidth - indentLevel - 2;
const indent = Array(indentLevel + 1).join(" ");
// Chunk the lines by commenting style.

View File

@ -59,6 +59,7 @@ export class Configuration {
useSystemClipboard = false;
useCtrlKeys = false;
scroll = 20;
textwidth = 80;
hlsearch = false;
ignorecase = true;
smartcase = true;