[PATCH 0/6] Vim additions and cleanup
Daniel M. Capella (6): Update email Vim: Add indent file Vim: Add unknown license special case Vim: Fix Vint warnings Vim: Remove version check for Vim older than 6.0 Vim: Cleanup AUTHORS.md | 2 +- src/vim/ftplugin/PKGBUILD.vim | 5 ++++- src/vim/indent/PKGBUILD.vim | 8 ++++++++ src/vim/syntax/PKGBUILD.vim | 38 ++++++++++++++--------------------- 4 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 src/vim/indent/PKGBUILD.vim -- 2.20.1
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- AUTHORS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.md b/AUTHORS.md index b6f949e..85730d3 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -2,7 +2,7 @@ Maintainers ----------- * Johannes Löthberg <johannes@kyriasis.com> -* Daniel M. Capella <polycitizen@gmail.com> +* Daniel M. Capella <polyzen@archlinux.org> Contributors -- 2.20.1
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/indent/PKGBUILD.vim | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/vim/indent/PKGBUILD.vim diff --git a/src/vim/indent/PKGBUILD.vim b/src/vim/indent/PKGBUILD.vim new file mode 100644 index 0000000..3fdf9cc --- /dev/null +++ b/src/vim/indent/PKGBUILD.vim @@ -0,0 +1,8 @@ +" Vim indent file +" Language: Arch Linux package build description file + +if exists('b:did_indent') + finish +endif + +runtime! indent/sh.vim -- 2.20.1
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/syntax/PKGBUILD.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vim/syntax/PKGBUILD.vim b/src/vim/syntax/PKGBUILD.vim index 6a27360..37d0ab3 100644 --- a/src/vim/syntax/PKGBUILD.vim +++ b/src/vim/syntax/PKGBUILD.vim @@ -70,10 +70,11 @@ syn match pbUrlGroup /^url=.*/ contains=pbValidUrl,pb_k_url,pbIllegalUrl,shDoubl syn keyword pb_k_license license contained " echo $(pacman -Ql licenses | grep '/usr/share/licenses/common/' | cut -d'/' -f6 | sort -u) syn keyword pbLicense AGPL AGPL3 Apache APACHE Artistic2.0 CCPL CDDL CPL EPL FDL FDL1.2 FDL1.3 GPL GPL2 GPL3 LGPL LGPL2.1 LGPL3 LPPL MPL PerlArtistic PHP PSF RUBY W3C ZPL contained -" special cases from https://wiki.archlinux.org/index.php/Arch_Packaging_Standards +" special cases from https://wiki.archlinux.org/index.php/PKGBUILD#license syn keyword pbLicenseSpecial BSD MIT ZLIB Python contained syn match pbLicenseCustom /custom\(:[[:alnum:]]*\)*/ contained -syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseCustom,pbLicenseSpecial,pbLicense +syn keyword pbLicenseUnknown unknown contained +syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseUnknown,pbLicenseCustom,pbLicenseSpecial,pbLicense syn region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicenseSpecial,pbLicense,pbIllegalLicense " backup -- 2.20.1
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/ftplugin/PKGBUILD.vim | 2 +- src/vim/syntax/PKGBUILD.vim | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vim/ftplugin/PKGBUILD.vim b/src/vim/ftplugin/PKGBUILD.vim index cbb46a9..66da6f4 100644 --- a/src/vim/ftplugin/PKGBUILD.vim +++ b/src/vim/ftplugin/PKGBUILD.vim @@ -1,4 +1,4 @@ -if exists("b:did_ftplugin") | finish | endif +if exists('b:did_ftplugin') | finish | endif let b:did_ftplugin = 1 setlocal commentstring=#\ %s diff --git a/src/vim/syntax/PKGBUILD.vim b/src/vim/syntax/PKGBUILD.vim index 37d0ab3..17afa35 100644 --- a/src/vim/syntax/PKGBUILD.vim +++ b/src/vim/syntax/PKGBUILD.vim @@ -6,13 +6,13 @@ " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded -if version < 600 +if v:version < 600 syntax clear -elseif exists("b:current_syntax") +elseif exists('b:current_syntax') finish endif -let b:main_syntax = "sh" +let b:main_syntax = 'sh' let b:is_bash = 1 runtime! syntax/sh.vim @@ -330,6 +330,6 @@ hi def link pbDate Special "syntax include @SHELL syntax/sh.vim "syntax region BUILD start=/^build()/ end=/^}/ contains=@SHELL -"let b:current_syntax = "PKGBUILD" +"let b:current_syntax = 'PKGBUILD' " vim: ft=vim -- 2.20.1
Done upstream in 2016: 89bcfda6834aba724d12554a34b9ed49f5789fd5. Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/syntax/PKGBUILD.vim | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vim/syntax/PKGBUILD.vim b/src/vim/syntax/PKGBUILD.vim index 17afa35..e00d7ac 100644 --- a/src/vim/syntax/PKGBUILD.vim +++ b/src/vim/syntax/PKGBUILD.vim @@ -4,11 +4,8 @@ " Last Change: 2007/05/08 " Version Info: PKGBUILD-0.2 (colorphobic) -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if v:version < 600 - syntax clear -elseif exists('b:current_syntax') +" quit when a syntax file was already loaded +if exists('b:current_syntax') finish endif -- 2.20.1
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/ftplugin/PKGBUILD.vim | 3 +++ src/vim/syntax/PKGBUILD.vim | 20 +++++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/vim/ftplugin/PKGBUILD.vim b/src/vim/ftplugin/PKGBUILD.vim index 66da6f4..c482671 100644 --- a/src/vim/ftplugin/PKGBUILD.vim +++ b/src/vim/ftplugin/PKGBUILD.vim @@ -1,3 +1,6 @@ +" Vim filetype plugin file +" Language: Arch Linux package build description file + if exists('b:did_ftplugin') | finish | endif let b:did_ftplugin = 1 diff --git a/src/vim/syntax/PKGBUILD.vim b/src/vim/syntax/PKGBUILD.vim index e00d7ac..8e3e1b9 100644 --- a/src/vim/syntax/PKGBUILD.vim +++ b/src/vim/syntax/PKGBUILD.vim @@ -1,12 +1,10 @@ " Vim syntax file -" Language: PKGBUILD -" Maintainer: Alessio 'mOLOk' Bolognino <themolok at gmail.com> -" Last Change: 2007/05/08 -" Version Info: PKGBUILD-0.2 (colorphobic) +" Language: Arch Linux package build description file +" Original Author: Alessio 'mOLOk' Bolognino <themolok at gmail.com> " quit when a syntax file was already loaded if exists('b:current_syntax') - finish + finish endif let b:main_syntax = 'sh' @@ -237,10 +235,10 @@ syn match pbMaintainerGroup /Maintainer.*/ contains=pbMaintainer contained syn match pbDate /[0-9]\{4}\/[0-9]\{2}\/[0-9]\{2}/ contained -syn cluster pbCommentGroup contains=pbTodo,pb_k_maintainer,pbMaintainerGroup,pbDate -syn keyword pbTodo contained COMBAK FIXME TODO XXX -syn match pbComment "^#.*$" contains=@pbCommentGroup -syn match pbComment "[^0-9]#.*$" contains=@pbCommentGroup +syn cluster pbCommentGroup contains=pbTodo,pb_k_maintainer,pbMaintainerGroup,pbDate +syn keyword pbTodo contained COMBAK FIXME TODO XXX +syn match pbComment "^#.*$" contains=@pbCommentGroup +syn match pbComment "[^0-9]#.*$" contains=@pbCommentGroup " quotes are handled by sh.vim @@ -325,8 +323,4 @@ hi def link pbKeywords Keyword hi def link pbDate Special -"syntax include @SHELL syntax/sh.vim -"syntax region BUILD start=/^build()/ end=/^}/ contains=@SHELL "let b:current_syntax = 'PKGBUILD' - -" vim: ft=vim -- 2.20.1
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/ftdetect/PKGBUILD.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vim/ftdetect/PKGBUILD.vim b/src/vim/ftdetect/PKGBUILD.vim index cc84ccb..48475b6 100644 --- a/src/vim/ftdetect/PKGBUILD.vim +++ b/src/vim/ftdetect/PKGBUILD.vim @@ -1 +1,2 @@ au BufNewFile,BufRead PKGBUILD set filetype=PKGBUILD +au BufNewFile,BufRead PKGBUILD.vim set filetype=vim -- 2.20.1
Excerpts from Daniel M. Capella's message of January 17, 2019 4:44:
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org> --- src/vim/ftdetect/PKGBUILD.vim | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/vim/ftdetect/PKGBUILD.vim b/src/vim/ftdetect/PKGBUILD.vim index cc84ccb..48475b6 100644 --- a/src/vim/ftdetect/PKGBUILD.vim +++ b/src/vim/ftdetect/PKGBUILD.vim @@ -1 +1,2 @@ au BufNewFile,BufRead PKGBUILD set filetype=PKGBUILD +au BufNewFile,BufRead PKGBUILD.vim set filetype=vim
I think I would rather prefer it if this was fixed in vim upstream instead, since it's something broken there and not in our configs, and it's definitely vim's domain to fix the ft for *.vim things. I don't really have any actual strong feelings about this in particular though. Overall patchset LGTM. -- Sincerely, Johannes Löthberg :: SA0DEM
participants (2)
-
Daniel M. Capella
-
Johannes Löthberg