{"id":19691165,"url":"https://github.com/rdipardo/vim-cpywrite","last_synced_at":"2025-07-04T17:35:46.951Z","repository":{"id":37830543,"uuid":"271229791","full_name":"rdipardo/vim-cpywrite","owner":"rdipardo","description":"Generate copyright headers for any open source license","archived":false,"fork":false,"pushed_at":"2025-04-01T04:56:58.000Z","size":5320,"stargazers_count":9,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-05T14:34:42.712Z","etag":null,"topics":["neovim","python-interface","spdx-license-identifier","spdx-licenses","vim","vimscript"],"latest_commit_sha":null,"homepage":"https://www.vim.org/scripts/script.php?script_id=5888","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdipardo.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.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":"2020-06-10T09:04:13.000Z","updated_at":"2025-03-26T16:46:45.000Z","dependencies_parsed_at":"2023-02-09T21:16:02.568Z","dependency_job_id":"32755e08-3b40-438c-a3a6-68abcd9a1aba","html_url":"https://github.com/rdipardo/vim-cpywrite","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdipardo%2Fvim-cpywrite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdipardo%2Fvim-cpywrite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdipardo%2Fvim-cpywrite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdipardo%2Fvim-cpywrite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdipardo","download_url":"https://codeload.github.com/rdipardo/vim-cpywrite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251465447,"owners_count":21593882,"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":["neovim","python-interface","spdx-license-identifier","spdx-licenses","vim","vimscript"],"created_at":"2024-11-11T19:08:14.889Z","updated_at":"2025-04-29T08:36:05.917Z","avatar_url":"https://github.com/rdipardo.png","language":"Vim Script","readme":"############\nvim-cpywrite\n############\n\n|gh-actions| |coverage| |current version|\n\nGenerate copyright headers for any open source license\n\n.. figure:: https://raw.githubusercontent.com/rdipardo/vim-cpywrite/media/rel/vim_8.2.4046.gif\n    :alt: vim-win-x64-demo\n    :align: center\n    :width: 900\n\n----\n\n.. contents:: **Contents**\n    :depth: 2\n    :backlinks: top\n\nIntroduction\n============\n\nMostly written in CPython, this (neo)vim plugin fetches the license of your\nchoice directly from the `SPDX License List`_. If the XML response contains a\nstandard header, it's inserted at the top of the current buffer with your\ncopyright info.\n\nWhen no standard header is provided, you can either insert a brief license\nacknowledgment, or the full license text. (See the ``g:cpywrite#verbatim_mode``\noption `below \u003c#options\u003e`_.)\n\nThis plugin learns your name and email by invoking ``git``. If that fails, the\ncopyright line will contain your OS user and host names.\n\n.. _SPDX License List: https://github.com/spdx/license-list-xml\n\nFeatures\n========\n\n* Python bindings compatible with python 3.7+, depending on your\n  platform and (neo)vim version, of course\n\n:NOTE: Python 3.10 requires `neovim 0.6.0`_ or newer.\n       All vim versions from 8.1 and up should be compatible.\n       `Bug reports \u003chttps://github.com/rdipardo/vim-cpywrite/issues\u003e`_ are welcome.\n\n* Choose from more than 420 licenses (press ``\u003ctab\u003e`` after the ``:CPYwriteDefaultLicense``\n  or ``:CPYwrite`` command for suggestions)\n\n.. _completions:\n\n* No dependency on other plugins. That said, neovim users will be grateful to\n  have the `completeopt`_ feature when tabbing through all the available\n  licenses. Vim users may want to add ``set wildmenu`` to their ``.vimrc`` file\n\n.. _completeopt: https://neovim.io/doc/user/options.html#'completeopt'\n.. _`neovim 0.6.0`: https://github.com/neovim/neovim/commit/e65b724451ba5f65dfcaf8f8c16afdd508db7359\n\nQuick Reference\n===============\n\nCommands\n--------\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwrite [{spdx_short_name}]``               | Fetches the license identified by           |\n|                                                | ``spdx_short_name`` (without quotes) --     |\n|                                                | uses the current value of                   |\n|                                                | ``g:cpywrite#default_license`` when no      |\n|                                                | argument is given -- supports ``\u003ctab\u003e``     |\n|                                                | completion                                  |\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwriteDefaultLicense [{spdx_short_name}]`` | Sets ``g:cpywrite#default_license`` to the  |\n|                                                | license identified by ``spdx_short_name``   |\n|                                                | (without quotes) -- prints the default      |\n|                                                | licence id when called with no argument --  |\n|                                                | supports ``\u003ctab\u003e`` completion               |\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwriteKeepShebangs``                       | Switches ``g:cpywrite#preserve_shebangs``   |\n|                                                | on or off                                   |\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwriteToggleMode``                         | Switches ``g:cpywrite#verbatim_mode`` on or |\n|                                                | off                                         |\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwriteToggleStyle``                        | Switches ``g:cpywrite#machine_readable`` on |\n|                                                | or off                                      |\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwriteToggleFilename``                     | Switches ``g:cpywrite#hide_filename`` on or |\n|                                                | off                                         |\n+------------------------------------------------+---------------------------------------------+\n|``:CPYwriteAllowAnonymous``                     | Switches ``g:cpywrite#no_anonymous`` on or  |\n|                                                | off                                         |\n+------------------------------------------------+---------------------------------------------+\n|``\u003cPlug\u003e(cpywrite)``                            | Does the same as calling ``:CPYwrite`` with |\n|                                                | no argument                                 |\n+------------------------------------------------+---------------------------------------------+\n\nDefault mappings\n----------------\n+----------------+------------------------------+\n| ``{Normal}LH`` | Maps to ``\u003cPlug\u003e(cpywrite)`` |\n+----------------+------------------------------+\n\nOptions\n-------\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#default_license``   | The SPDX identifier of the license to be      |\n|                                  | fetched by the ``:CPYwrite`` command.         |\n|                                  | Default: ``'Apache-2.0'``                     |\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#preserve_shebangs`` | When set to a non-zero value, the license     |\n|                                  | header is inserted *after* any shebang or     |\n|                                  | encoding directive (since `0.7.0`_).          |\n|                                  | Default: ``1``                                |\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#verbatim_mode``     | When set to a non-zero value, the full        |\n|                                  | license text will be requested -- you should  |\n|                                  | only choose this when the license is no       |\n|                                  | longer than 3-4 paragraphs (e.g. Unlicense,   |\n|                                  | MIT, BSD 1- 2- 3-Clause, etc.).               |\n|                                  | Default: ``0``                                |\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#no_anonymous``      | When set to a non-zero value, copyright       |\n|                                  | information is never omitted, even if the     |\n|                                  | license implies a Public Domain grant.        |\n|                                  | Default: ``0``                                |\n+----------------------------------+-----------------------------------------------+\n|                                  | Has no effect when                            |\n|                                  | ``g:cpywrite#machine_readable`` is on         |\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#machine_readable``  | When set to a non-zero value, the license     |\n|                                  | and copyright statement are formatted as      |\n|                                  | tags.                                         |\n|                                  | Default: ``0``                                |\n+----------------------------------+-----------------------------------------------+\n|                                  | Overrides ``g:cpywrite#verbatim_mode`` and    |\n|                                  | ``g:cpywrite#no_anonymous``                   |\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#hide_filename``     | When set to a non-zero value, hides the name  |\n|                                  | of the current buffer from the license header |\n|                                  | in all modes.                                 |\n|                                  | Default: ``0``                                |\n+----------------------------------+-----------------------------------------------+\n| ``g:cpywrite#java#add_class_doc``| When set to a non-zero value, ``:CPYwrite``   |\n|                                  | will try to insert an appropriate ``@author`` |\n|                                  | tag into an existing JavaDoc comment above    |\n|                                  | the main class definition.                    |\n|                                  | Default: ``1`` (file type must be ``java``)   |\n+----------------------------------+-----------------------------------------------+\n\n.. _`0.7.0`: https://github.com/rdipardo/vim-cpywrite/blob/master/CHANGELOG.rst#changes-in-070\n\nRequirements\n============\n\n* Vim compiled with any one of the *+python3* or *+python3/dyn* options.\n  See if you're supported by entering ``vim --version | grep +python3`` at your\n  terminal, or start ``vim`` and enter the ``:version`` command\n\n* Neovim with the `pynvim`_ module in your ``$PYTHONPATH``. Start ``nvim``\n  and enter ``:help provider-python`` for more information\n\n.. _pynvim: https://github.com/neovim/pynvim\n\nInstallation\n============\n\nIf `pynvim`_ is not already in your ``$PYTHONPATH``, install it::\n\n    pip install --user -U pynvim\n\n\nAs a vim package\n----------------\n\nIf you have vim 8+, you can directly copy the plugin source tree to your\n`native package directory`_::\n\n    git clone https://github.com/rdipardo/vim-cpywrite ~/.vim/pack/*/start/vim-cpywrite\n\n**Note.** You can replace ``*`` with any name you want (e.g. ``plugins``)\n\nLearn more by typing ``:help packages`` into your ``vim`` command prompt.\nYou should also read about `DIY plugin management`_.\n\nUsers of older vim versions can simulate native package loading with `vim-pathogen`_.\n\nAs a remote plugin\n------------------\n\nUsing `plug.vim \u003chttps://github.com/junegunn/vim-plug\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nEdit your ``~/.vimrc``, ``~/.vim/vimrc``, or ``~/.config/nvim/init.vim``:\n\n.. code-block:: vim\n\n    call plug#begin('~/path/to/your/plugin/directory/')\n\n    Plug 'rdipardo/vim-cpywrite'\n\n    call plug#end()\n\n\nUsing `Vundle \u003chttps://github.com/VundleVim/Vundle.vim\u003e`_\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nInstall Vundle::\n\n    git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim\n\nor (if using neovim)::\n\n    git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim\n\nEdit your ``~/.vimrc``, ``~/.vim/vimrc``, or ``~/.config/nvim/init.vim``:\n\n.. code-block:: vim\n\n    set rtp+=~/.vim/bundle/Vundle.vim\n    \"or:\n    \"set rtp+=~/.config/nvim/bundle/Vundle.vim\n\n    call vundle#begin()\n\n    Plugin 'rdipardo/vim-cpywrite'\n\n    call vundle#end()\n\n\nProjects like this one\n======================\n\n* vim-copyright_ (*not* a fork)\n* vim-licenses_, formerly licenses_\n* vim-header_\n* license-to-vim_\n* `license loader`_\n\n.. _vim-copyright: https://github.com/nine2/vim-copyright\n.. _vim-licenses: https://github.com/antoyo/vim-licenses\n.. _licenses: https://github.com/vim-scripts/Licenses\n.. _vim-header: https://github.com/alpertuna/vim-header\n.. _license-to-vim: https://www.vim.org/scripts/script.php?script_id=5349\n.. _license loader: https://www.vim.org/scripts/script.php?script_id=4064\n\nTODO\n====\n\n|_| Provide a batch mode for licensing all tracked files in a working tree\n\n|_| Provide the option to set user-defined authorship details\n\n|x| Expand the list of `supported programming languages`_\n\n.. |_| unicode:: U+2610 .. BALLOT BOX\n.. |X| unicode:: U+2611 .. BALLOT BOX WITH CHECK\n\nImprove this README\n-------------------\n\nConsider opening a PR with an updated `installation guide \u003c#installation\u003e`_ if any of the\nfollowing applies to you:\n\n* installation fails\n* installation succeeds with a plugin manager not mentioned here\n\nLicense\n=======\n\nDistributed under the terms of the MIT license.\n\n.. |gh-actions| image:: https://github.com/rdipardo/vim-cpywrite/actions/workflows/ci.yml/badge.svg?branch=pre-release\n    :alt: Build Status\n    :target: https://github.com/rdipardo/vim-cpywrite/actions/workflows/ci.yml\n.. |current version| image:: https://img.shields.io/github/v/release/rdipardo/vim-cpywrite?logo=vim\u0026labelColor=009933\u0026color=ffffe0\n    :alt: Vim Scripts version\n.. |coverage| image:: https://codecov.io/gh/rdipardo/vim-cpywrite/graph/badge.svg\n    :alt: Coverage stats\n    :target: https://codecov.io/gh/rdipardo/vim-cpywrite\n\n.. _supported programming languages: https://github.com/rdipardo/vim-cpywrite/blob/4d99f7af6a54442055e2c17a3ee12258623b64e9/rplugin/pythonx/cpywrite/generator.py#L320\n.. _vim-pathogen: https://github.com/tpope/vim-pathogen#native-vim-package-management\n.. _native package directory: https://github.com/vim/vim/blob/03c3bd9fd094c1aede2e8fe3ad8fd25b9f033053/runtime/doc/repeat.txt#L515\n.. _DIY plugin management: https://shapeshed.com/vim-packages\n\n.. vim:ft=rst:et:tw=78:\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdipardo%2Fvim-cpywrite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdipardo%2Fvim-cpywrite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdipardo%2Fvim-cpywrite/lists"}