diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-06-09 19:44:55 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-06-09 19:44:55 +0200 |
commit | f2571c61d5aa05682ae4d358e625348b61adc861 (patch) | |
tree | aae56b60e5a0fe20ea3c106539c63926380b4178 /runtime/ftplugin | |
parent | d0d0fe09cf95bf88f643ec07d07939cbd41f8e63 (diff) | |
download | vim-f2571c61d5aa05682ae4d358e625348b61adc861.zip |
Updated runtime files.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/kconfig.vim | 13 | ||||
-rw-r--r-- | runtime/ftplugin/spec.vim | 34 | ||||
-rw-r--r-- | runtime/ftplugin/zsh.vim | 9 |
3 files changed, 48 insertions, 8 deletions
diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim index 1b10c86ae..940ba7427 100644 --- a/runtime/ftplugin/kconfig.vim +++ b/runtime/ftplugin/kconfig.vim @@ -1,6 +1,10 @@ " Vim filetype plugin file -" Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-09 +" Vim syntax file +" Maintainer: Christian Brabandt <cb@256bit.org> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2015-05-29 +" License: Vim (see :h license) +" Repository: https://github.com/chrisbra/vim-kconfig if exists("b:did_ftplugin") finish @@ -14,5 +18,10 @@ let b:undo_ftplugin = "setl com< cms< fo<" setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql +" For matchit.vim +if exists("loaded_matchit") + let b:match_words = '^\<menu\>:\<endmenu\>,^\<if\>:\<endif\>,^\<choice\>:\<endchoice\>' +endif + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index d4576598e..6d5bf4b80 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -2,7 +2,7 @@ " Filename: spec.vim " Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com " Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014) -" Last Change: Fri Feb 20 16:01 MSK 2014 Igor Gnatenko +" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko if exists("b:did_ftplugin") finish @@ -22,11 +22,36 @@ if !hasmapto("call <SID>SpecChangelog(\"\")<CR>") noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR> endif +if !exists("*s:GetRelVer") + function! s:GetRelVer() + if has('python') +python << PYEND +import sys, datetime, shutil, tempfile +import vim + +try: + import rpm +except ImportError: + pass +else: + specfile = vim.current.buffer.name + if specfile: + spec = rpm.spec(specfile) + headers = spec.packages[0].header + version = headers['Version'] + release = ".".join(headers['Release'].split(".")[:-1]) + vim.command("let ver = " + version) + vim.command("let rel = " + release) +PYEND + endif + endfunction +endif + if !exists("*s:SpecChangelog") function s:SpecChangelog(format) if strlen(a:format) == 0 if !exists("g:spec_chglog_format") - let email = input("Email address: ") + let email = input("Name <email address>: ") let g:spec_chglog_format = "%a %b %d %Y " . l:email echo "\r" endif @@ -71,6 +96,9 @@ if !exists("*s:SpecChangelog") else let include_release_info = 0 endif + + call s:GetRelVer() + if (chgline == -1) let option = confirm("Can't find %changelog. Create one? ","&End of file\n&Here\n&Cancel",3) if (option == 1) @@ -85,7 +113,7 @@ if !exists("*s:SpecChangelog") endif endif if (chgline != -1) - let parsed_format = "* ".strftime(format) + let parsed_format = "* ".strftime(format)." - ".ver."-".rel let release_info = "+ ".name."-".ver."-".rel let wrong_format = 0 let wrong_release = 0 diff --git a/runtime/ftplugin/zsh.vim b/runtime/ftplugin/zsh.vim index 3970d65cc..6cbc380dc 100644 --- a/runtime/ftplugin/zsh.vim +++ b/runtime/ftplugin/zsh.vim @@ -1,7 +1,10 @@ " Vim filetype plugin file -" Language: Zsh shell script -" Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2011-01-23 +" Language: Zsh shell script +" Maintainer: Christian Brabandt <cb@256bit.org> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2015-05-29 +" License: Vim (see :h license) +" Repository: https://github.com/chrisbra/vim-zsh if exists("b:did_ftplugin") finish |