diff options
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/c.vim | 6 | ||||
-rw-r--r-- | runtime/ftplugin/clojure.vim | 20 | ||||
-rw-r--r-- | runtime/ftplugin/eiffel.vim | 96 | ||||
-rw-r--r-- | runtime/ftplugin/groovy.vim | 19 | ||||
-rw-r--r-- | runtime/ftplugin/hgcommit.vim | 16 | ||||
-rw-r--r-- | runtime/ftplugin/man.vim | 66 | ||||
-rw-r--r-- | runtime/ftplugin/python.vim | 39 | ||||
-rw-r--r-- | runtime/ftplugin/r.vim | 3 | ||||
-rw-r--r-- | runtime/ftplugin/rhelp.vim | 3 | ||||
-rw-r--r-- | runtime/ftplugin/rmd.vim | 3 | ||||
-rw-r--r-- | runtime/ftplugin/rnoweb.vim | 3 | ||||
-rw-r--r-- | runtime/ftplugin/rrst.vim | 3 | ||||
-rw-r--r-- | runtime/ftplugin/spec.vim | 18 |
13 files changed, 227 insertions, 68 deletions
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 487ce7a165..3717ea92a9 100644 --- a/runtime/ftplugin/c.vim +++ b/runtime/ftplugin/c.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2012 Jul 10 +" Last Change: 2016 Jun 12 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -32,7 +32,7 @@ setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,:// " When the matchit plugin is loaded, this makes the % command skip parens and " braces in comments. let b:match_words = &matchpairs . ',^\s*#\s*if\(\|def\|ndef\)\>:^\s*#\s*elif\>:^\s*#\s*else\>:^\s*#\s*endif\>' -let b:match_skip = 's:comment\|string\|character' +let b:match_skip = 's:comment\|string\|character\|special' " Win32 can filter files in the browse dialog if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") @@ -55,5 +55,7 @@ if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") endif endif +let b:man_default_sects = '3,2' + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/ftplugin/clojure.vim b/runtime/ftplugin/clojure.vim index 10fcb9f205..217711f26e 100644 --- a/runtime/ftplugin/clojure.vim +++ b/runtime/ftplugin/clojure.vim @@ -1,11 +1,11 @@ " Vim filetype plugin file -" Language: Clojure -" Author: Meikel Brandmeyer <mb@kotka.de> +" Language: Clojure +" Author: Meikel Brandmeyer <mb@kotka.de> " -" Maintainer: Sung Pae <self@sungpae.com> -" URL: https://github.com/guns/vim-clojure-static -" License: Same as Vim -" Last Change: 27 March 2014 +" Maintainer: Sung Pae <self@sungpae.com> +" URL: https://github.com/guns/vim-clojure-static +" License: Same as Vim +" Last Change: 18 July 2016 if exists("b:did_ftplugin") finish @@ -43,7 +43,7 @@ setlocal commentstring=;\ %s " specially and hence are not indented specially. " " -*- LISPWORDS -*- -" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-010/clj/src/vim_clojure_static/generate.clj +" Generated from https://github.com/guns/vim-clojure-static/blob/vim-release-011/clj/src/vim_clojure_static/generate.clj setlocal lispwords=as->,binding,bound-fn,case,catch,cond->,cond->>,condp,def,definline,definterface,defmacro,defmethod,defmulti,defn,defn-,defonce,defprotocol,defrecord,defstruct,deftest,deftest-,deftype,doseq,dotimes,doto,extend,extend-protocol,extend-type,fn,for,if,if-let,if-not,if-some,let,letfn,locking,loop,ns,proxy,reify,set-test,testing,when,when-first,when-let,when-not,when-some,while,with-bindings,with-in-str,with-local-vars,with-open,with-precision,with-redefs,with-redefs-fn,with-test " Provide insert mode completions for special forms and clojure.core. As @@ -82,9 +82,9 @@ endif " Win32 can filter files in the browse dialog if has("gui_win32") && !exists("b:browsefilter") let b:browsefilter = "Clojure Source Files (*.clj)\t*.clj\n" . - \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . - \ "Java Source Files (*.java)\t*.java\n" . - \ "All Files (*.*)\t*.*\n" + \ "ClojureScript Source Files (*.cljs)\t*.cljs\n" . + \ "Java Source Files (*.java)\t*.java\n" . + \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin .= ' | unlet! b:browsefilter' endif diff --git a/runtime/ftplugin/eiffel.vim b/runtime/ftplugin/eiffel.vim new file mode 100644 index 0000000000..216fdde162 --- /dev/null +++ b/runtime/ftplugin/eiffel.vim @@ -0,0 +1,96 @@ +" Vim filetype plugin +" Language: Eiffel +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Last Change: 2010 Aug 29 + +if (exists("b:did_ftplugin")) + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +setlocal comments=:-- +setlocal commentstring=--\ %s + +setlocal formatoptions-=t formatoptions+=croql + +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") + let b:browsefilter = "Eiffel Source Files (*.e)\t*.e\n" . + \ "Eiffel Control Files (*.ecf, *.ace, *.xace)\t*.ecf;*.ace;*.xace\n" . + \ "All Files (*.*)\t*.*\n" +endif + +if exists("loaded_matchit") && !exists("b:match_words") + let b:match_ignorecase = 0 + " Silly \%^ trick to match note at head of pair and in middle prevents + " 'g%' wrapping from 'note' to 'end' + let b:match_words = '\%^:' . + \ '\<\%(^note\|indexing\|class\|^obsolete\|inherit\|insert\|^create\|convert\|feature\|^invariant\)\>:' . + \ '^end\>,' . + \ '\<\%(do\|deferred\|external\|once\%(\s\+"\)\@!\|check\|debug\|if\|inspect\|from\|across\)\>:' . + \ '\%(\%(^\s\+\)\@<=\%(then\|until\|loop\)\|\%(then\|until\|loop\)\s\+[^ -]\|' . + \ '\<\%(ensure\%(\s\+then\)\=\|rescue\|_then\|elseif\|else\|when\|\s\@<=invariant\|_until\|_loop\|variant\|_as\|alias\)\>\):' . + \ '\s\@<=end\>' + let b:match_skip = 's:\<eiffel\%(Comment\|String\|Operator\)\>' + noremap [% <Nop> + noremap ]% <Nop> + vnoremap a% <Nop> +endif + +let b:undo_ftplugin = "setl fo< com< cms<" . + \ "| unlet! b:browsefilter b:match_ignorecase b:match_words b:match_skip" + +if !exists("g:no_plugin_maps") && !exists("g:no_eiffel_maps") + function! s:DoMotion(pattern, count, flags) abort + normal! m' + for i in range(a:count) + call search(a:pattern, a:flags) + endfor + endfunction + + let sections = '^\%(note\|indexing\|' . + \ '\%(\%(deferred\|expanded\|external\|frozen\)\s\+\)*class\|' . + \ 'obsolete\|inherit\|insert\|create\|convert\|feature\|' . + \ 'invariant\|end\)\>' + + nnoremap <silent> <buffer> ]] :<C-U>call <SID>DoMotion(sections, v:count1, 'W')<CR> + xnoremap <silent> <buffer> ]] :<C-U>exe "normal! gv"<Bar>call <SID>DoMotion(sections, v:count1, 'W')<CR> + nnoremap <silent> <buffer> [[ :<C-U>call <SID>DoMotion(sections, v:count1, 'Wb')<CR> + xnoremap <silent> <buffer> [[ :<C-U>exe "normal! gv"<Bar>call <SID>DoMotion(sections, v:count1, 'Wb')<CR> + + function! s:DoFeatureMotion(count, flags) + let view = winsaveview() + call cursor(1, 1) + let [features_start, _] = searchpos('^feature\>') + call search('^\s\+\a') " find the first feature + let spaces = indent(line('.')) + let [features_end, _] = searchpos('^\%(invariant\|note\|end\)\>') + call winrestview(view) + call s:DoMotion('\%>' . features_start . 'l\%<' . features_end . 'l^\s*\%' . (spaces + 1) . 'v\zs\a', a:count, a:flags) + endfunction + + nnoremap <silent> <buffer> ]m :<C-U>call <SID>DoFeatureMotion(v:count1, 'W')<CR> + xnoremap <silent> <buffer> ]m :<C-U>exe "normal! gv"<Bar>call <SID>DoFeatureMotion(v:count1, 'W')<CR> + nnoremap <silent> <buffer> [m :<C-U>call <SID>DoFeatureMotion(v:count1, 'Wb')<CR> + xnoremap <silent> <buffer> [m :<C-U>exe "normal! gv"<Bar>call <SID>DoFeatureMotion(v:count1, 'Wb')<CR> + + let comment_block_start = '^\%(\s\+--.*\n\)\@<!\s\+--' + let comment_block_end = '^\s\+--.*\n\%(\s\+--\)\@!' + + nnoremap <silent> <buffer> ]- :<C-U>call <SID>DoMotion(comment_block_start, 1, 'W')<CR> + xnoremap <silent> <buffer> ]- :<C-U>exe "normal! gv"<Bar>call <SID>DoMotion(comment_block_start, 1, 'W')<CR> + nnoremap <silent> <buffer> [- :<C-U>call <SID>DoMotion(comment_block_end, 1, 'Wb')<CR> + xnoremap <silent> <buffer> [- :<C-U>exe "normal! gv"<Bar>call <SID>DoMotion(comment_block_end, 1, 'Wb')<CR> + + let b:undo_ftplugin = b:undo_ftplugin . + \ "| silent! execute 'unmap <buffer> [[' | silent! execute 'unmap <buffer> ]]'" . + \ "| silent! execute 'unmap <buffer> [m' | silent! execute 'unmap <buffer> ]m'" . + \ "| silent! execute 'unmap <buffer> [-' | silent! execute 'unmap <buffer> ]-'" +endif + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: nowrap sw=2 sts=2 ts=8 diff --git a/runtime/ftplugin/groovy.vim b/runtime/ftplugin/groovy.vim new file mode 100644 index 0000000000..cc7d6e35eb --- /dev/null +++ b/runtime/ftplugin/groovy.vim @@ -0,0 +1,19 @@ +" Vim filetype plugin file +" Language: groovy +" Maintainer: Justin M. Keyes <justinkz@gmail.com> +" Last Change: 2016 May 22 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo-=C + +let b:undo_ftplugin = 'setlocal commentstring<' + +setlocal commentstring=//%s + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/ftplugin/hgcommit.vim b/runtime/ftplugin/hgcommit.vim new file mode 100644 index 0000000000..d5a6c0a383 --- /dev/null +++ b/runtime/ftplugin/hgcommit.vim @@ -0,0 +1,16 @@ +" Vim filetype plugin file +" Language: hg (Mercurial) commit file +" Maintainer: Ken Takata <kentkt at csc dot jp> +" Last Change: 2016 Jan 6 +" Filenames: hg-editor-*.txt +" License: VIM License +" URL: https://github.com/k-takata/hg-vim + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal nomodeline + +let b:undo_ftplugin = 'setl modeline<' diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim index 04ab539fb1..5d83886f56 100644 --- a/runtime/ftplugin/man.vim +++ b/runtime/ftplugin/man.vim @@ -1,41 +1,51 @@ -" Vim filetype plugin file -" Language: man -" Maintainer: SungHyun Nam <goweol@gmail.com> +" Maintainer: Anmol Sethi <anmol@aubble.com> +" Previous Maintainer: SungHyun Nam <goweol@gmail.com> -if has('vim_starting') && &filetype !=# 'man' - finish -endif - -" Only do this when not done yet for this buffer -if exists('b:did_ftplugin') +if exists('b:did_ftplugin') || &filetype !=# 'man' finish endif let b:did_ftplugin = 1 -" Ensure Vim is not recursively invoked (man-db does this) -" when doing ctrl-[ on a man page reference. -if exists('$MANPAGER') - let $MANPAGER = '' -endif +let s:pager = !exists('b:man_sect') -setlocal iskeyword+=\.,-,(,) - -setlocal buftype=nofile noswapfile -setlocal nomodifiable readonly bufhidden=hide nobuflisted tabstop=8 +if s:pager + call man#init_pager() +endif -if !exists("g:no_plugin_maps") && !exists("g:no_man_maps") - nnoremap <silent> <buffer> <C-]> :call man#get_page(v:count, expand('<cword>'))<CR> - nnoremap <silent> <buffer> <C-T> :call man#pop_page()<CR> - nnoremap <silent> <nowait><buffer> q <C-W>c - if &keywordprg !=# ':Man' - nnoremap <silent> <buffer> K :call man#get_page(v:count, expand('<cword>'))<CR> +setlocal buftype=nofile +setlocal noswapfile +setlocal bufhidden=hide +setlocal nomodified +setlocal readonly +setlocal nomodifiable +setlocal noexpandtab +setlocal tabstop=8 +setlocal softtabstop=8 +setlocal shiftwidth=8 + +setlocal nonumber +setlocal norelativenumber +setlocal foldcolumn=0 +setlocal colorcolumn=0 +setlocal nolist +setlocal nofoldenable + +if !exists('g:no_plugin_maps') && !exists('g:no_man_maps') + nnoremap <silent> <buffer> <C-]> :Man<CR> + nnoremap <silent> <buffer> K :Man<CR> + nnoremap <silent> <buffer> <C-T> :call man#pop_tag()<CR> + if s:pager + nnoremap <silent> <buffer> <nowait> q :q<CR> + else + nnoremap <silent> <buffer> <nowait> q <C-W>c endif endif -if exists('g:ft_man_folding_enable') && (g:ft_man_folding_enable == 1) - setlocal foldmethod=indent foldnestmax=1 foldenable +if get(g:, 'ft_man_folding_enable', 0) + setlocal foldenable + setlocal foldmethod=indent + setlocal foldnestmax=1 endif -let b:undo_ftplugin = 'setlocal iskeyword<' - +let b:undo_ftplugin = '' " vim: set sw=2: diff --git a/runtime/ftplugin/python.vim b/runtime/ftplugin/python.vim index 75c7e87996..df5dab8afc 100644 --- a/runtime/ftplugin/python.vim +++ b/runtime/ftplugin/python.vim @@ -1,8 +1,9 @@ " Vim filetype plugin file " Language: python -" Maintainer: Johannes Zellner <johannes@zellner.org> -" Last Change: 2014 Feb 09 -" Last Change By Johannes: Wed, 21 Apr 2004 13:13:08 CEST +" Maintainer: James Sully <sullyj3@gmail.com> +" Previous Maintainer: Johannes Zellner <johannes@zellner.org> +" Last Change: Wed, 29 June 2016 +" https://github.com/sullyj3/vim-ftplugin-python if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -21,28 +22,38 @@ setlocal omnifunc=pythoncomplete#Complete set wildignore+=*.pyc -nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr> -nnoremap <silent> <buffer> [[ :call <SID>Python_jump('?^\(class\\|def\)')<cr> -nnoremap <silent> <buffer> ]m :call <SID>Python_jump('/^\s*\(class\\|def\)')<cr> -nnoremap <silent> <buffer> [m :call <SID>Python_jump('?^\s*\(class\\|def\)')<cr> +nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '\v%$\|^(class\|def)>', 'W')<cr> +nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '\v^(class\|def)>', 'Wb')<cr> +nnoremap <silent> <buffer> ]m :call <SID>Python_jump('n', '\v%$\|^\s*(class\|def)>', 'W')<cr> +nnoremap <silent> <buffer> [m :call <SID>Python_jump('n', '\v^\s*(class\|def)>', 'Wb')<cr> + +xnoremap <silent> <buffer> ]] :call <SID>Python_jump('x', '\v%$\|^(class\|def)>', 'W')<cr> +xnoremap <silent> <buffer> [[ :call <SID>Python_jump('x', '\v^(class\|def)>', 'Wb')<cr> +xnoremap <silent> <buffer> ]m :call <SID>Python_jump('x', '\v%$\|^\s*(class\|def)>', 'W')<cr> +xnoremap <silent> <buffer> [m :call <SID>Python_jump('x', '\v^\s*(class\|def)>', 'Wb')<cr> if !exists('*<SID>Python_jump') - fun! <SID>Python_jump(motion) range + fun! <SID>Python_jump(mode, motion, flags) range + if a:mode == 'x' + normal! gv + endif + + normal! 0 + let cnt = v:count1 - let save = @/ " save last search pattern mark ' while cnt > 0 - silent! exe a:motion - let cnt = cnt - 1 + call search(a:motion, a:flags) + let cnt = cnt - 1 endwhile - call histdel('/', -1) - let @/ = save " restore last search pattern + + normal! ^ endfun endif if has("browsefilter") && !exists("b:browsefilter") let b:browsefilter = "Python Files (*.py)\t*.py\n" . - \ "All Files (*.*)\t*.*\n" + \ "All Files (*.*)\t*.*\n" endif " As suggested by PEP8. diff --git a/runtime/ftplugin/r.vim b/runtime/ftplugin/r.vim index 43b208b842..4ea3073922 100644 --- a/runtime/ftplugin/r.vim +++ b/runtime/ftplugin/r.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: R " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> -" Last Change: Sun Feb 23, 2014 04:07PM +" Homepage: https://github.com/jalvesaq/R-Vim-runtime +" Last Change: Tue Apr 07, 2015 04:38PM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/rhelp.vim b/runtime/ftplugin/rhelp.vim index 9b72fb42f9..fdac38f3e9 100644 --- a/runtime/ftplugin/rhelp.vim +++ b/runtime/ftplugin/rhelp.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: R help file " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> -" Last Change: Wed Jul 09, 2014 06:23PM +" Homepage: https://github.com/jalvesaq/R-Vim-runtime +" Last Change: Tue Apr 07, 2015 04:37PM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim index 55723ff396..ec64a07675 100644 --- a/runtime/ftplugin/rmd.vim +++ b/runtime/ftplugin/rmd.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: R help file " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> -" Last Change: Wed Jul 09, 2014 06:23PM +" Homepage: https://github.com/jalvesaq/R-Vim-runtime +" Last Change: Tue Apr 07, 2015 04:37PM " Original work by Alex Zvoleff (adjusted for rmd by Michel Kuhlmann) " Only do this when not yet done for this buffer diff --git a/runtime/ftplugin/rnoweb.vim b/runtime/ftplugin/rnoweb.vim index baf53d0108..e184399dcb 100644 --- a/runtime/ftplugin/rnoweb.vim +++ b/runtime/ftplugin/rnoweb.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: Rnoweb " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> -" Last Change: Wed Jul 09, 2014 06:23PM +" Homepage: https://github.com/jalvesaq/R-Vim-runtime +" Last Change: Tue Apr 07, 2015 04:37PM " Only do this when not yet done for this buffer if exists("b:did_ftplugin") diff --git a/runtime/ftplugin/rrst.vim b/runtime/ftplugin/rrst.vim index 8140169e61..ecfd6e87a1 100644 --- a/runtime/ftplugin/rrst.vim +++ b/runtime/ftplugin/rrst.vim @@ -1,7 +1,8 @@ " Vim filetype plugin file " Language: reStructuredText documentation format with R code " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> -" Last Change: Wed Jul 09, 2014 06:23PM +" Homepage: https://github.com/jalvesaq/R-Vim-runtime +" Last Change: Tue Apr 07, 2015 04:38PM " Original work by Alex Zvoleff " Only do this when not yet done for this buffer diff --git a/runtime/ftplugin/spec.vim b/runtime/ftplugin/spec.vim index 6d5bf4b806..2a961f8244 100644 --- a/runtime/ftplugin/spec.vim +++ b/runtime/ftplugin/spec.vim @@ -36,10 +36,11 @@ except ImportError: else: specfile = vim.current.buffer.name if specfile: + rpm.delMacro("dist") spec = rpm.spec(specfile) - headers = spec.packages[0].header - version = headers['Version'] - release = ".".join(headers['Release'].split(".")[:-1]) + headers = spec.sourceHeader + version = headers["Version"] + release = headers["Release"] vim.command("let ver = " + version) vim.command("let rel = " + release) PYEND @@ -113,7 +114,10 @@ if !exists("*s:SpecChangelog") endif endif if (chgline != -1) + let tmptime = v:lc_time + language time C let parsed_format = "* ".strftime(format)." - ".ver."-".rel + execute "language time" tmptime let release_info = "+ ".name."-".ver."-".rel let wrong_format = 0 let wrong_release = 0 @@ -179,12 +183,8 @@ if !exists("*s:ParseRpmVars") endif let varname = strpart(a:str, start+2, end-(start+2)) execute a:strline - let definestr = "^[ \t]*%define[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$" + let definestr = "^[ \t]*%(?:global|define)[ \t]\\+" . varname . "[ \t]\\+\\(.*\\)$" let linenum = search(definestr, "bW") - if (linenum == 0) - let definestr = substitute(definestr, "%define", "%global", "") - let linenum = search(definestr, "bW") - endif if (linenum != -1) let ret = ret . substitute(getline(linenum), definestr, "\\1", "") else @@ -201,7 +201,7 @@ endif let b:match_ignorecase = 0 let b:match_words = - \ '^Name:^%description:^%clean:^%setup:^%build:^%install:^%files:' . + \ '^Name:^%description:^%clean:^%(?:auto)?setup:^%build:^%install:^%files:' . \ '^%package:^%preun:^%postun:^%changelog' let &cpo = s:cpo_save |