mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-11 13:03:50 -05:00
Change gitignore provider
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'gitignore') == -1
|
||||
|
||||
" Vim syntax file
|
||||
" Language: .gitignore
|
||||
" Maintainer: Roman Dolgushin <rd@roman-dolgushin.ru>
|
||||
" URL: http://github.com/rdolgushin/gitignore.vim
|
||||
scriptencoding utf-8
|
||||
|
||||
" Copyright (c) 2017-2020 Filip Szymański. All rights reserved.
|
||||
" Use of this source code is governed by an MIT license that can be
|
||||
" found in the LICENSE file.
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('main_syntax')
|
||||
let main_syntax = 'conf'
|
||||
endif
|
||||
" https://git-scm.com/docs/gitignore#_pattern_format
|
||||
syntax keyword gitignoreTodo TODO FIXME XXX NOTE SEE contained
|
||||
syntax match gitignoreComment '^#.*' contains=gitignoreTodo
|
||||
syntax match gitignoreComment '\s#.*'ms=s+1 contains=gitignoreTodo
|
||||
syntax match gitignoreNegation '^!'
|
||||
syntax match gitignoreSeparator '/'
|
||||
syntax match gitignoreWildcard '\(\\\)\@<![*?]'
|
||||
syntax region gitignoreSet start='\[' skip='\\\]' end='\]'
|
||||
|
||||
runtime! syntax/conf.vim
|
||||
unlet b:current_syntax
|
||||
highlight default link gitignoreTodo Todo
|
||||
highlight default link gitignoreComment Comment
|
||||
highlight default link gitignoreNegation Exception
|
||||
highlight default link gitignoreSeparator Constant
|
||||
highlight default link gitignoreWildcard Special
|
||||
highlight default link gitignoreSet Character
|
||||
|
||||
let b:current_syntax = 'gitignore'
|
||||
|
||||
setlocal commentstring=#%s
|
||||
" vim: ts=2 et sw=2
|
||||
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user