From 860a67d0f3b9f9abf5d6acdcb85888f3d4394737 Mon Sep 17 00:00:00 2001 From: Aleks Kamko Date: Thu, 27 Jul 2017 10:31:35 -0700 Subject: [PATCH] add flag to disable startup setlocal indent --- README.rst | 9 +++++++-- indent/python.vim | 8 +++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 3a8bf3c..279ca60 100644 --- a/README.rst +++ b/README.rst @@ -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. @@ -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. + Notes ----- diff --git a/indent/python.vim b/indent/python.vim index 8a479f4..6180bef 100644 --- a/indent/python.vim +++ b/indent/python.vim @@ -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