diff options
author | 2007-04-03 19:34:49 +0000 | |
---|---|---|
committer | 2007-04-03 19:34:49 +0000 | |
commit | 51168ffc2dc12f15bc7d35d1b1272f47753001e6 (patch) | |
tree | d161d97768080e48585402cdfd67d5f58602b6b2 | |
parent | fa84d868b4ddf6aa8ca536a83c587e2c2656473e (diff) | |
download | paludis-51168ffc2dc12f15bc7d35d1b1272f47753001e6.tar.gz paludis-51168ffc2dc12f15bc7d35d1b1272f47753001e6.tar.xz |
Vim syntax scripts
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 24 | ||||
-rw-r--r-- | vim/Makefile.am | 7 | ||||
-rw-r--r-- | vim/ftdetect/Makefile.am | 17 | ||||
-rw-r--r-- | vim/syntax/Makefile.am | 25 | ||||
-rw-r--r-- | vim/syntax/paludis-environment-conf.vim | 53 | ||||
-rw-r--r-- | vim/syntax/paludis-keywords-conf.vim | 36 | ||||
-rw-r--r-- | vim/syntax/paludis-licenses-conf.vim | 37 | ||||
-rw-r--r-- | vim/syntax/paludis-mirrors-conf.vim | 37 | ||||
-rw-r--r-- | vim/syntax/paludis-package-mask-conf.vim | 30 | ||||
-rw-r--r-- | vim/syntax/paludis-repositories-conf.vim | 57 | ||||
-rw-r--r-- | vim/syntax/paludis-use-conf.vim | 40 |
12 files changed, 364 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index ed74a1567..be34792bc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ MAINTAINERCLEANFILES = Makefile.in configure config/* aclocal.m4 \ config.h config.h.in INSTALL COPYING AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip std-options EXTRA_DIST = autogen.bash automake-deps-dist-hack.tmp -SUBDIRS = misc tr1 test paludis ruby src doc hooks eselect bash-completion zsh-completion +SUBDIRS = misc tr1 test paludis ruby src doc hooks eselect vim bash-completion zsh-completion DISTCHECK_CONFIGURE_FLAGS = --enable-qa --enable-ruby --enable-glsa \ --with-ruby-install-dir='$${DESTDIR}$${prefix}/ruby_dir' \ diff --git a/configure.ac b/configure.ac index 3e12451c7..6d56c1cf0 100644 --- a/configure.ac +++ b/configure.ac @@ -683,6 +683,27 @@ fi AM_CONDITIONAL([ENABLE_RUBY], test "x$enable_ruby" = "xyes") dnl }}} +dnl {{{ vim +AC_ARG_ENABLE([vim], + AS_HELP_STRING([--enable-vim], [Enable Vim extras]), + [HAVE_VIM=$enableval + AC_MSG_RESULT([$enableval])], + [AC_MSG_RESULT([no]) + HAVE_VIM=no]) +VIM_INSTALL_DIR= +if test x$HAVE_VIM = xyes ; then + AC_MSG_CHECKING([for Vim installation dir]) + AC_ARG_WITH([vim-install-dir], + AS_HELP_STRING([--with-vim-install-dir=dir], [Specify Vim installation dir]), + VIM_INSTALL_DIR=`eval echo $withval`, + VIM_INSTALL_DIR=`eval echo $datadir/vim/vimfiles`) + AC_MSG_RESULT([$VIM_INSTALL_DIR]) +fi +AC_SUBST([HAVE_VIM]) +AM_CONDITIONAL([HAVE_VIM], test "x$HAVE_VIM" = "xyes") +AC_SUBST([VIM_INSTALL_DIR]) +dnl }}} + dnl {{{ repositories ALL_REPOSITORIES="cran fake gentoo gems virtuals" DEFAULT_REPOSITORIES="fake gentoo virtuals" @@ -937,6 +958,9 @@ AC_OUTPUT( src/clients/adjutrix/Makefile test/Makefile tr1/Makefile + vim/Makefile + vim/ftdetect/Makefile + vim/syntax/Makefile zsh-completion/Makefile ) dnl }}} diff --git a/vim/Makefile.am b/vim/Makefile.am new file mode 100644 index 000000000..e029e5f6c --- /dev/null +++ b/vim/Makefile.am @@ -0,0 +1,7 @@ +MAINTAINERCLEANFILES = Makefile.in +CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda .keep +SUBDIRS = ftdetect syntax + +built-sources : $(BUILT_SOURCES) + for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done + diff --git a/vim/ftdetect/Makefile.am b/vim/ftdetect/Makefile.am new file mode 100644 index 000000000..bec81aa66 --- /dev/null +++ b/vim/ftdetect/Makefile.am @@ -0,0 +1,17 @@ +MAINTAINERCLEANFILES = Makefile.in +CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda .keep +SUBDIRS = + +if HAVE_VIM + +vimftdetectdir = $(VIM_INSTALL_DIR)/ftdetect/ + +vimftdetect_DATA = \ + paludis.vim + +endif + +built-sources : $(BUILT_SOURCES) + for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done + + diff --git a/vim/syntax/Makefile.am b/vim/syntax/Makefile.am new file mode 100644 index 000000000..2b1e1ff0f --- /dev/null +++ b/vim/syntax/Makefile.am @@ -0,0 +1,25 @@ +MAINTAINERCLEANFILES = Makefile.in +CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda .keep +SUBDIRS = + +if HAVE_VIM + +vimsyntaxdir = $(VIM_INSTALL_DIR)/syntax/ + +vimsyntax_DATA = \ + paludis-environment-conf.vim \ + paludis-keywords-conf.vim \ + paludis-licenses-conf.vim \ + paludis-mirrors-conf.vim \ + paludis-package-mask-conf.vim \ + paludis-repositories-conf.vim \ + paludis-use-conf.vim + +endif + +EXTRA_DIST = $(vimsyntax_DATA) + +built-sources : $(BUILT_SOURCES) + for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done + + diff --git a/vim/syntax/paludis-environment-conf.vim b/vim/syntax/paludis-environment-conf.vim new file mode 100644 index 000000000..0dd745264 --- /dev/null +++ b/vim/syntax/paludis-environment-conf.vim @@ -0,0 +1,53 @@ +" Vim syntax file +" Language: Paludis environment.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis environment.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisEnvironmentConfComment start=/^\s*#/ end=/$/ + +syn region PaludisEnvironmentConfKey start=/^\(\s*[^#]\)\@=/ end=/=\@=/ + \ contains=PaludisEnvironmentConfKnownKey + +syn match PaludisEnvironmentConfEquals /=/ skipwhite + \ nextgroup=PaludisEnvironmentConfValue + +syn region PaludisEnvironmentConfValue contained start=// end=/$/ + \ contains=PaludisEnvironmentConfString,PaludisEnvironmentConfUnquoted, + \ PaludisEnvironmentConfContinuation,PaludisEnvironmentConfVariable + \ skipwhite + +syn match PaludisEnvironmentConfContinuation contained /\\$/ + \ skipnl + +syn match PaludisEnvironmentConfUnquoted contained /[^ \t$"'\\]\+/ skipwhite + +syn region PaludisEnvironmentConfString contained start=/"/ end=/"/ + \ contains=PaludisEnvironmentConfVariable + \ skipwhite + +syn keyword PaludisEnvironmentConfKnownKey contained + \ reduced_username portage_compatible + +syn match PaludisEnvironmentConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite + +hi def link PaludisEnvironmentConfKnownKey Keyword +hi def link PaludisEnvironmentConfString String +hi def link PaludisEnvironmentConfUnquoted Constant +hi def link PaludisEnvironmentConfVariable Identifier +hi def link PaludisEnvironmentConfContinuation Preproc +hi def link PaludisEnvironmentConfComment Comment + +let b:current_syntax = "paludis-environment-conf" + diff --git a/vim/syntax/paludis-keywords-conf.vim b/vim/syntax/paludis-keywords-conf.vim new file mode 100644 index 000000000..d22e23dac --- /dev/null +++ b/vim/syntax/paludis-keywords-conf.vim @@ -0,0 +1,36 @@ +" Vim syntax file +" Language: Paludis keywords.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis keywords.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisKeywordsConfComment start=/^\s*#/ end=/$/ + +syn match PaludisKeywordsConfPDS /^[^ \t#\/]\+\/[^ \t#\/]\+\s*/ + \ nextgroup=PaludisKeywordsConfKeyword,PaludisKeywordsConfContinuation +syn match PaludisKeywordsConfSet /^[^ \t#\/]\+\S\@!/ + \ nextgroup=PaludisKeywordsConfKeyword,PaludisKeywordsConfContinuation skipwhite +syn match PaludisKeywordsConfKeyword contained /-\?\~\?[a-zA-Z0-9\-_*]\+/ + \ nextgroup=PaludisKeywordsConfKeyword,PaludisKeywordsConfContinuation skipwhite +syn match PaludisKeywordsConfContinuation contained /\\$/ + \ nextgroup=PaludisKeywordsConfKeyword,PaludisKeywordsConfContinuation skipwhite skipnl + +hi def link PaludisKeywordsConfComment Comment +hi def link PaludisKeywordsConfPDS Identifier +hi def link PaludisKeywordsConfSet Special +hi def link PaludisKeywordsConfKeyword Keyword +hi def link PaludisKeywordsConfContinuation Preproc + +let b:current_syntax = "paludis-keywords-conf" + diff --git a/vim/syntax/paludis-licenses-conf.vim b/vim/syntax/paludis-licenses-conf.vim new file mode 100644 index 000000000..496d24979 --- /dev/null +++ b/vim/syntax/paludis-licenses-conf.vim @@ -0,0 +1,37 @@ +" Vim syntax file +" Language: Paludis licenses.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis licenses.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisLicensesConfComment start=/^\s*#/ end=/$/ + +syn match PaludisLicensesConfPDS /^[^ \t#\/]\+\/[^ \t#\/]\+\s*/ + \ nextgroup=PaludisLicensesConfLicense,PaludisLicensesConfContinuation +syn match PaludisLicensesConfSet /^[^ \t#\/]\+\S\@!/ + \ nextgroup=PaludisLicensesConfLicense,PaludisLicensesConfContinuation skipwhite +syn match PaludisLicensesConfLicense contained /-\?[a-zA-Z0-9\-_*]\+/ + \ nextgroup=PaludisLicensesConfLicense,PaludisLicensesConfContinuation skipwhite +syn match PaludisLicensesConfContinuation contained /\\$/ + \ nextgroup=PaludisLicensesConfLicense,PaludisLicensesConfContinuation skipwhite skipnl + +hi def link PaludisLicensesConfComment Comment +hi def link PaludisLicensesConfPDS Identifier +hi def link PaludisLicensesConfSet Special +hi def link PaludisLicensesConfLicense Keyword +hi def link PaludisLicensesConfContinuation Preproc + +let b:current_syntax = "paludis-licenses-conf" + + diff --git a/vim/syntax/paludis-mirrors-conf.vim b/vim/syntax/paludis-mirrors-conf.vim new file mode 100644 index 000000000..fc6c36aa3 --- /dev/null +++ b/vim/syntax/paludis-mirrors-conf.vim @@ -0,0 +1,37 @@ +" Vim syntax file +" Language: Paludis mirrors.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis mirrors.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisMirrorsConfComment start=/^\s*#/ end=/$/ + +syn match PaludisMirrorsConfName /^[a-zA-Z0-9\-_+]\+\S\@!/ + \ nextgroup=PaludisMirrorsConfURI,PaludisMirrorsConfContinuation skipwhite +syn match PaludisMirrorsConfSet /^[*]\S\@!/ + \ nextgroup=PaludisMirrorsConfURI,PaludisMirrorsConfContinuation skipwhite +syn match PaludisMirrorsConfURI contained /[a-zA-Z0-9\-_+]\+:\S\+/ + \ nextgroup=PaludisMirrorsConfURI,PaludisMirrorsConfContinuation skipwhite +syn match PaludisMirrorsConfContinuation contained /\\$/ + \ nextgroup=PaludisMirrorsConfURI,PaludisMirrorsConfContinuation skipwhite skipnl + +hi def link PaludisMirrorsConfComment Comment +hi def link PaludisMirrorsConfName Identifier +hi def link PaludisMirrorsConfSet Special +hi def link PaludisMirrorsConfURI Keyword +hi def link PaludisMirrorsConfContinuation Preproc + +let b:current_syntax = "paludis-mirrors-conf" + + diff --git a/vim/syntax/paludis-package-mask-conf.vim b/vim/syntax/paludis-package-mask-conf.vim new file mode 100644 index 000000000..7f86a880f --- /dev/null +++ b/vim/syntax/paludis-package-mask-conf.vim @@ -0,0 +1,30 @@ +" Vim syntax file +" Language: Paludis package_{un,}mask.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis package_{un,}mask.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisPackageMaskConfComment start=/^\s*#/ end=/$/ + +syn match PaludisPackageMaskConfPDS /^[^ \t#\/]\+\/[^ \t#\/]\+\s*/ +syn match PaludisPackageMaskConfSet /^[^ \t#\/]\+\S\@!/ + +hi def link PaludisPackageMaskConfComment Comment +hi def link PaludisPackageMaskConfPDS Identifier +hi def link PaludisPackageMaskConfSet Special + +let b:current_syntax = "paludis-package-mask-conf" + + + diff --git a/vim/syntax/paludis-repositories-conf.vim b/vim/syntax/paludis-repositories-conf.vim new file mode 100644 index 000000000..3e0ba5f5e --- /dev/null +++ b/vim/syntax/paludis-repositories-conf.vim @@ -0,0 +1,57 @@ +" Vim syntax file +" Language: Paludis repositories/*.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis repositories/*.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisRepositoriesConfComment start=/^\s*#/ end=/$/ + +syn region PaludisRepositoriesConfKey start=/^\(\s*[^#]\)\@=/ end=/=\@=/ + \ contains=PaludisRepositoriesConfKnownKey + +syn match PaludisRepositoriesConfEquals /=/ skipwhite + \ nextgroup=PaludisRepositoriesConfValue + +syn region PaludisRepositoriesConfValue contained start=// end=/$/ + \ contains=PaludisRepositoriesConfString,PaludisRepositoriesConfUnquoted, + \ PaludisRepositoriesConfContinuation,PaludisRepositoriesConfVariable + \ skipwhite + +syn match PaludisRepositoriesConfContinuation contained /\\$/ + \ skipnl + +syn match PaludisRepositoriesConfUnquoted contained /[^ \t$"'\\]\+/ skipwhite + +syn region PaludisRepositoriesConfString contained start=/"/ end=/"/ + \ contains=PaludisRepositoriesConfVariable + \ skipwhite + +syn keyword PaludisRepositoriesConfKnownKey contained + \ location distdir format buildroot library sync root yaml_uri + \ master_repository profiles pkgdir setsdir securitydir newsdir + \ names_cache sync sync_options eclassdirs cache write_cache + \ world provides_cache importance + +syn match PaludisRepositoriesConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite + +hi def link PaludisRepositoriesConfKnownKey Keyword +hi def link PaludisRepositoriesConfString String +hi def link PaludisRepositoriesConfUnquoted Constant +hi def link PaludisRepositoriesConfVariable Identifier +hi def link PaludisRepositoriesConfContinuation Preproc +hi def link PaludisRepositoriesConfComment Comment + +let b:current_syntax = "paludis-repositories-conf" + + diff --git a/vim/syntax/paludis-use-conf.vim b/vim/syntax/paludis-use-conf.vim new file mode 100644 index 000000000..d2304cb2f --- /dev/null +++ b/vim/syntax/paludis-use-conf.vim @@ -0,0 +1,40 @@ +" Vim syntax file +" Language: Paludis use.conf files +" Author: Ciaran McCreesh <ciaranm@gentoo.org> +" Copyright: Copyright (c) 2007 Ciaran McCreesh +" Licence: You may redistribute this under the same terms as Vim itself +" +" Syntax highlighting for Paludis use.conf files. +" + +if &compatible || v:version < 700 + finish +endif + +if exists("b:current_syntax") + finish +endif + +syn region PaludisUseConfComment start=/^\s*#/ end=/$/ + +syn match PaludisUseConfPDS /^[^ \t#\/]\+\/[^ \t#\/]\+\s*/ + \ nextgroup=PaludisUseConfFlag,PaludisUseConfContinuation +syn match PaludisUseConfSet /^[^ \t#\/]\+\S\@!/ + \ nextgroup=PaludisUseConfFlag,PaludisUseConfPrefix,PaludisUseConfContinuation skipwhite +syn match PaludisUseConfFlag contained /[a-zA-Z0-9\-_*]\+:\@!/ + \ nextgroup=PaludisUseConfFlag,PaludisUseConfPrefix,PaludisUseConfContinuation skipwhite +syn match PaludisUseConfPrefix contained /[a-zA-Z0-9_*][a-zA-Z0-9\-_*]*:/ + \ nextgroup=PaludisUseConfFlag,PaludisUseConfPrefix,PaludisUseConfContinuation skipwhite +syn match PaludisUseConfContinuation contained /\\$/ + \ nextgroup=PaludisUseConfFlag,PaludisUseConfPrefix,PaludisUseConfContinuation skipwhite skipnl + +hi def link PaludisUseConfComment Comment +hi def link PaludisUseConfPDS Identifier +hi def link PaludisUseConfSet Special +hi def link PaludisUseConfPrefix Constant +hi def link PaludisUseConfFlag Keyword +hi def link PaludisUseConfContinuation Preproc + +let b:current_syntax = "paludis-use-conf" + + |