blob: f132a52705491fa611d8ef61430b9b101c7bb950 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
Bram Moolenaarbe4e0162023-02-02 13:59:48 +00002" Language: gpg(1) configuration file
Christian Brabandtf9ca1392024-02-19 20:37:11 +01003" Maintainer: This runtime file is looking for a maintainer.
Bram Moolenaarbe4e0162023-02-02 13:59:48 +00004" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
Christian Brabandt6d912272024-02-11 18:19:45 +01005" Latest Revision: 2024-02-11
6" Updated:
7" 2023-01-23 @ObserverOfTime: added a couple of keywords
Bram Moolenaar71badf92023-04-22 22:40:14 +01008" 2023-03-21 Todd Zullinger <tmz@pobox.com>: sync with gnupg-2.4.0
Christian Brabandt6d912272024-02-11 18:19:45 +01009" 2024-02-10 Daniel Kahn Gillmor <dkg@fifthhorseman.net>:
10" mark use-embedded-filename as warning for security reasons
Bram Moolenaar071d4272004-06-13 20:20:40 +000011
Bram Moolenaar42eeac32005-06-29 22:40:58 +000012if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000013 finish
14endif
15
Bram Moolenaar42eeac32005-06-29 22:40:58 +000016let s:cpo_save = &cpo
17set cpo&vim
Bram Moolenaar071d4272004-06-13 20:20:40 +000018
Bram Moolenaar3577c6f2008-06-24 21:16:56 +000019setlocal iskeyword+=-
Bram Moolenaar071d4272004-06-13 20:20:40 +000020
Bram Moolenaarbe4e0162023-02-02 13:59:48 +000021syn keyword gpgTodo contained FIXME TODO XXX NOTE
Bram Moolenaar071d4272004-06-13 20:20:40 +000022
Bram Moolenaarbe4e0162023-02-02 13:59:48 +000023syn region gpgComment contained display oneline start='#' end='$'
24 \ contains=gpgTodo,gpgID,@Spell
Bram Moolenaar071d4272004-06-13 20:20:40 +000025
Bram Moolenaarbe4e0162023-02-02 13:59:48 +000026syn match gpgID contained display '\<\(0x\)\=\x\{8,}\>'
Bram Moolenaar071d4272004-06-13 20:20:40 +000027
Christian Brabandt6d912272024-02-11 18:19:45 +010028syn match gpgBegin display '^' skipwhite nextgroup=gpgComment,gpgOption,gpgOptionDeprecated,gpgCommand
Bram Moolenaar071d4272004-06-13 20:20:40 +000029
Bram Moolenaarbe4e0162023-02-02 13:59:48 +000030syn keyword gpgCommand contained skipwhite nextgroup=gpgArg
Bram Moolenaar71badf92023-04-22 22:40:14 +010031 \ change-passphrase check-sig check-signatures
32 \ check-sigs delete-keys delete-secret-and-public-keys
33 \ delete-secret-keys desig-revoke export
34 \ export-secret-keys export-secret-ssh-key
35 \ export-secret-subkeys export-ssh-key list-key
36 \ list-keys list-packets list-public-keys
37 \ list-secret-keys list-sig list-signatures list-sigs
38 \ passwd send-keys fetch-keys
39 \ generate-designated-revocation generate-revocation
40 \ gen-prime gen-random gen-revoke locate-external-keys
41 \ locate-keys lsign-key options print-md quick-add-key
42 \ quick-addkey quick-add-uid quick-adduid
43 \ quick-generate-key quick-gen-key quick-lsign-key
44 \ quick-revoke-sig quick-revoke-uid quick-revuid
45 \ quick-set-expire quick-set-primary-uid quick-sign-key
46 \ quick-update-pref receive-keys recv-keys refresh-keys
47 \ search-keys show-key show-keys sign-key tofu-policy
Christian Brabandt6d912272024-02-11 18:19:45 +010048
Bram Moolenaarbe4e0162023-02-02 13:59:48 +000049syn keyword gpgCommand contained skipwhite nextgroup=gpgArgError
Bram Moolenaar71badf92023-04-22 22:40:14 +010050 \ card-edit card-status change-pin check-trustdb
51 \ clear-sign clearsign dearmor dearmour decrypt
52 \ decrypt-files detach-sign encrypt encrypt-files
53 \ edit-card edit-key enarmor enarmour export-ownertrust
54 \ fast-import import import-ownertrust key-edit
55 \ fingerprint fix-trustdb full-generate-key
56 \ full-gen-key generate-key gen-key gpgconf-list
57 \ gpgconf-test list-config list-gcrypt-config
58 \ list-trustdb no-options print-mds
59 \ rebuild-keydb-caches server sign store symmetric
60 \ update-trustdb verify verify-files
Bram Moolenaar071d4272004-06-13 20:20:40 +000061
Bram Moolenaarbe4e0162023-02-02 13:59:48 +000062syn keyword gpgOption contained skipwhite nextgroup=gpgArg
Bram Moolenaar71badf92023-04-22 22:40:14 +010063 \ aead-algo agent-program attribute-fd attribute-file
64 \ auto-key-locate bzip2-compress-level cert-digest-algo
65 \ cert-notation cert-policy-url charset chuid
66 \ chunk-size cipher-algo command-fd command-file
67 \ comment compatibility-flags completes-needed
68 \ compliance compress-algo compression-algo
69 \ compress-level ctapi-driver debug
70 \ debug-allow-large-chunks debug-level
71 \ debug-set-iobuf-size default-cert-check-level
72 \ default-cert-expire default-cert-level default-key
73 \ default-keyserver-url default-new-key-algo
74 \ default-preference-list default-recipient
75 \ default-sig-expire digest-algo dirmngr-program
76 \ disable-cipher-algo disable-pubkey-algo display
77 \ display-charset encrypt-to exec-path export-filter
78 \ export-options faked-system-time force-ownertrust
79 \ gpg-agent-info group hidden-encrypt-to
80 \ hidden-recipient hidden-recipient-file homedir
81 \ import-filter import-options input-size-hint
82 \ keyboxd-program keyid-format key-origin keyring
83 \ keyserver keyserver-options known-notation lc-ctype
84 \ lc-messages limit-card-insert-tries list-filter
85 \ list-options local-user log-file logger-fd
86 \ logger-file marginals-needed max-cert-depth
87 \ max-output min-cert-level min-rsa-length output
88 \ override-session-key override-session-key-fd
89 \ passphrase passphrase-fd passphrase-file
90 \ passphrase-repeat pcsc-driver
91 \ personal-aead-preferences personal-cipher-preferences
92 \ personal-cipher-prefs personal-compress-preferences
93 \ personal-compress-prefs personal-digest-preferences
94 \ photo-viewer pinentry-mode primary-keyring
95 \ reader-port recipient recipient-file remote-user
96 \ request-origin s2k-cipher-algo s2k-count
97 \ s2k-digest-algo s2k-mode secret-keyring sender
98 \ set-filename set-filesize set-notation set-policy-url
99 \ sig-keyserver-url sig-notation sign-with
100 \ sig-policy-url status-fd status-file temp-directory
101 \ tofu-db-format tofu-default-policy trustdb-name
102 \ trusted-key trust-model try-secret-key ttyname
103 \ ttytype ungroup user verify-options weak-digest
104 \ xauthority
Christian Brabandt6d912272024-02-11 18:19:45 +0100105
Bram Moolenaarbe4e0162023-02-02 13:59:48 +0000106syn keyword gpgOption contained skipwhite nextgroup=gpgArgError
Bram Moolenaar71badf92023-04-22 22:40:14 +0100107 \ allow-freeform-uid allow-multiple-messages
108 \ allow-multisig-verification allow-non-selfsigned-uid
109 \ allow-old-cipher-algos allow-secret-key-import
110 \ allow-weak-digest-algos allow-weak-key-signatures
111 \ always-trust armor armour ask-cert-expire
112 \ ask-cert-level ask-sig-expire auto-check-trustdb
113 \ auto-key-import auto-key-retrieve batch
114 \ bzip2-decompress-lowmem compress-keys compress-sigs
115 \ debug-all debug-iolbf debug-quick-random
116 \ default-comment default-recipient-self disable-ccid
117 \ disable-dirmngr disable-dsa2 disable-large-rsa
118 \ disable-mdc disable-signer-uid dry-run dump-options
119 \ dump-option-table emit-version enable-dsa2
120 \ enable-large-rsa enable-progress-filter
121 \ enable-special-filenames encrypt-to-default-key
122 \ escape-from-lines exit-on-status-write-error expert
123 \ fast-list-mode file-is-digest fixed-list-mode
124 \ forbid-gen-key force-aead force-mdc force-ocb
125 \ force-sign-key force-v3-sigs force-v4-certs
126 \ for-your-eyes-only full-timestrings gnupg help
127 \ honor-http-proxy ignore-crc-error ignore-mdc-error
128 \ ignore-time-conflict ignore-valid-from
129 \ include-key-block interactive legacy-list-mode
Bram Moolenaarbe4e0162023-02-02 13:59:48 +0000130 \ list-only lock-multiple lock-never lock-once
Bram Moolenaar71badf92023-04-22 22:40:14 +0100131 \ mangle-dos-filenames merge-only mimemode multifile no
132 \ no-allow-freeform-uid no-allow-multiple-messages
133 \ no-allow-non-selfsigned-uid no-armor no-armour
134 \ no-ask-cert-expire no-ask-cert-level
135 \ no-ask-sig-expire no-auto-check-trustdb
136 \ no-auto-key-import no-auto-key-locate
137 \ no-auto-key-retrieve no-autostart
138 \ no-auto-trust-new-key no-batch no-comments
Bram Moolenaarbe4e0162023-02-02 13:59:48 +0000139 \ no-default-keyring no-default-recipient
Bram Moolenaar71badf92023-04-22 22:40:14 +0100140 \ no-disable-mdc no-emit-version no-encrypt-to
141 \ no-escape-from-lines no-expensive-trust-checks
142 \ no-expert no-force-mdc no-force-v3-sigs
143 \ no-force-v4-certs no-for-your-eyes-only no-greeting
144 \ no-groups no-include-key-block no-keyring no-literal
145 \ no-mangle-dos-filenames no-mdc-warning
146 \ no-permission-warning no-pgp2 no-pgp6 no-pgp7 no-pgp8
147 \ no-random-seed-file no-require-backsigs
148 \ no-require-cross-certification no-require-secmem
149 \ no-rfc2440-text no-secmem-warning no-show-notation
150 \ no-show-photos no-show-policy-url no-sig-cache
151 \ no-sk-comments no-skip-hidden-recipients
152 \ no-symkey-cache not-dash-escaped no-textmode
153 \ no-throw-keyids no-tty no-use-agent
Christian Brabandt6d912272024-02-11 18:19:45 +0100154 \ no-utf8-strings no-verbose
Bram Moolenaar71badf92023-04-22 22:40:14 +0100155 \ no-version only-sign-text-ids openpgp
156 \ override-compliance-check pgp6 pgp7 pgp8
157 \ preserve-permissions print-dane-records quiet
158 \ require-backsigs require-compliance
159 \ require-cross-certification require-secmem rfc2440
160 \ rfc2440-text rfc4880 rfc4880bis show-keyring
161 \ show-notation show-photos show-policy-url
162 \ show-session-key sk-comments skip-hidden-recipients
163 \ skip-verify textmode throw-keyids try-all-secrets
Christian Brabandt6d912272024-02-11 18:19:45 +0100164 \ unwrap use-agent use-keyboxd
Bram Moolenaar71badf92023-04-22 22:40:14 +0100165 \ use-only-openpgp-card utf8-strings verbose version
166 \ warranty with-colons with-fingerprint
167 \ with-icao-spelling with-key-data with-keygrip
168 \ with-key-origin with-key-screening with-secret
169 \ with-sig-check with-sig-list with-subkey-fingerprint
170 \ with-subkey-fingerprints with-tofu-info with-wkd-hash
171 \ yes
Bram Moolenaar071d4272004-06-13 20:20:40 +0000172
Christian Brabandt6d912272024-02-11 18:19:45 +0100173" depcrated for security reasons
174syn keyword gpgOptionDeprecated contained skipwhite nextgroup=gpgArgError
175 \ use-embedded-filename no-use-embedded-filename
176
Bram Moolenaarbe4e0162023-02-02 13:59:48 +0000177syn match gpgArg contained display '\S\+\(\s\+\S\+\)*' contains=gpgID
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000178syn match gpgArgError contained display '\S\+\(\s\+\S\+\)*'
Bram Moolenaar071d4272004-06-13 20:20:40 +0000179
Bram Moolenaarbe4e0162023-02-02 13:59:48 +0000180hi def link gpgComment Comment
181hi def link gpgTodo Todo
182hi def link gpgID Number
183hi def link gpgOption Keyword
Christian Brabandt6d912272024-02-11 18:19:45 +0100184hi def link gpgOptionDeprecated WarningMsg
Bram Moolenaarbe4e0162023-02-02 13:59:48 +0000185hi def link gpgCommand Error
Bram Moolenaar71badf92023-04-22 22:40:14 +0100186hi def link gpgArgError Error
Bram Moolenaar071d4272004-06-13 20:20:40 +0000187
188let b:current_syntax = "gpg"
189
Bram Moolenaar42eeac32005-06-29 22:40:58 +0000190let &cpo = s:cpo_save
191unlet s:cpo_save