[packages/vim-syntax-spec] old changes

glen glen at pld-linux.org
Fri Dec 4 12:27:54 CET 2015


commit 82512d10cdd50694b009bbfe4134e18c83c64a59
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Fri Dec 4 13:27:32 2015 +0200

    old changes
    
    sorry, no description

 spec.vim              |  3 ++-
 vim-ftplugin-spec.vim | 21 ++++++++++++++++++---
 vim-syntax-spec.spec  |  2 ++
 3 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/vim-syntax-spec.spec b/vim-syntax-spec.spec
index d440e90..2546035 100644
--- a/vim-syntax-spec.spec
+++ b/vim-syntax-spec.spec
@@ -8,6 +8,8 @@ Group:		Applications/Editors/Vim
 Source0:	spec.vim
 Source1:	vim-ftplugin-spec.vim
 Conflicts:	rpm-build-tools < 4.4.36-2
+# for extended % matching
+Suggests:	vim-plugin-matchit
 # for diffcol
 Suggests:	rpmbuild(macros)
 Conflicts:	rpmbuild(macros) < 1.665
diff --git a/spec.vim b/spec.vim
index 3adb487..1329dbd 100644
--- a/spec.vim
+++ b/spec.vim
@@ -32,10 +32,11 @@ syn match specVariables   contained '\${\w*[#%][^}]*}' contains=specSubstChar
 syn match specMacroIdentifier contained '%\h\w*' contains=specMacroNameLocal,specMacroNameOther,specPercent,specSpecialChar
 syn region specMacroIdentifier oneline matchgroup=Special start='%{' skip='\\}' end='}' contains=specConfOpts,specMacroNameLocal,specMacroNameOther,specPercent,specSpecialChar
 syn match specBcond contained '%{with\(out\)\?\s\+[a-zA-Z0-9_-]\+}'
+syn match specBcond contained '%{defined\s\+[a-zA-Z0-9_-]\+}'
 
 syn match specConfOpts contained '{\@<=__with\(_without\)\?' nextgroup=specConfOptsBcond
 syn match specConfOpts contained '{\@<=__without' nextgroup=specConfOptsBcond
-syn match specConfOpts contained '{\@<=__enable\(_disable\)\?' nextgroup=specConfOptsBcond
+syn match specConfOpts contained '{\@<=__enable\(_disable\)\?\(_not\)\?' nextgroup=specConfOptsBcond
 syn match specConfOpts contained '{\@<=__disable' nextgroup=specConfOptsBcond
 syn match specConfOptsBcond contained '\s\+[a-zA-Z0-9_]\+' nextgroup=specConfOptsName
 syn match specConfOptsName contained '\s\+[a-zA-Z0-9_-]\+'
diff --git a/vim-ftplugin-spec.vim b/vim-ftplugin-spec.vim
index 7a80761..6bb6a5e 100644
--- a/vim-ftplugin-spec.vim
+++ b/vim-ftplugin-spec.vim
@@ -1,7 +1,7 @@
 " Vim filetype plugin file
 " Language: RPM spec file
 " Author:   Elan Ruusamäe <glen at pld-linux.org>, Zsolt Udvari <uzsolt at pld-linux.org>
-" Copyright:    Copyright (c) 2005-2013 PLD Linux
+" Copyright:    Copyright (c) 2005-2015 PLD Linux
 " Licence:  You may redistribute this under the same terms as Vim itself
 "
 " This sets up filetype specific options for RPM spec files.
@@ -84,8 +84,8 @@ function! SearchSubpackage()
 	call search("%package .*" . searched)
 endfunction
 
-nmap <buffer>\r :call execute "normal ORequires:\t"
-nmap <buffer>\br :call execute "normal OBuildRequires:\t"
+nmap <buffer>\ar :call execute "normal ORequires:\t"
+nmap <buffer>\abr :call execute "normal OBuildRequires:\t"
 nmap <buffer>\se :call Summary("")<CR>
 nmap <buffer>\sh :call Summary("hu")<CR>
 nmap <buffer>\sp :call Summary("pl")<CR>
@@ -100,7 +100,22 @@ nmap <buffer>\pn :call CreateSubpackage(1)<CR>
 " Jumpings
 nmap <buffer>\jc /%changelog<CR>
 nmap <buffer>\jv /^Version:<CR>9l
+nmap <buffer> <LocalLeader>v /^Version:<CR>9l
+nmap <buffer> <LocalLeader>r /^Release:<CR>9l
 nmap <buffer>\jp :call SearchSubpackage()<CR>
 
+
+" The following lines, along with the macros/matchit.vim plugin,
+" make it easy to navigate the different sections of a spec file
+" with the % key (thanks to Max Ischenko).
+
+let b:match_ignorecase = 0
+let b:match_words =
+  \ '^Name:^%description:^%clean:^%setup:^%build:^%install:^%files:' .
+  \ '^%package:^%preun:^%postun:^%changelog'
+
+" add tab key match them
+nnoremap <silent> <tab>  %
+
 " PLD specfiles are in UTF-8 encoding
 setlocal fileencodings=ucs-bom,utf-8,default,latin2
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vim-syntax-spec.git/commitdiff/82512d10cdd50694b009bbfe4134e18c83c64a59



More information about the pld-cvs-commit mailing list