aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-11-07 22:04:08 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-11-07 22:04:08 -0500
commit333bd8cde30ce8125e2ce0454361239893516c56 (patch)
treee009c35bfaa7d6924689ab3cac27ff58391d7a73 /runtime/ftplugin
parent7521fb56558a146f3b116bcf195cf6bd1984d6c2 (diff)
parent975a610233e05772d9c835caeede4b7ae2e1af7d (diff)
downloadrneovim-333bd8cde30ce8125e2ce0454361239893516c56.tar.gz
rneovim-333bd8cde30ce8125e2ce0454361239893516c56.tar.bz2
rneovim-333bd8cde30ce8125e2ce0454361239893516c56.zip
Merge pull request #3628 from mhinz/vim-patch-f2571c6
vim-patch:f2571c6
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/kconfig.vim13
-rw-r--r--runtime/ftplugin/spec.vim32
-rw-r--r--runtime/ftplugin/zsh.vim9
3 files changed, 47 insertions, 7 deletions
diff --git a/runtime/ftplugin/kconfig.vim b/runtime/ftplugin/kconfig.vim
index 1b10c86ae3..940ba7427f 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 c3af8a9fca..0b6750de94 100644
--- a/runtime/ftplugin/spec.vim
+++ b/runtime/ftplugin/spec.vim
@@ -20,11 +20,36 @@ endif
noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
+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
@@ -69,6 +94,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)
@@ -83,7 +111,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 3970d65cc8..6cbc380dc3 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