Skip to content

Commit 8e816d7

Browse files
committed
add g:python_pep8_indent_continuation_indent_width
1 parent 8b215aa commit 8e816d7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.rst

+9
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ With content already, it will be aligned to the opening parenthesis::
7474

7575
Existing indentation (including ``0``) in multiline strings will be kept, so this setting only applies to the indentation of new/empty lines.
7676

77+
python_pep8_indent_continuation_indent_width
78+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79+
80+
This option specifies the indent width used for line continuations from a parenthesis/bracket/brace.
81+
82+
.. code-block:: vim
83+
let g:python_pep8_indent_continuation_indent_width = 4 " default
84+
let g:python_pep8_indent_continuation_indent_width = "&sw * 2"
85+
let g:python_pep8_indent_continuation_indent_width = 8
7786
7887
Notes
7988
-----

indent/python.vim

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ if !exists('g:python_pep8_indent_multiline_string')
3838
let g:python_pep8_indent_multiline_string = 0
3939
endif
4040

41+
if !exists('g:python_pep8_indent_continuation_indent_width')
42+
let g:python_pep8_indent_continuation_indent_width = 4
43+
endif
44+
4145
let s:maxoff = 50
4246
let s:block_rules = {
4347
\ '^\s*elif\>': ['if', 'elif'],
@@ -212,7 +216,7 @@ function! s:indent_like_opening_paren(lnum)
212216
if starts_with_closing_paren
213217
let res = base
214218
else
215-
let res = base + s:sw()
219+
let res = base + eval(g:python_pep8_indent_continuation_indent_width)
216220
endif
217221
else
218222
" Indent to match position of opening paren.

0 commit comments

Comments
 (0)