annotate runtime/syntax/gpg.vim @ 31996:ca6bc7c04163 v9.0.1330

patch 9.0.1330: handling new value of an option has a long "else if" chain Commit: https://github.com/vim/vim/commit/af93691b53f38784efce0b93fe7644c44a7e382e Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Mon Feb 20 12:16:39 2023 +0000 patch 9.0.1330: handling new value of an option has a long "else if" chain Problem: Handling new value of an option has a long "else if" chain. Solution: Use a function pointer. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/12015)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Feb 2023 13:30:05 +0100
parents cc751d944b7e
children b2e8663e6dcc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
2 " Language: gpg(1) configuration file
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
3 " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
4 " Latest Revision: 2010-10-14
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
5 " Updated: 2023-01-23 @ObserverOfTime: added a couple of keywords
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
7 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
11 let s:cpo_save = &cpo
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
12 set cpo&vim
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
13
1620
73fe8baea242 updated for version 7.2a
vimboss
parents: 1200
diff changeset
14 setlocal iskeyword+=-
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
15
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
16 syn keyword gpgTodo contained FIXME TODO XXX NOTE
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
17
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
18 syn region gpgComment contained display oneline start='#' end='$'
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
19 \ contains=gpgTodo,gpgID,@Spell
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
20
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
21 syn match gpgID contained display '\<\(0x\)\=\x\{8,}\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
22
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
23 syn match gpgBegin display '^' skipwhite nextgroup=gpgComment,gpgOption,gpgCommand
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
25 syn keyword gpgCommand contained skipwhite nextgroup=gpgArg
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
26 \ check-sigs decrypt decrypt-files delete-key
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
27 \ delete-secret-and-public-key delete-secret-key
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
28 \ edit-key encrypt-files export export-all
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
29 \ export-ownertrust export-secret-keys
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
30 \ export-secret-subkeys fast-import fingerprint
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
31 \ gen-prime gen-random import import-ownertrust
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
32 \ list-keys list-public-keys list-secret-keys
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
33 \ list-sigs lsign-key nrsign-key print-md print-mds
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
34 \ recv-keys search-keys send-keys sign-key verify
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
35 \ verify-files
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
36 syn keyword gpgCommand contained skipwhite nextgroup=gpgArgError
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
37 \ check-trustdb clearsign desig-revoke detach-sign
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
38 \ encrypt gen-key gen-revoke help list-packets
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
39 \ rebuild-keydb-caches sign store symmetric
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
40 \ update-trustdb version warranty
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
42 syn keyword gpgOption contained skipwhite nextgroup=gpgArg
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
43 \ attribute-fd cert-digest-algo charset cipher-algo
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
44 \ command-fd comment completes-needed compress
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
45 \ compress-algo debug default-cert-check-level
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
46 \ default-key default-preference-list
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
47 \ default-recipient digest-algo disable-cipher-algo
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
48 \ disable-pubkey-algo encrypt-to exec-path
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
49 \ export-options group homedir import-options
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
50 \ keyring keyserver keyserver-options load-extension
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
51 \ local-user logger-fd marginals-needed max-cert-depth
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
52 \ notation-data options output override-session-key
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
53 \ passphrase-fd personal-cipher-preferences
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
54 \ personal-compress-preferences
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
55 \ personal-digest-preferences photo-viewer
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
56 \ recipient s2k-cipher-algo s2k-digest-algo s2k-mode
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
57 \ secret-keyring set-filename set-policy-url status-fd
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
58 \ trusted-key verify-options keyid-format list-options
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
59 \ default-new-key-algo weak-digest
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
60 syn keyword gpgOption contained skipwhite nextgroup=gpgArgError
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
61 \ allow-freeform-uid allow-non-selfsigned-uid
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
62 \ allow-secret-key-import always-trust
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
63 \ armor ask-cert-expire ask-sig-expire
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
64 \ auto-check-trustdb batch debug-all default-comment
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
65 \ default-recipient-self dry-run emit-version
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
66 \ emulate-md-encode-bug enable-special-filenames
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
67 \ escape-from-lines expert fast-list-mode
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
68 \ fixed-list-mode for-your-eyes-only
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
69 \ force-mdc force-v3-sigs force-v4-certs
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
70 \ gpg-agent-info ignore-crc-error ignore-mdc-error
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
71 \ ignore-time-conflict ignore-valid-from interactive
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
72 \ list-only lock-multiple lock-never lock-once
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
73 \ merge-only no no-allow-non-selfsigned-uid
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
74 \ no-armor no-ask-cert-expire no-ask-sig-expire
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
75 \ no-auto-check-trustdb no-batch no-comment
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
76 \ no-default-keyring no-default-recipient
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
77 \ no-encrypt-to no-expensive-trust-checks
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
78 \ no-expert no-for-your-eyes-only no-force-v3-sigs
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
79 \ no-force-v4-certs no-greeting no-literal
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
80 \ no-mdc-warning no-options no-permission-warning
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
81 \ no-pgp2 no-pgp6 no-pgp7 no-random-seed-file
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
82 \ no-secmem-warning no-show-notation no-show-photos
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
83 \ no-show-policy-url no-sig-cache no-sig-create-check
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
84 \ no-sk-comments no-tty no-utf8-strings no-verbose
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
85 \ no-version not-dash-escaped openpgp pgp2
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
86 \ pgp6 pgp7 preserve-permissions quiet rfc1991
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
87 \ set-filesize show-keyring show-notation show-photos
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
88 \ show-policy-url show-session-key simple-sk-checksum
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
89 \ sk-comments skip-verify textmode throw-keyid
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
90 \ try-all-secrets use-agent use-embedded-filename
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
91 \ utf8-strings verbose with-colons with-fingerprint
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
92 \ with-key-data yes
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
94 syn match gpgArg contained display '\S\+\(\s\+\S\+\)*' contains=gpgID
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
95 syn match gpgArgError contained display '\S\+\(\s\+\S\+\)*'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96
31885
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
97 hi def link gpgComment Comment
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
98 hi def link gpgTodo Todo
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
99 hi def link gpgID Number
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
100 hi def link gpgOption Keyword
cc751d944b7e Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
101 hi def link gpgCommand Error
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
102 hi def link gpgArgError Error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 let b:current_syntax = "gpg"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
375
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
106 let &cpo = s:cpo_save
f14cbd913415 updated for version 7.0097
vimboss
parents: 7
diff changeset
107 unlet s:cpo_save