xref: /vim-8.2.3635/runtime/syntax/netrc.vim (revision 214641f7)
1" Vim syntax file
2" Language:             netrc(5) configuration file
3" Previous Maintainer:  Nikolai Weibull <[email protected]>
4" Latest Revision:      2010-01-03
5
6if exists("b:current_syntax")
7  finish
8endif
9
10let s:cpo_save = &cpo
11set cpo&vim
12
13syn keyword netrcKeyword    machine nextgroup=netrcMachine skipwhite skipnl
14syn keyword netrcKeyword    account
15                          \ login
16                          \ nextgroup=netrcLogin,netrcSpecial skipwhite skipnl
17syn keyword netrcKeyword    password nextgroup=netrcPassword skipwhite skipnl
18syn keyword netrcKeyword    default
19syn keyword netrcKeyword    macdef
20                          \ nextgroup=netrcInit,netrcMacroName skipwhite skipnl
21syn region  netrcMacro      contained start='.' end='^$'
22
23syn match   netrcMachine    contained display '\S\+'
24syn match   netrcMachine    contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
25syn match   netrcLogin      contained display '\S\+'
26syn match   netrcLogin      contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
27syn match   netrcPassword   contained display '\S\+'
28syn match   netrcPassword   contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
29syn match   netrcMacroName  contained display '\S\+'
30                          \ nextgroup=netrcMacro skipwhite skipnl
31syn match   netrcMacroName  contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
32                          \ nextgroup=netrcMacro skipwhite skipnl
33
34syn keyword netrcSpecial    contained anonymous
35syn match   netrcInit       contained '\<init$'
36                          \ nextgroup=netrcMacro skipwhite skipnl
37
38syn sync fromstart
39
40hi def link netrcKeyword    Keyword
41hi def link netrcMacro      PreProc
42hi def link netrcMachine    Identifier
43hi def link netrcLogin      String
44hi def link netrcPassword   String
45hi def link netrcMacroName  String
46hi def link netrcSpecial    Special
47hi def link netrcInit       Special
48
49let b:current_syntax = "netrc"
50
51let &cpo = s:cpo_save
52unlet s:cpo_save
53