blob: d8eba30a8a57f02d63860f957683ebdd83dc16f0 [file] [log] [blame]
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00001" Vim syntax file
Bram Moolenaar42eeac32005-06-29 22:40:58 +00002" Language: netrc(5) configuration file
Bram Moolenaar57657d82006-04-21 22:12:41 +00003" Maintainer: Nikolai Weibull <now@bitwi.se>
4" Latest Revision: 2006-04-19
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00005
Bram Moolenaar42eeac32005-06-29 22:40:58 +00006if exists("b:current_syntax")
Bram Moolenaar1cd871b2004-12-19 22:46:22 +00007 finish
8endif
9
Bram Moolenaar42eeac32005-06-29 22:40:58 +000010let s:cpo_save = &cpo
11set cpo&vim
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000012
Bram Moolenaar42eeac32005-06-29 22:40:58 +000013syn keyword netrcKeyword machine nextgroup=netrcMachine skipwhite skipnl
14syn keyword netrcKeyword login nextgroup=netrcLogin,netrcSpecial
15 \ skipwhite skipnl
16syn keyword netrcKeyword password nextgroup=netrcPassword skipwhite skipnl
17syn keyword netrcKeyword default
18syn keyword netrcKeyword macdef nextgroup=netrcInit,netrcMacroName
19 \ skipwhite skipnl
20syn region netrcMacro contained start='.' end='^$'
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000021
Bram Moolenaar42eeac32005-06-29 22:40:58 +000022syn match netrcMachine contained display '\S\+'
23syn match netrcMachine contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
24syn match netrcLogin contained display '\S\+'
25syn match netrcLogin contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
26syn match netrcPassword contained display '\S\+'
27syn match netrcPassword contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
28syn match netrcMacroName contained display '\S\+' nextgroup=netrcMacro
29 \ skipwhite skipnl
30syn match netrcMacroName contained display '"[^\\"]*\(\\.[^\\"]*\)*"'
31 \ nextgroup=netrcMacro skipwhite skipnl
32
33syn keyword netrcSpecial contained anonymous
34syn match netrcInit contained '\<init$' nextgroup=netrcMacro
35 \ skipwhite skipnl
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000036
37syn sync fromstart
38
Bram Moolenaar42eeac32005-06-29 22:40:58 +000039hi def link netrcKeyword Keyword
40hi def link netrcMacro PreProc
41hi def link netrcMachine Identifier
42hi def link netrcLogin String
43hi def link netrcPassword String
44hi def link netrcMacroName String
45hi def link netrcSpecial Special
46hi def link netrcInit Special
Bram Moolenaar1cd871b2004-12-19 22:46:22 +000047
48let b:current_syntax = "netrc"
49
Bram Moolenaar42eeac32005-06-29 22:40:58 +000050let &cpo = s:cpo_save
51unlet s:cpo_save