Add pip requirements.txt syntax highlighting

This commit is contained in:
Kenneth Benzie 2021-07-12 13:34:09 +01:00
parent 2188095b2f
commit 30c601e8b3
3 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1 @@
autocmd BufNewFile,BufReadPost */requirements.txt set filetype=requirements

View File

@ -0,0 +1,2 @@
set nospell
set commentstring=#%s

11
syntax/requirements.vim Normal file
View File

@ -0,0 +1,11 @@
if exists('b:current_syntax')
finish
endif
highlight default link requirementsComment Comment
highlight default link requirementsVersion Identifier
highlight default link requirementsOperator Operator
syntax region requirementsComment start='^\w*#' end='$' contains=@Spell
syntax match requirementsVersion '\d\+\.\d\+\.\d\+\w*'
syntax match requirementsOperator '=='