{"id":13419946,"url":"https://github.com/heavenshell/vim-pydocstring","last_synced_at":"2025-04-05T18:09:52.724Z","repository":{"id":2253268,"uuid":"3208424","full_name":"heavenshell/vim-pydocstring","owner":"heavenshell","description":"Generate Python docstring to your Python source code.","archived":false,"fork":false,"pushed_at":"2023-07-15T10:11:43.000Z","size":9690,"stargazers_count":337,"open_issues_count":1,"forks_count":52,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-01T22:50:11.752Z","etag":null,"topics":["docstring","python","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heavenshell.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-01-18T12:30:37.000Z","updated_at":"2024-12-07T16:40:14.000Z","dependencies_parsed_at":"2024-10-26T16:53:39.152Z","dependency_job_id":"c48471c6-5739-4264-bc44-0f5aa4192467","html_url":"https://github.com/heavenshell/vim-pydocstring","commit_stats":{"total_commits":138,"total_committers":18,"mean_commits":7.666666666666667,"dds":0.2536231884057971,"last_synced_commit":"bc710d75262dfbaa820e5564391bf62f6c9b25fd"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fvim-pydocstring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fvim-pydocstring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fvim-pydocstring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heavenshell%2Fvim-pydocstring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heavenshell","download_url":"https://codeload.github.com/heavenshell/vim-pydocstring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378149,"owners_count":20929297,"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":["docstring","python","vim"],"created_at":"2024-07-30T22:01:23.286Z","updated_at":"2025-04-05T18:09:52.697Z","avatar_url":"https://github.com/heavenshell.png","language":"Vim Script","readme":"vim-pydocstring\n===============\n\n.. image:: https://github.com/heavenshell/vim-pydocstring/workflows/build/badge.svg?branch=master\n  :target: https://github.com/heavenshell/vim-pydocstring\n\n.. image:: ./assets/vim-pydocstring.gif\n\nvim-pydocstring is a generator for Python docstrings and is capable of automatically\n\n* inserting one-line docstrings\n* inserting multi-line docstrings\n\nThis plugin is heavily inspired by `phpdoc.vim \u003chttp://www.vim.org/scripts/script.php?script_id=1355\u003e`_ and `sonictemplate.vim \u003chttps://github.com/mattn/sonictemplate-vim\u003e`_.\n\nInstall\n-------\n\nSince version 2, vim-pydocstring requires `doq \u003chttps://pypi.org/project/doq/\u003e`_.\n\nYou can install following command.\n\n.. code::\n\n  $ make install\n\nNote\n~~~~\n\nActivated venv needs to be deactivated before install doq.\n\nThis can be automated with vim-plug.\n\n.. code::\n\n  Plug 'heavenshell/vim-pydocstring', { 'do': 'make install', 'for': 'python' }\n\nIf you want install doq manually, you can install from PyPi.\n\n.. code::\n\n  $ python3 -m venv ./venv\n  $ ./venv/bin/pip3 install doq\n\nThen set installed `doq \u003chttps://pypi.org/project/doq/\u003e`_ path:\n\n.. code::\n\n  $ which doq\n  let g:pydocstring_doq_path = path/to/doq\n\nNote\n~~~~\n\nvim-pydocstring support Vim8.\n\nNeovim works since v2.2.0, but if something wrong, send me pull requests to fix it.\n\nIf you want use old version checkout `1.0.0 \u003chttps://github.com/heavenshell/vim-pydocstring/releases/tag/1.0.0\u003e`_\n\nBasic usage\n-----------\n\n1. Move your cursor on a `def` or `class` keyword line,\n2. type `:Pydocstring` and\n3. watch a docstring template magically appear below the current line\n\nFormat all\n----------\n\ntype `:PydocstringFormat` will insert all docstrings to current buffer.\n\nSettings\n--------\n\nPydocstring depends on ``shiftwidth`` if ``smarttab`` is set, otherwise\n``softtabstop``.  For the latter, you need to set like ``set softtabstop=4``.\n\nExample ``.vimrc``\n\n.. code::\n\n  autocmd FileType python setlocal tabstop=4 shiftwidth=4 smarttab expandtab\n\nOr:\n\n.. code::\n\n  autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab\n\nPydocstring use ftplugin, so `filetype plugin on` required.\n\nKey map\n-------\n\nIf you want change default keymapping, set following to your `.vimrc`.\n\n.. code::\n\n  nmap \u003csilent\u003e \u003cC-_\u003e \u003cPlug\u003e(pydocstring)\n\nOr, if you want disable default keymapping, you can set like following.\n\n.. code::\n\n  let g:pydocstring_enable_mapping = 0\n\nFormatter\n---------\n\nYou can set built-in formatter(Sphinx, Numpy, Google).\n\n.. code::\n\n  let g:pydocstring_formatter = 'numpy'\n\n\nCustom template\n---------------\n\nYou can set custom template. See `example \u003chttps://github.com/heavenshell/py-doq/tree/master/examples\u003e`_.\n\n.. code::\n\n  let g:pydocstring_templates_path = '/path/to/custom/templates'\n\nExceptions\n----------\n\nIf you want add exceptions to docstring, create custom template\nand visual select source block and hit `:'\u003c,'\u003ePydocstring` and then\nexcptions add to docstring.\n\n.. code::\n\n  def foo():\n      \"\"\"Summary of foo.\n\n      Raises:\n          Exception:\n      \"\"\"\n      raise Exception('foo')\n\nIgnore generate __init__ docstring\n----------------------------------\n\nIf you want ignore to generate `__init__` docstring, you can set like following.\n\n.. code::\n\n  let g:pydocstring_ignore_init = 1\n\nThanks\n------\n\nThe idea of venv installation is from `vim-lsp-settings \u003chttps://github.com/mattn/vim-lsp-settings\u003e`_.\nHighly applicate `@mattn \u003chttps://github.com/mattn/\u003e`_ and all vim-lsp-settings contributors.\n","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheavenshell%2Fvim-pydocstring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheavenshell%2Fvim-pydocstring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheavenshell%2Fvim-pydocstring/lists"}