After typing the bracket and enter, the next line will has 8 spaces indentation:
print conn.generate_url(
seconds,
'GET',
instead of 4:
print conn.generate_url(
seconds,
'GET',
My ~/.vimrc
: https://github.com/quantonganh/salt-states/blob/master/vim/vimrc.jinja2
Did I miss something?
Here's the list of my plugins:
├── ctrlp.vim
├── gundo.vim
├── jedi-vim
├── nerdtree
├── powerline
├── salt-vim
├── supertab
├── syntastic
├── ultisnips
├── vim-fugitive
├── vim-indent-guides
├── vim-surround
├── vim-yankstack
└── vundle
UPDATE Sat Apr 12 10:00:55 ICT 2014
I'm wondering that: is it follow PEP8 or not?
print conn.generate_url(
seconds,
'GET',
bucket,
key,
response_headers={
'response-content-type': 'application/octet-stream'
})
Continuation lines should align wrapped elements either vertically using Python's implicit line joining inside parentheses, brackets and braces, or using a hanging indent. When using a hanging indent the following considerations should be applied; there should be no arguments on the first line and further indentation should be used to clearly distinguish itself as a continuation line.
In a function, we will have something to distinguish with continuous lines, but here's just a print
, should it be 4 or 8 spaces?
What is PEP8's E128: continuation line under-indented for visual indent?
UPDATE Sat Apr 12 23:09:27 ICT 2014
Looks like jedi-vim
doesn't do anything with Python's indentation. So my question should be change to something like:
It's OK to add 8 spaces (2 indent levels) for the next line after bracket when defining a function:
# More indentation included to distinguish this from the rest.
def long_function_name(
var_one, var_two, var_three,
var_four):
print(var_one)
but I only want to add 4 spaces (one indent level) when calling it:
# Extra indentation is not necessary.
foo = long_function_name(
var_one, var_two,
var_three, var_four)
How can I do it?
~/.vimrc
. – romainl~/.vimrc
. – quanta