{"id":13593547,"url":"https://github.com/Vimjas/vim-python-pep8-indent","last_synced_at":"2025-04-09T05:31:36.867Z","repository":{"id":3721729,"uuid":"4794570","full_name":"Vimjas/vim-python-pep8-indent","owner":"Vimjas","description":"A nicer Python indentation style for vim.","archived":false,"fork":false,"pushed_at":"2023-01-31T03:26:26.000Z","size":161,"stargazers_count":783,"open_issues_count":19,"forks_count":69,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-08-02T16:47:47.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"chafey/dicomParser","license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vimjas.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-26T12:08:13.000Z","updated_at":"2024-08-01T04:59:48.000Z","dependencies_parsed_at":"2023-02-16T15:15:55.729Z","dependency_job_id":null,"html_url":"https://github.com/Vimjas/vim-python-pep8-indent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fvim-python-pep8-indent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fvim-python-pep8-indent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fvim-python-pep8-indent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vimjas%2Fvim-python-pep8-indent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vimjas","download_url":"https://codeload.github.com/Vimjas/vim-python-pep8-indent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223365318,"owners_count":17133696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:01:21.448Z","updated_at":"2024-11-06T15:30:41.468Z","avatar_url":"https://github.com/Vimjas.png","language":"Ruby","readme":"vim-python-pep8-indent\n======================\n\n.. image:: https://circleci.com/gh/Vimjas/vim-python-pep8-indent.svg?style=svg\n  :target: https://circleci.com/gh/Vimjas/vim-python-pep8-indent\n.. image:: https://codecov.io/gh/Vimjas/vim-python-pep8-indent/branch/master/graph/badge.svg\n  :target: https://codecov.io/gh/Vimjas/vim-python-pep8-indent\n\nThis small script modifies Vim_’s indentation behavior to comply with PEP8_ and my aesthetic preferences.\nMost importantly::\n\n   foobar(foo,\n          bar)\n\nand::\n\n   foobar(\n      foo,\n      bar\n   )\n\n\nInstallation\n------------\n\nInstall the plugin using your favorite plugin manager / method, a few examples\nfollow:\n\nPathogen\n^^^^^^^^\n\nFollow the instructions on installing Pathogen_ and then:\n\n.. code-block:: shell-session\n\n   $ cd ~/.vim/bundle\n   $ git clone https://github.com/Vimjas/vim-python-pep8-indent.git\n\n\nVundle\n^^^^^^\n\nFollow the instructions on installing Vundle_ and add the appropriate plugin line into your ``.vimrc``:\n\n.. code-block:: vim\n\n   Plugin 'Vimjas/vim-python-pep8-indent'\n\n\nNeoBundle\n^^^^^^^^^\n\nFollow the instructions on installing NeoBundle_ and add the appropriate NeoBundle line into your ``.vimrc``:\n\n.. code-block:: vim\n\n   NeoBundle 'Vimjas/vim-python-pep8-indent'\n\n\nConfiguration\n-------------\n\ng:python_pep8_indent_multiline_string\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nYou can configure the initial indentation of multiline strings using ``g:python_pep8_indent_multiline_string`` (which can also be set per buffer).\nThis defaults to ``0``, which means that multiline strings are not indented.\n``-1`` and positive values will be used as-is, where ``-1`` is a special value for Vim's ``indentexpr``, and will keep the existing indent (using Vim's ``autoindent`` setting).\n``-2`` is meant to be used for strings that are wrapped with ``textwrap.dedent`` etc.  It will add a level of indentation if the multiline string started in the previous line, without any content in it already::\n\n   testdir.makeconftest(\"\"\"\n       _\n\nWith content already, it will be aligned to the opening parenthesis::\n\n   testdir.makeconftest(\"\"\"def pytest_addoption(parser):\n                        _\n\nExisting indentation (including ``0``) in multiline strings will be kept, so this setting only applies to the indentation of new/empty lines.\n\ng:python_pep8_indent_hang_closing\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nControl closing bracket indentation with ``python_pep8_indent_hang_closing``, set globally or per buffer.\n\nBy default (set to ``0``), closing brackets line up with the opening line::\n\n   my_list = [\n       1, 2, 3,\n       4, 5, 6,\n   ]\n   result = some_function_that_takes_arguments(\n       'a', 'b', 'c',\n       'd', 'e', 'f',\n   )\n\nWith ``python_pep8_indent_hang_closing = 1``, closing brackets line up with the items::\n\n   my_list = [\n       1, 2, 3,\n       4, 5, 6,\n       ]\n   result = some_function_that_takes_arguments(\n       'a', 'b', 'c',\n       'd', 'e', 'f',\n       )\n\n\nTroubleshooting\n---------------\n\nIn case it is not working, please make sure your Vim is configured to load\nindent files (``filetype indent on``).\nThis is typically the case when using a plugin manager, but check its docs.\n\nCheck ``:verbose set indentexpr?`` in a Python file, which should show\nsomething like the following:\n\n  indentexpr=GetPythonPEPIndent(v:lnum)\n        Last set from ~/…/plugged/vim-python-pep8-indent/indent/python.vim\n\n\nNotes\n-----\n\nPlease note that Kirill Klenov’s python-mode_ ships its own version of this bundle.\nTherefore, if you want to use this version specifically, you’ll have to disable python-mode’s using:\n\n.. code-block:: vim\n\n   let g:pymode_indent = 0\n\n\nLicense and Authorship\n----------------------\n\nThis script is based on one from Vim’s official `script repo`_  that was *not* originally written by me.\nUnfortunately the indentation was off by one character in one case and the script hasn’t been updated since 2005.\n\nEven more unfortunately, I wasn’t able to reach any of the original authors/maintainers:\n**David Bustos** and **Eric Mc Sween**.\n\nSo I fixed the annoyance with the help of `Steve Losh`_ and am putting it out here so you don’t have to patch the original yourself.\nThe original patch is still available here_.\n\nOver the time a lot more improvements have been contributed_ by `generous people`_.\n\nI’d like to thank the original authors here for their work and release it hereby to the *Public Domain* (using the CC0_ licence) since I hope that would be in their spirit.\nIf anyone with a say in this objects, please let me_ know immediately.\nAlso, if someone is in contact with one of them, I would appreciate being introduced.\n\nWhile my Vimscript_ skills are still feeble, I intend to maintain it for now.\nThis mainly means that I’ll triage through bugs and pull requests but won’t be fixing much myself.\n\n\n.. _Vim: http://www.vim.org/\n.. _PEP8: http://www.python.org/dev/peps/pep-0008/\n.. _`script repo`: http://www.vim.org/scripts/script.php?script_id=974\n.. _`Steve Losh`: http://stevelosh.com/\n.. _here: https://gist.github.com/2965846\n.. _Neobundle: https://github.com/Shougo/neobundle.vim\n.. _Pathogen: https://github.com/tpope/vim-pathogen\n.. _python-mode: https://github.com/klen/python-mode\n.. _`Vimscript`: http://learnvimscriptthehardway.stevelosh.com/\n.. _vundle: https://github.com/gmarik/Vundle.vim\n.. _me: https://hynek.me/\n.. _CC0: http://creativecommons.org/publicdomain/zero/1.0/\n.. _contributed: https://github.com/hynek/vim-python-pep8-indent/blob/master/CONTRIBUTING.rst\n.. _`generous people`: https://github.com/hynek/vim-python-pep8-indent/graphs/contributors\n","funding_links":[],"categories":["Ruby","Plugins / Themes / Dependencies"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVimjas%2Fvim-python-pep8-indent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FVimjas%2Fvim-python-pep8-indent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FVimjas%2Fvim-python-pep8-indent/lists"}