Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag to disable startup setlocal indent #80

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Follow the instructions on installing NeoBundle_ and add the appropriate NeoBund
Configuration
-------------

python_pep8_indent_multiline_string
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
g:python_pep8_indent_multiline_string
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

You can configure the initial indentation of multiline strings using ``g:python_pep8_indent_multiline_string`` (which can also be set per buffer).
This defaults to ``0``, which means that multiline strings are not indented.
Expand All @@ -74,6 +74,11 @@ With content already, it will be aligned to the opening parenthesis::

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

g:python_pep8_setlocal_indent
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

By default, this plugin sets ``shiftwidth``, ``tabstop``, and ``softtabstop`` to 4 on startup. This behavior can be disabled adding ``let g:python_pep8_setlocal_indent = 0`` to your vimrc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using the value from there?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(4 being the default then)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the point is for working with multiple repos, e.g. TensorFlow uses sw=2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. 0 would still disable it (in case you want to set it yourself), but you could specify 2 here then for example.


Notes
-----
Expand Down
8 changes: 5 additions & 3 deletions indent/python.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ setlocal nolisp
setlocal autoindent
setlocal indentexpr=GetPythonPEPIndent(v:lnum)
setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
if get(g:, 'python_pep8_setlocal_indent', 1)
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
endif

if !exists('g:python_pep8_indent_multiline_string')
let g:python_pep8_indent_multiline_string = 0
Expand Down