Emacs - Python Indent in parenthesis -


my default python mode in emacs indents following multiline code way:

mydict = {         "a": 1,         "b": 2, } 

which okay of pep8

i' d rather use following style:

mydict = {     "a": 1,     "b": 2,     } 

which ok pep8.

how tell emacs indent last parenthesis accordingly beginning of previous line?

just install latest python-mode.el (from https://launchpad.net/python-mode).

in latest version 6.1.4, pep8 "indent-alternatives when closing list" implemented (see release notes.)

in case, don't have customize it, , accept default.

by default, py-close-at-start-column-p nil, looks like:

my_list = [      1, 2, 3,      4, 5, 6,      ] result = some_function_that_takes_arguments(      'a', 'b', 'c',      'd', 'e', 'f',      ) 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -