Cfengine » История » Версия 1
Андрей Волков, 2013-02-26 16:16
1 | 1 | Андрей Волков | h1. Cfengine |
---|---|---|---|
2 | |||
3 | h3. /usr/share/vim/vimfiles/syntax/cfengine.vim |
||
4 | |||
5 | <pre> |
||
6 | " Vim syntax file |
||
7 | " Language: Cfengine version 3.3 |
||
8 | " Maintainer: Andrey Volkov <volkov@ekb-info.ru> |
||
9 | " Last Change: Tuesday February 26 2013 |
||
10 | " Location: |
||
11 | " |
||
12 | " This is my first attempt at a syntax file. Feel free to send me correctsion |
||
13 | " or improvements. I'll give you a credit. |
||
14 | " |
||
15 | " USAGE |
||
16 | " There is already a vim file that uses 'cf' as a file extention. You can use |
||
17 | " cfengine for your cfengine file extentions or identify via your vimrc file: |
||
18 | " au BufRead,BufNewFile *.cf set ft=cfengine |
||
19 | " |
||
20 | " For version 5.x: Clear all syntax items |
||
21 | " For version 6.x: Quit when a syntax file was already loaded |
||
22 | if version < 600 |
||
23 | syntax clear |
||
24 | elseif exists ("b:current_syntax") |
||
25 | finish |
||
26 | endif |
||
27 | |||
28 | syn case ignore |
||
29 | syn keyword cfengineBuiltin agent common server executor reporter monitor runagent action classes contained |
||
30 | |||
31 | syn keyword cfengineBuiltin abortbundleclasses abortclasses about_topics aces acl acl_directory_inherit contained |
||
32 | syn keyword cfengineBuiltin acl_method acl_type action_policy addclasses admit affects agent agentaccess contained |
||
33 | syn keyword cfengineBuiltin agentfacility aggregation_point allclassesreport allowallconnects contained |
||
34 | syn keyword cfengineBuiltin allow_blank_fields allowconnects allowusers alwaysvalidate args associates contained |
||
35 | syn keyword cfengineBuiltin association atime audit auditing authorize auto_scaling background contained |
||
36 | syn keyword cfengineBuiltin background_children backward_relationship before_after belongs_to contained |
||
37 | syn keyword cfengineBuiltin binarypaddingchar bindtointerface bsdflags build_directory bundlesequence contained |
||
38 | syn keyword cfengineBuiltin cancel_kept cancel_notkept cancel_repaired causes certainty cfruncommand contained |
||
39 | syn keyword cfengineBuiltin changes chdir check_foreign check_root checksum_alert_time childlibpath chroot contained |
||
40 | syn keyword cfengineBuiltin collapse_destination_dir command comment compare contain copy_backup copy_from contained |
||
41 | syn keyword cfengineBuiltin copylink_patterns copy_patterns copy_size create csv2xml ctime database_columns contained |
||
42 | syn keyword cfengineBuiltin database_operation database_rows database_server database_type data_type contained |
||
43 | syn keyword cfengineBuiltin db_server_connection_db db_server_host db_server_owner db_server_password contained |
||
44 | syn keyword cfengineBuiltin db_server_type defaultcopytype default_repository default_timeout delete contained |
||
45 | syn keyword cfengineBuiltin delete_if_contains_from_list delete_if_match_from_list contained |
||
46 | syn keyword cfengineBuiltin delete_if_not_contains_from_list delete_if_not_match_from_list contained |
||
47 | syn keyword cfengineBuiltin delete_if_not_startwith_from_list delete_if_startwith_from_list delete_select contained |
||
48 | syn keyword cfengineBuiltin deny denybadclocks denyconnects depends_on depth depth_search determines contained |
||
49 | syn keyword cfengineBuiltin dirlinks disable disable_mode disable_suffix dist document_root domain dryrun contained |
||
50 | syn keyword cfengineBuiltin dynamicaddresses edit_backup editbinaryfilesize edit_defaults edit_field contained |
||
51 | syn keyword cfengineBuiltin editfilesize edit_fstab edit_line edit_template edit_xml contained |
||
52 | syn keyword cfengineBuiltin empty_file_before_editing encrypt env_addresses env_baseline env_cpus env_disk contained |
||
53 | syn keyword cfengineBuiltin environment environment_host environment_interface environment_resources contained |
||
54 | syn keyword cfengineBuiltin environment_state environment_type env_memory env_name env_network env_spec contained |
||
55 | syn keyword cfengineBuiltin error_bars exclamation exclude_dirs exclude_hosts exec_command exec_group contained |
||
56 | syn keyword cfengineBuiltin exec_owner exec_program exec_regex exec_timeout executorfacility expand_scalars contained |
||
57 | syn keyword cfengineBuiltin expireafter export_zenoss extend_fields extraction_regex contained |
||
58 | syn keyword cfengineBuiltin failed_returncodes federation field_operation field_separator field_value contained |
||
59 | syn keyword cfengineBuiltin file_result files_auto_define file_select files_single_copy file_to_print contained |
||
60 | syn keyword cfengineBuiltin file_types findertype fips_mode first_last force_ipv4 force_update forgetrate contained |
||
61 | syn keyword cfengineBuiltin forward_relationship freespace friend_pattern generalizations generate_manual contained |
||
62 | syn keyword cfengineBuiltin goal_patterns graph_directory graph_output groups handle hash hashupdates contained |
||
63 | syn keyword cfengineBuiltin histograms history_type host_licenses_paid hostnamekeys hosts html_banner contained |
||
64 | syn keyword cfengineBuiltin html_embed html_footer hub_schedule id_prefix ifelapsed ifencrypted ifvarclass contained |
||
65 | syn keyword cfengineBuiltin ignore_missing_bundles ignore_missing_inputs include_basedir include_dirs contained |
||
66 | syn keyword cfengineBuiltin include_end_delimiter include_start_delimiter inform inputs in_range_define contained |
||
67 | syn keyword cfengineBuiltin insert_if_contains_from_list insert_if_match_from_list contained |
||
68 | syn keyword cfengineBuiltin insert_if_not_contains_from_list insert_if_not_match_from_list contained |
||
69 | syn keyword cfengineBuiltin insert_if_not_startwith_from_list insert_if_startwith_from_list insert_select contained |
||
70 | syn keyword cfengineBuiltin insert_type intermittency involves ipv4_address ipv4_netmask ipv6_address contained |
||
71 | syn keyword cfengineBuiltin is_caused_by is_connected_to is_determined_by is_followed_by is_located_in contained |
||
72 | syn keyword cfengineBuiltin is_part_of is_preceded_by issymlinkto kept_returncodes keycacheTTL knowledge contained |
||
73 | syn keyword cfengineBuiltin lastseen lastseenexpireafter leaf_name link_children linkcopy_patterns contained |
||
74 | syn keyword cfengineBuiltin link_from link_type location logallconnections logencryptedtransfers log_failed contained |
||
75 | syn keyword cfengineBuiltin log_kept log_level log_priority log_repaired log_string mailfrom mailmaxlines contained |
||
76 | syn keyword cfengineBuiltin mailto manual_source_directory maproot match_range match_value max_children contained |
||
77 | syn keyword cfengineBuiltin maxconnections max_file_size measurement_class meta mode module monitor contained |
||
78 | syn keyword cfengineBuiltin monitorfacility mount mountfilesystems mount_options mount_server mount_source contained |
||
79 | syn keyword cfengineBuiltin mount_type move_obstructions mtime needs newname nonalphanumfiles no_output contained |
||
80 | syn keyword cfengineBuiltin not_matching number_of_lines occurrences out_of_range_define contained |
||
81 | syn keyword cfengineBuiltin output_directory output_level output_prefix output_to_file owners contained |
||
82 | syn keyword cfengineBuiltin package_add_command package_architectures package_arch_regex package_changes contained |
||
83 | syn keyword cfengineBuiltin package_delete_command package_delete_convention package_file_repositories contained |
||
84 | syn keyword cfengineBuiltin package_installed_regex package_list_arch_regex package_list_command contained |
||
85 | syn keyword cfengineBuiltin package_list_name_regex package_list_update_command contained |
||
86 | syn keyword cfengineBuiltin package_list_update_ifelapsed package_list_version_regex package_method contained |
||
87 | syn keyword cfengineBuiltin package_multiline_start package_name_convention package_name_regex contained |
||
88 | syn keyword cfengineBuiltin package_noverify_regex package_noverify_returncode package_patch_arch_regex contained |
||
89 | syn keyword cfengineBuiltin package_patch_command package_patch_installed_regex package_patch_list_command contained |
||
90 | syn keyword cfengineBuiltin package_patch_name_regex package_patch_version_regex package_policy contained |
||
91 | syn keyword cfengineBuiltin package_select package_update_command package_verify_command package_version contained |
||
92 | syn keyword cfengineBuiltin package_version_regex path_name pathtype perms persistence persist_time pgid contained |
||
93 | syn keyword cfengineBuiltin pid port portnumber ppid precedents preserve preview printfile priority contained |
||
94 | syn keyword cfengineBuiltin process_count process_owner process_result process_select process_stop contained |
||
95 | syn keyword cfengineBuiltin promise_kept promise_repaired promiser_type provides purge qualifiers contained |
||
96 | syn keyword cfengineBuiltin query_engine query_output recognize_join refresh_processes contained |
||
97 | syn keyword cfengineBuiltin registry_exclude rename repair_denied repaired_returncodes repair_failed contained |
||
98 | syn keyword cfengineBuiltin repair_timeout repchar replace_value replace_with report_changes report_diffs contained |
||
99 | syn keyword cfengineBuiltin report_level report_output reports report_to_file repository representation contained |
||
100 | syn keyword cfengineBuiltin represents require_comments resource_type restart_class rlist rmdeadlinks contained |
||
101 | syn keyword cfengineBuiltin rmdirs rotate rsize rxdirs scan_arrivals schedule search_bsdflags search_groups contained |
||
102 | syn keyword cfengineBuiltin search_mode search_owners search_size secureinput select_class select_end contained |
||
103 | syn keyword cfengineBuiltin select_field select_line_matching select_line_number select_region select_start contained |
||
104 | syn keyword cfengineBuiltin sensiblecount sensible_count sensiblesize sensible_size server serverfacility contained |
||
105 | syn keyword cfengineBuiltin servers service_args service_autostart_policy service_bundle contained |
||
106 | syn keyword cfengineBuiltin service_dependence_chain service_dependencies service_method service_policy contained |
||
107 | syn keyword cfengineBuiltin service_type showstate signals site_classes skipidentify skipverify contained |
||
108 | syn keyword cfengineBuiltin smtpserver source specify_inherit_aces splaytime sql_connection_db sql_database contained |
||
109 | syn keyword cfengineBuiltin sql_owner sql_passwd sql_server sql_type start_fields_from_zero status stealth contained |
||
110 | syn keyword cfengineBuiltin stime_range stream_type style_sheet suspiciousnames synonyms syslog contained |
||
111 | syn keyword cfengineBuiltin syslog_host syslog_port tcpdump tcpdumpcommand tcp_ip threads timeout contained |
||
112 | syn keyword cfengineBuiltin timer_policy time_stamps timezone touch track_growing_file track_value contained |
||
113 | syn keyword cfengineBuiltin transformer traverse_links trustkey trustkeysfrom ttime_range tty type_check contained |
||
114 | syn keyword cfengineBuiltin umask units unmount update_hashes usebundle uses useshell value_kept contained |
||
115 | syn keyword cfengineBuiltin value_notkept value_repaired value_separator verbose verify version contained |
||
116 | syn keyword cfengineBuiltin view_projections volume vsize when_linking_children when_no_source contained |
||
117 | syn keyword cfengineBuiltin whitespace_policy xdev xorcontained |
||
118 | |||
119 | syn match cfengineBody /^\s*body [^ ]\+ / contains=cfengineBuiltin |
||
120 | syn match cfengineBundle /^\s*bundle [^ ]\+ / contains=cfengineBuiltin |
||
121 | syn keyword TODO todo contained |
||
122 | syn match cfengineComment /#.*/ contains=TODO |
||
123 | syn match cfengineSetVar /\s*[0-9a-z_]\+\s*=>/ contains=cfengineBuiltin,cfengineType,cfengineIdentifier |
||
124 | syn match cfengineIdentifier /\s=>\s/ contained |
||
125 | " For actions e.g. reports:, commands: |
||
126 | syn match cfengineAction /[^:#]\+:\s*$/ |
||
127 | syn match cfengineClass /[^:#]\+::\s*$/ |
||
128 | " Escape sequences in regexes |
||
129 | syn match cfengineEsc /\\\\[sSdD+][\+\*]*/ contained |
||
130 | " Array indexes contained in []. Does not seems to be working. |
||
131 | syn region cfengineArray start=/\[/ end=/\]/ contained contains=cfengineVar |
||
132 | " Variables wrapped in {} or () |
||
133 | syn region cfengineVar start=/[$@][(]/ end=/[)]/ contained contains=cfengineVar,cfengineArray |
||
134 | syn region cfengineString start=/\z\("\|'\)/ skip=/\\\z1/ end=/\z1/ contains=cfengineVar,cfengineArray,cfengineEsc |
||
135 | syn keyword cfengineType int ilist slist float not and or xor string expression real rlist policy |
||
136 | syn keyword cfengineOnOff on off yes no true false |
||
137 | |||
138 | if version >= 508 || !exists("did_cfg_syn_inits") |
||
139 | if version < 508 |
||
140 | let did_cfg_syn_inits = 1 |
||
141 | command -nargs=+ HiLink hi link <args> |
||
142 | else |
||
143 | command -nargs=+ HiLink hi def link <args> |
||
144 | endif |
||
145 | HiLink cfengineBody Function |
||
146 | HiLink cfengineBundle Function |
||
147 | HiLink cfengineBuiltin Keyword |
||
148 | HiLink cfengineComment Comment |
||
149 | HiLink cfengineIdentifier Identifier |
||
150 | HiLink cfengineAction Underlined |
||
151 | HiLink cfengineClass Statement |
||
152 | HiLink cfengineEsc Special |
||
153 | HiLink cfengineArray Special |
||
154 | HiLink cfengineVar Special |
||
155 | HiLink cfengineString String |
||
156 | HiLink cfengineType Type |
||
157 | HiLink cfengineOnOff Boolean |
||
158 | |||
159 | delcommand HiLink |
||
160 | endif |
||
161 | let b:current_syntax = "cfengine" |
||
162 | |||
163 | " CREDITS |
||
164 | " Andrey Volkov <volkov@ekb-info.ru> |
||
165 | " Neil Watson <neil@watson-wilson.ca> |
||
166 | " Aleksey Tsalolikhin |
||
167 | " John Coleman of Yale U |
||
168 | " Matt Lesko |
||
169 | </pre> |
||
170 | |||
171 | h3. /usr/share/vim/vimfiles/ftdetect/cfengine.vim |
||
172 | |||
173 | <pre> |
||
174 | au BufNewFile,BufRead /*var/cfengine/inputs/* set filetype=cfengine |
||
175 | au BufNewFile,BufRead /*var/cfengine/masterfiles/* set filetype=cfengine |
||
176 | </pre> |