diff --git a/autoload/requirements.vim b/autoload/requirements.vim index 1110540..e5234fc 100644 --- a/autoload/requirements.vim +++ b/autoload/requirements.vim @@ -1,7 +1,28 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. let s:save_cpo = &cpo set cpo&vim diff --git a/examples/requirements.txt b/examples/requirements.txt index f06cef4..991b7dd 100644 --- a/examples/requirements.txt +++ b/examples/requirements.txt @@ -17,6 +17,13 @@ Sphinx==1.3.3 sphinx-rtd-theme==0.1.9 zope.interface==4.2.0 +# Examples from PEP508 +# c.f. https://www.python.org/dev/peps/pep-0508/ +requests [security,tests] >= 2.8.1, == 2.8.* ; python_version < "2.7" +pip @ https://github.com/pypa/pip/archive/1.3.1.zip#sha1=da9234ee9982d4bbb3c72346a6de940a148ea686 +name @ gopher:/foo/com" +foobar[quux]<2,>=3; os_name=='a' + # VCS repositories [-e] git+git://git.myproject.org/MyProject#egg=MyProject # Git [-e] git://git.myproject.org/MyProject.git@v1.0#egg=MyProject diff --git a/ftdetect/requirements.vim b/ftdetect/requirements.vim index a28edeb..7f9ac2b 100644 --- a/ftdetect/requirements.vim +++ b/ftdetect/requirements.vim @@ -1,8 +1,28 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) " +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. if !exists('g:requirements#detect_filename_pattern') let g:requirements#detect_filename_pattern = '' endif diff --git a/plugin/requirements.vim b/plugin/requirements.vim index 73fc81b..6627d51 100644 --- a/plugin/requirements.vim +++ b/plugin/requirements.vim @@ -1,7 +1,28 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. if exists('g:loaded_requirements') finish diff --git a/syntax/requirements.vim b/syntax/requirements.vim index 351ff5b..a9e8078 100644 --- a/syntax/requirements.vim +++ b/syntax/requirements.vim @@ -1,7 +1,28 @@ " the Requirements File Format syntax support for Vim -" Version: 1.4.2 +" Version: 1.5.0 " Author: raimon " License: MIT LICENSE +" The MIT License (MIT) +" +" Copyright (c) 2015 raimon +" +" Permission is hereby granted, free of charge, to any person obtaining a copy +" of this software and associated documentation files (the "Software"), to deal +" in the Software without restriction, including without limitation the rights +" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +" copies of the Software, and to permit persons to whom the Software is +" furnished to do so, subject to the following conditions: +" +" The above copyright notice and this permission notice shall be included in all +" copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +" SOFTWARE. if exists("b:current_syntax") && b:current_syntax == "requirements" finish @@ -12,14 +33,20 @@ syn case match syn region requirementsComment start="[ \t]*#" end="$" syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?" syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)" -syn match requirementsPackageName "\v^[a-zA-Z][a-zA-Z\-_\.0-9]*" +syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])" +syn match requirementsExtras "\v\[\S+\]" syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+)\S+" +syn match requirementsURLs "\v\@\s\S+" +syn match requirementsEnvironmentMarkers "\v;\s.+$" hi link requirementsComment Comment hi link requirementsCommandOption Special hi link requirementsVersionSpecifiers Boolean hi link requirementsPackageName Identifier -hi link requirementsVersionControls Identifier +hi link requirementsExtras Type +hi link requirementsVersionControls Underlined +hi link requirementsURLs Underlined +hi link requirementsEnvironmentMarkers Macro let b:current_syntax = "requirements"