From 5c957257e01a24fbc8ca1fe7742415dab4d98b0a Mon Sep 17 00:00:00 2001 From: Casey McGinty Date: Sat, 3 Dec 2016 18:53:48 -0800 Subject: [PATCH] Support custom line lengths with yapf Python formatter. The 'column-width' option was added to the default yapf command. The value is set to match the 'textwidth' value of the current buffer. --- plugin/defaults.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/defaults.vim b/plugin/defaults.vim index 47d024e..3e37473 100644 --- a/plugin/defaults.vim +++ b/plugin/defaults.vim @@ -42,7 +42,7 @@ if !exists('g:formatter_yapf_style') let g:formatter_yapf_style = 'pep8' endif if !exists('g:formatdef_yapf') - let g:formatdef_yapf = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.'}\" -l '.a:firstline.'-'.a:lastline" + let g:formatdef_yapf = "'yapf --style=\"{based_on_style:'.g:formatter_yapf_style.',indent_width:'.&shiftwidth.',column_limit:'.&textwidth.'}\" -l '.a:firstline.'-'.a:lastline" endif if !exists('g:formatters_python')