mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-19 17:14:18 +00:00
add vim syntax files for config files
This commit is contained in:
parent
d83cf0ac56
commit
b67dcdc1e2
|
@ -339,3 +339,11 @@ Only then you could also set up git to ignore specific formatting revisions:
|
|||
```bash
|
||||
git config blame.ignoreRevsFile formatting-revs.txt
|
||||
```
|
||||
|
||||
(Neo)Vim Syntax Highlighting for config files
|
||||
----------------------------------------
|
||||
Copy the file detection and syntax files to your vim config folder, in the case of neovim:
|
||||
|
||||
```bash
|
||||
cp -R other/vim/* ~/.config/nvim/
|
||||
```
|
||||
|
|
1
other/vim/ftdetect/ddnet-cfg.vim
Normal file
1
other/vim/ftdetect/ddnet-cfg.vim
Normal file
|
@ -0,0 +1 @@
|
|||
autocmd BufRead,BufNewFile settings_ddnet.cfg set filetype=ddnet-cfg
|
25
other/vim/syntax/ddnet-cfg.vim
Normal file
25
other/vim/syntax/ddnet-cfg.vim
Normal file
|
@ -0,0 +1,25 @@
|
|||
" Vim syntax file
|
||||
" Language: ddnet config files (https://github.com/ddnet/ddnet)
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax match settingName "^\w*"
|
||||
|
||||
syntax match value "\s\w*"
|
||||
syntax match escapeQuote "\\\""
|
||||
syntax match number "\s[0-9]\+"
|
||||
syntax match ip "\s\d\+\.\d\+\.\d\+\.\d\+\(:\d\+\)\="
|
||||
|
||||
syntax region string start='"' end='"' contains=escapeQuote
|
||||
|
||||
hi def link settingName Identifier
|
||||
|
||||
hi def link value Constant
|
||||
hi def link ip Constant
|
||||
hi def link string String
|
||||
hi def link number Number
|
||||
hi def link escapeQuote SpecialChar
|
||||
|
||||
let b:current_syntax = "ddnet-cfg"
|
Loading…
Reference in a new issue