Skip to content

Commit 1ecffb5

Browse files
author
Neil Watson
committed
Updated syntax hightlighting and tools.
1 parent 3d0be6d commit 1ecffb5

File tree

5 files changed

+61
-65
lines changed

5 files changed

+61
-65
lines changed

README

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
VIM files to support Cfengine 3 policy editing.
22

3-
Changes:
4-
5-
Friday May 04 2012
6-
Added basic folding.
7-
Improved insert abbreviations.
8-
93
vim_cf3 files (https://github.com/neilhwatson/vim_cf3)
104
Copyright (C) 2011 Neil H. Watson <neil@watson-wilson.ca>
115

syntax/cf3.vim

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -77,75 +77,75 @@ syn keyword cf3Type string int real slist ilist rlist
7777
" The following list may be automatically generated using
7878
" tools/extract_cf3BuiltIns.sh in CFEngine source code directory.
7979

80-
syn keyword cf3BuiltIns accessedbefore accumulated ago and canonify contained
81-
syn keyword cf3BuiltIns changedbefore classesmatching classify classmatch concat countclassesmatching contained
82-
syn keyword cf3BuiltIns countlinesmatching difference dirname diskfree escape every contained
83-
syn keyword cf3BuiltIns execresult fileexists filesexist filesize filestat filter contained
84-
syn keyword cf3BuiltIns format getenv getfields getgid getindices getuid contained
85-
syn keyword cf3BuiltIns getusers getvalues grep groupexists hash hashmatch contained
86-
syn keyword cf3BuiltIns host2ip hostinnetgroup hostrange hostsseen hostswithclass hubknowledge contained
87-
syn keyword cf3BuiltIns ifelse innetgroup intersection ip2host iprange irange contained
88-
syn keyword cf3BuiltIns isdir isexecutable isgreaterthan islessthan islink isnewerthan contained
89-
syn keyword cf3BuiltIns isplain isvariable join lastnode laterthan ldaparray contained
90-
syn keyword cf3BuiltIns ldaplist ldapvalue length lsdir maparray maplist contained
91-
syn keyword cf3BuiltIns none not now nth on or contained
92-
syn keyword cf3BuiltIns parseintarray parserealarray parsestringarray parsestringarrayidx peerleader peerleaders contained
93-
syn keyword cf3BuiltIns peers product randomint readfile readintarray readintlist contained
94-
syn keyword cf3BuiltIns readrealarray readreallist readstringarray readstringarrayidx readstringlist readtcp contained
95-
syn keyword cf3BuiltIns regarray regcmp regextract registryvalue regldap regline contained
96-
syn keyword cf3BuiltIns reglist remoteclassesmatching remotescalar returnszero rrange selectservers contained
97-
syn keyword cf3BuiltIns some splayclass splitstring strcmp strftime sublist contained
98-
syn keyword cf3BuiltIns sum translatepath uniq usemodule userexists contained
80+
syn keyword cf3BuiltIns accessedbefore accumulated ago and canonify contained
81+
syn keyword cf3BuiltIns changedbefore classesmatching classify classmatch concat countclassesmatching contained
82+
syn keyword cf3BuiltIns countlinesmatching difference dirname diskfree escape every contained
83+
syn keyword cf3BuiltIns execresult fileexists filesexist filesize filestat filter contained
84+
syn keyword cf3BuiltIns format getenv getfields getgid getindices getuid contained
85+
syn keyword cf3BuiltIns getusers getvalues grep groupexists hash hashmatch contained
86+
syn keyword cf3BuiltIns host2ip hostinnetgroup hostrange hostsseen hostswithclass hubknowledge contained
87+
syn keyword cf3BuiltIns ifelse intersection ip2host iprange irange isdir contained
88+
syn keyword cf3BuiltIns isexecutable isgreaterthan islessthan islink isnewerthan isplain contained
89+
syn keyword cf3BuiltIns isvariable join lastnode laterthan ldaparray ldaplist contained
90+
syn keyword cf3BuiltIns ldapvalue length lsdir maparray maplist none contained
91+
syn keyword cf3BuiltIns not now nth on or parseintrealstringarray contained
92+
syn keyword cf3BuiltIns parsestringarrayidx peerleader peerleaders peers product randomint contained
93+
syn keyword cf3BuiltIns readfile readintrealstringarray readintrealstringlist readstringarrayidx readtcp regarray contained
94+
syn keyword cf3BuiltIns regcmp regextract registryvalue regldap regline reglist contained
95+
syn keyword cf3BuiltIns remoteclassesmatching remotescalar returnszero rrange selectservers shuffle contained
96+
syn keyword cf3BuiltIns some sort splayclass splitstring strcmp strftime contained
97+
syn keyword cf3BuiltIns sublist sum translatepath unique usemodule userexists contained
9998

10099
" evolve_freelib.cf -rw-r--r-- 1 ivan staff 59012 Jun 27 18:05
101100
" https://github.com/evolvethinking/evolve_cfengine_freelib
102101

103102
" The following list may be automatically generated using
104103
" tools/extract_cf3evolve_freelib.sh in CFEngine source code directory.
105104
"
106-
syn keyword cf3Evolve_freelib contain_efl_command efl_bug2638 efl_c efl_chkconfig_disable_service efl_chkconfig_enable_service contained
107-
syn keyword cf3Evolve_freelib efl_class_classmatch efl_class_cmd_regcmp efl_class_hostname efl_class_iprange efl_command efl_copy_files contained
108-
syn keyword cf3Evolve_freelib efl_cpf efl_delete_files efl_edit_template efl_file_perms efl_global_strings efl_lastseen contained
109-
syn keyword cf3Evolve_freelib efl_link efl_main efl_mon_cfengine efl_notseen efl_packages efl_service contained
110-
syn keyword cf3Evolve_freelib efl_skeleton efl_source_type efl_start_service efl_sysctl_conf_file efl_sysctl_live el_efl_sysctl_conf_file contained
111-
syn keyword cf3Evolve_freelib elf_bug1780 name_age_negate negate_by_name contained
105+
106+
syn keyword cf3Evolve_freelib by_command contain_efl_command efl_bug2638 efl_c efl_chkconfig_disable_service contained
107+
syn keyword cf3Evolve_freelib efl_chkconfig_enable_service efl_class_classmatch efl_class_cmd_regcmp efl_class_hostname efl_class_iprange efl_command contained
108+
syn keyword cf3Evolve_freelib efl_copy_files efl_cpf efl_delete_files efl_edit_template efl_file_perms efl_global_strings contained
109+
syn keyword cf3Evolve_freelib efl_lastseen efl_link efl_main efl_mon_cfengine efl_notseen efl_packages contained
110+
syn keyword cf3Evolve_freelib efl_rkn efl_service efl_skeleton efl_source_type efl_start_service efl_sysctl_conf_file contained
111+
syn keyword cf3Evolve_freelib efl_sysctl_live efl_ulog el_efl_sysctl_conf_file elf_bug1780 name_age_negate negate_by_name contained
112112

113113
" Stdlib: -rw-r--r-- 1 ivan staff 59012 Jun 27 18:05
114114
" /Users/ivan/Downloads/cfengine_stdlib.cf
115115

116116
" The following list may be automatically generated using
117117
" tools/extract_cf3Stdlib.sh in CFEngine source code directory.
118118

119-
syn keyword cf3Stdlib INI_section access_generic after all all_changes contained
120-
syn keyword cf3Stdlib alpinelinux always any_count append_groups_starting append_if_no_line append_if_no_lines contained
121-
syn keyword cf3Stdlib append_to_line_end append_user_field append_users_starting apt apt_get apt_get_release contained
122-
syn keyword cf3Stdlib backup_local_cp backup_timestamp before bg bootstart by_name contained
123-
syn keyword cf3Stdlib cf2_if_else check_range classes_generic cmd_repair col comment contained
124-
syn keyword cf3Stdlib comment_lines_containing comment_lines_matching create_solaris_admin_file cronjob days_old days_older_than contained
125-
syn keyword cf3Stdlib debian_knowledge delete_lines_matching detect_all_change detect_all_change_using detect_content detect_content_using contained
126-
syn keyword cf3Stdlib diff diff_noupdate dirs disable dpkg_version emerge contained
127-
syn keyword cf3Stdlib empty enumerate ex_list exclude exclude_procs expand_template contained
128-
syn keyword cf3Stdlib fileinfo filetype_older_than filetypes_older_than force_deps freebsd generic contained
129-
syn keyword cf3Stdlib if_elapsed if_elapsed_day if_else if_notkept if_ok if_ok_cancel contained
130-
syn keyword cf3Stdlib if_repaired ifwin_bg immediate in_dir in_dir_shell in_dir_shell_and_silent contained
131-
syn keyword cf3Stdlib in_shell in_shell_and_silent in_shell_bg include_base insert_file insert_lines contained
132-
syn keyword cf3Stdlib ips jail kvm line line_match_value linkchildren contained
133-
syn keyword cf3Stdlib ln_s local_cp local_dcp local_mysql local_postgresql log_repaired contained
134-
syn keyword cf3Stdlib log_verbose m maintain_key_values manage_variable_values_ini measure_performance min_free_space contained
135-
syn keyword cf3Stdlib mo mog msi_explicit msi_implicit name_age nfs contained
136-
syn keyword cf3Stdlib nfs_p no_backup no_backup_cp no_backup_dcp no_backup_rcp noupdate contained
137-
syn keyword cf3Stdlib ntfs og older_than opencsw owner pacman contained
138-
syn keyword cf3Stdlib paths perms_cp plain policy quoted_var recurse contained
139-
syn keyword cf3Stdlib recurse_ignore recurse_with_base regex_replace remote_cp remote_dcp replace_line_end contained
140-
syn keyword cf3Stdlib replace_or_add resolvconf rm_rf rotate rpm_filebased rpm_version contained
141-
syn keyword cf3Stdlib sample_rate scan_changing_file scan_log scoped_classes_generic secure_cp seed_cp contained
142-
syn keyword cf3Stdlib set_colon_field set_config_values set_config_values_matching set_quoted_values set_user_field set_variable_values contained
143-
syn keyword cf3Stdlib set_variable_values_ini setuid setuid_sh setuid_umask setuidgid_sh silent contained
144-
syn keyword cf3Stdlib silent_in_dir single_value size_range smartos solaris standard_services contained
145-
syn keyword cf3Stdlib start state_repaired std_defs strict sync_cp tidy contained
146-
syn keyword cf3Stdlib to uncomment uncomment_lines_containing uncomment_lines_matching unmount value contained
147-
syn keyword cf3Stdlib warn_lines_matching warn_only windows_feature yum yum_group yum_rpm contained
148-
syn keyword cf3Stdlib yum_rpm_enable_repo zypper contained
119+
syn keyword cf3Stdlib INI_section access_generic after all all_changes contained
120+
syn keyword cf3Stdlib alpinelinux always any_count append_groups_starting append_if_no_line append_if_no_lines contained
121+
syn keyword cf3Stdlib append_to_line_end append_user_field append_users_starting apt apt_get apt_get_release contained
122+
syn keyword cf3Stdlib backup_local_cp backup_timestamp before bg bootstart by_name contained
123+
syn keyword cf3Stdlib cf2_if_else check_range classes_generic cmd_repair col comment contained
124+
syn keyword cf3Stdlib comment_lines_containing comment_lines_matching create_solaris_admin_file cronjob days_old days_older_than contained
125+
syn keyword cf3Stdlib debian_knowledge delete_lines_matching detect_all_change detect_all_change_using detect_content detect_content_using contained
126+
syn keyword cf3Stdlib diff diff_noupdate dirs disable dpkg_version emerge contained
127+
syn keyword cf3Stdlib empty enumerate ex_list exclude exclude_procs expand_template contained
128+
syn keyword cf3Stdlib fileinfo filetype_older_than filetypes_older_than force_deps freebsd freebsd_portmaster contained
129+
syn keyword cf3Stdlib generic if_elapsed if_elapsed_day if_else if_notkept if_ok contained
130+
syn keyword cf3Stdlib if_ok_cancel if_repaired ifwin_bg immediate in_dir in_dir_shell contained
131+
syn keyword cf3Stdlib in_dir_shell_and_silent in_shell in_shell_and_silent in_shell_bg include_base insert_file contained
132+
syn keyword cf3Stdlib insert_lines ips jail kvm line line_match_value contained
133+
syn keyword cf3Stdlib linkchildren ln_s local_cp local_dcp local_mysql local_postgresql contained
134+
syn keyword cf3Stdlib log_repaired log_verbose m maintain_key_values manage_variable_values_ini measure_performance contained
135+
syn keyword cf3Stdlib min_free_space mo mog msi_explicit msi_implicit name_age contained
136+
syn keyword cf3Stdlib nfs nfs_p no_backup no_backup_cp no_backup_dcp no_backup_rcp contained
137+
syn keyword cf3Stdlib noupdate ntfs og older_than opencsw owner contained
138+
syn keyword cf3Stdlib pacman paths perms_cp plain policy quoted_var contained
139+
syn keyword cf3Stdlib recurse recurse_ignore recurse_with_base regex_replace remote_cp remote_dcp contained
140+
syn keyword cf3Stdlib replace_line_end replace_or_add resolvconf rm_rf rotate rpm_filebased contained
141+
syn keyword cf3Stdlib rpm_version sample_rate scan_changing_file scan_log scoped_classes_generic secure_cp contained
142+
syn keyword cf3Stdlib seed_cp set_colon_field set_config_values set_config_values_matching set_quoted_values set_user_field contained
143+
syn keyword cf3Stdlib set_variable_values set_variable_values_ini setuid setuid_sh setuid_umask setuidgid_sh contained
144+
syn keyword cf3Stdlib silent silent_in_dir single_value size_range smartos solaris contained
145+
syn keyword cf3Stdlib standard_services start state_repaired std_defs strict sync_cp contained
146+
syn keyword cf3Stdlib tidy to uncomment uncomment_lines_containing uncomment_lines_matching unmount contained
147+
syn keyword cf3Stdlib value warn_lines_matching warn_only windows_feature yum yum_group contained
148+
syn keyword cf3Stdlib yum_rpm yum_rpm_enable_repo zypper contained
149149

150150
"syn match cf3Function /\w\+[,;(\>]/ contains=cf3BuiltIns,cf3Stdlib
151151
syn match cf3Function /\<\w\+[,;()]/ contains=cf3BuiltIns,cf3Stdlib,cf3Evolve_freelib

tools/extract_cf3BuiltIns.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# cd cfengine-3.4.2
77
# ~/path/to/tools/extract_cf3BuiltIns.sh
88

9-
find docs/reference/functions -type f -name '*_notes.texinfo' -printf "%f "|\
10-
sed -e 's/_notes.texinfo//g'|\
9+
find $1 -type f -name '*.markdown' -printf "%f "|\
10+
sed -e 's/.markdown//g'|\
1111
awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 == 0) printf "MARK";printf "%s ", tab[i]}} END{print "contained"}'|\
1212
sed 's/MARK/contained\nsyn keyword cf3BuiltIns\t/g'|tail -n +2

tools/extract_cf3Stdlib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# cd cfengine-3.4.2
77
# ~/path/to/tools/extract_cf3Stdlib.sh
88

9-
awk '/^(bundle|body)/ {gsub(/\(.+/, "", $3);printf " %s", $3}' masterfiles/libraries/cfengine_stdlib.cf |\
9+
stdlib_files="$1"
10+
cat $stdlib_files | awk '/^(bundle|body)/ {gsub(/\(.+/, "", $3);printf " %s", $3}' |\
1011
sort|awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 ==0) printf "MARK";printf "%s ", tab[i]}} END{ print "contained"}'|\
1112
sed 's/MARK/contained\nsyn keyword cf3Stdlib\t/g'|tail -n +2

tools/extract_cf3evolve_freelib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#
66
# ~/path/to/tools/extract_cf3evolve_freelib.sh
77

8-
awk '/^(bundle|body)/ {gsub(/\(.*/, "", $3);printf " %s", $3}' evolve_freelib.cf |\
8+
efl=$1
9+
awk '/^(bundle|body)/ {gsub(/\(.*/, "", $3);printf " %s", $3}' $efl |\
910
sort|awk '{count=split($0, tab); asort(tab);for (i=0;i<=count;i++) { if (i % 6 ==0) printf "MARK";printf "%s ", tab[i]}} END{ print "contained"}'|\
1011
sed 's/MARK/contained\nsyn keyword cf3Evolve_freelib\t/g'|tail -n +2

0 commit comments

Comments
 (0)