File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ function! pymode#indent#get_indent(lnum)
2424 if closing_paren
2525 return indent (parlnum)
2626 else
27- return indent (parlnum) + &shiftwidth
27+ let l: indent_width = (g: pymode_indent_hanging_width > 0 ?
28+ \ g: pymode_indent_hanging_width : &shiftwidth )
29+ return indent (parlnum) + l: indent_width
2830 endif
2931 else
3032 return parcol
Original file line number Diff line number Diff line change @@ -170,6 +170,16 @@ Enable pymode indentation *'g:pymode_indent'
170170>
171171 let g:pymode_indent = 1
172172
173+
174+ Customization:
175+
176+ Hanging indent size after an open parenthesis or bracket (but nothing after the
177+ parenthesis), when vertical alignment is not used. Defaults to `&shiftwidth ` .
178+ *'g:pymode_indent_hanging_width'*
179+ >
180+ let g:pymode_indent_hanging_width = &shiftwidth
181+ let g:pymode_indent_hanging_width = 4
182+
173183-------------------------------------------------------------------------------
1741842.3 Python folding ~
175185 *pymode-folding*
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ call pymode#default('g:pymode_doc_bind', 'K')
3838" Enable/Disable pymode PEP8 indentation
3939call pymode#default (" g:pymode_indent" , 1 )
4040
41+ " Customize hanging indent size different than &shiftwidth
42+ call pymode#default (" g:pymode_indent_hanging_width" , -1 )
43+
4144" TODO: currently folding suffers from a bad performance and incorrect
4245" implementation. This feature should be considered experimental.
4346" Enable/disable pymode folding for pyfiles.
You can’t perform that action at this time.
0 commit comments