mirror of
https://github.com/raimon49/requirements.txt.vim.git
synced 2025-12-06 10:04:23 +08:00
Merge pull request #7 from raimon49/follow-pep508-better
Follow pep508 better
This commit is contained in:
@@ -1,7 +1,28 @@
|
|||||||
" the Requirements File Format syntax support for Vim
|
" the Requirements File Format syntax support for Vim
|
||||||
" Version: 1.4.2
|
" Version: 1.5.0
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
" License: MIT LICENSE
|
" 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
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|||||||
@@ -17,6 +17,13 @@ Sphinx==1.3.3
|
|||||||
sphinx-rtd-theme==0.1.9
|
sphinx-rtd-theme==0.1.9
|
||||||
zope.interface==4.2.0
|
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
|
# VCS repositories
|
||||||
[-e] git+git://git.myproject.org/MyProject#egg=MyProject # Git
|
[-e] git+git://git.myproject.org/MyProject#egg=MyProject # Git
|
||||||
[-e] git://git.myproject.org/MyProject.git@v1.0#egg=MyProject
|
[-e] git://git.myproject.org/MyProject.git@v1.0#egg=MyProject
|
||||||
|
|||||||
@@ -1,8 +1,28 @@
|
|||||||
" the Requirements File Format syntax support for Vim
|
" the Requirements File Format syntax support for Vim
|
||||||
" Version: 1.4.2
|
" Version: 1.5.0
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
" License: MIT LICENSE
|
" 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')
|
if !exists('g:requirements#detect_filename_pattern')
|
||||||
let g:requirements#detect_filename_pattern = ''
|
let g:requirements#detect_filename_pattern = ''
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -1,7 +1,28 @@
|
|||||||
" the Requirements File Format syntax support for Vim
|
" the Requirements File Format syntax support for Vim
|
||||||
" Version: 1.4.2
|
" Version: 1.5.0
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
" License: MIT LICENSE
|
" 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')
|
if exists('g:loaded_requirements')
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -1,7 +1,28 @@
|
|||||||
" the Requirements File Format syntax support for Vim
|
" the Requirements File Format syntax support for Vim
|
||||||
" Version: 1.4.2
|
" Version: 1.5.0
|
||||||
" Author: raimon <raimon49@hotmail.com>
|
" Author: raimon <raimon49@hotmail.com>
|
||||||
" License: MIT LICENSE
|
" 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"
|
if exists("b:current_syntax") && b:current_syntax == "requirements"
|
||||||
finish
|
finish
|
||||||
@@ -12,14 +33,20 @@ syn case match
|
|||||||
syn region requirementsComment start="[ \t]*#" end="$"
|
syn region requirementsComment start="[ \t]*#" end="$"
|
||||||
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
|
||||||
syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
|
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 requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+)\S+"
|
||||||
|
syn match requirementsURLs "\v\@\s\S+"
|
||||||
|
syn match requirementsEnvironmentMarkers "\v;\s.+$"
|
||||||
|
|
||||||
hi link requirementsComment Comment
|
hi link requirementsComment Comment
|
||||||
hi link requirementsCommandOption Special
|
hi link requirementsCommandOption Special
|
||||||
hi link requirementsVersionSpecifiers Boolean
|
hi link requirementsVersionSpecifiers Boolean
|
||||||
hi link requirementsPackageName Identifier
|
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"
|
let b:current_syntax = "requirements"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user