diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-06-24 21:56:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-06-24 21:56:24 +0000 |
commit | 446cb837a017fc1c1b144cb5c2a35cb90abfbbcf (patch) | |
tree | 6c1fe56f2db8d4adbeee792b181b0659c4d1f216 /runtime/ftplugin | |
parent | 3577c6fafb77da5419cd1001dac56f204d480bdc (diff) |
updated for version 7.2a
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/c.vim | 7 | ||||
-rw-r--r-- | runtime/ftplugin/changelog.vim | 4 | ||||
-rw-r--r-- | runtime/ftplugin/hostconf.vim | 18 | ||||
-rw-r--r-- | runtime/ftplugin/lua.vim | 4 | ||||
-rw-r--r-- | runtime/ftplugin/pdf.vim | 89 | ||||
-rw-r--r-- | runtime/ftplugin/perl.vim | 6 | ||||
-rw-r--r-- | runtime/ftplugin/reva.vim | 25 | ||||
-rw-r--r-- | runtime/ftplugin/ruby.vim | 2 |
8 files changed, 148 insertions, 7 deletions
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim index 48055b0ad5..162205bcee 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: 2005 Sep 01 +" Last Change: 2007 Sep 25 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -34,6 +34,11 @@ if has("vms") setlocal iskeyword+=$ endif +" When the matchit plugin is loaded, this makes the % command skip parens and +" braces in comments. +let b:match_words = &matchpairs +let b:match_skip = 's:comment\|string\|character' + " Win32 can filter files in the browse dialog if has("gui_win32") && !exists("b:browsefilter") if &ft == "cpp" diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim index e9ec4d4282..924d35daed 100644 --- a/runtime/ftplugin/changelog.vim +++ b/runtime/ftplugin/changelog.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: generic Changelog file " Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2007-05-06 +" Latest Revision: 2007-05-21 " Variables: " g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) - " description: the timeformat used in ChangeLog entries. @@ -131,7 +131,7 @@ if &filetype == 'changelog' " Regular expression used to find the end of a date entry if !exists('g:changelog_date_end_entry_search') - let g:changelog_date_entry_search = '^\s*$' + let g:changelog_date_end_entry_search = '^\s*$' endif diff --git a/runtime/ftplugin/hostconf.vim b/runtime/ftplugin/hostconf.vim new file mode 100644 index 0000000000..86796eb8ec --- /dev/null +++ b/runtime/ftplugin/hostconf.vim @@ -0,0 +1,18 @@ +" Vim filetype plugin file +" Maintainer: Nikolai Weibull <now@bitwi.se> +" Latest Revision: 2007-09-18 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +let s:cpo_save = &cpo +set cpo&vim + +let b:undo_ftplugin = "setl com< cms< fo<" + +setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql + +let s:cpo_save = &cpo +set cpo&vim diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim index 3bc640f3f7..297833f4fb 100644 --- a/runtime/ftplugin/lua.vim +++ b/runtime/ftplugin/lua.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file. " Language: Lua 4.0+ " Maintainer: Max Ischenko <mfi@ukr.net> -" Last Change: 2001 Sep 17 +" Last Change: 2008 Mar 25 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") @@ -16,7 +16,7 @@ let b:did_ftplugin = 1 setlocal fo-=t fo+=croql setlocal com=:-- -setlocal cms="--%s" +setlocal cms=--%s setlocal suffixesadd=.lua diff --git a/runtime/ftplugin/pdf.vim b/runtime/ftplugin/pdf.vim new file mode 100644 index 0000000000..1ed99117d6 --- /dev/null +++ b/runtime/ftplugin/pdf.vim @@ -0,0 +1,89 @@ +" Vim filetype plugin file +" Language: PDF +" Maintainer: Tim Pope <vimNOSPAM@tpope.info> +" Last Change: 2007 Dec 16 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +setlocal commentstring=%%s +setlocal comments=:% +let b:undo_ftplugin = "setlocal cms< com< | unlet! b:match_words" + +if exists("g:loaded_matchit") + let b:match_words = '\<\%(\d\+\s\+\d\+\s\+\)obj\>:\<endobj\>,\<stream$:\<endstream\>,\<xref\>:\<trailer\>,<<:>>' +endif + +if exists("g:no_plugin_maps") || exists("g:no_pdf_maps") || v:version < 700 + finish +endif + +if !exists("b:pdf_tagstack") + let b:pdf_tagstack = [] +endif + +let b:undo_ftplugin .= " | silent! nunmap <buffer> <C-]> | silent! nunmap <buffer> <C-T>" +nnoremap <silent><buffer> <C-]> :call <SID>Tag()<CR> +" Inline, so the error from an empty tag stack will be simple. +nnoremap <silent><buffer> <C-T> :if len(b:pdf_tagstack) > 0 <Bar> call setpos('.',remove(b:pdf_tagstack, -1)) <Bar> else <Bar> exe "norm! \<Lt>C-T>" <Bar> endif<CR> + +function! s:Tag() + call add(b:pdf_tagstack,getpos('.')) + if getline('.') =~ '^\d\+$' && getline(line('.')-1) == 'startxref' + return s:dodigits(getline('.')) + elseif getline('.') =~ '/Prev\s\+\d\+\>\%(\s\+\d\)\@!' && expand("<cword>") =~ '^\d\+$' + return s:dodigits(expand("<cword>")) + elseif getline('.') =~ '^\d\{10\} \d\{5\} ' + return s:dodigits(matchstr(getline('.'),'^\d\+')) + else + let line = getline(".") + let lastend = 0 + let pat = '\<\d\+\s\+\d\+\s\+R\>' + while lastend >= 0 + let beg = match(line,'\C'.pat,lastend) + let end = matchend(line,'\C'.pat,lastend) + if beg < col(".") && end >= col(".") + return s:doobject(matchstr(line,'\C'.pat,lastend)) + endif + let lastend = end + endwhile + return s:notag() + endif +endfunction + +function! s:doobject(string) + let first = matchstr(a:string,'^\s*\zs\d\+') + let second = matchstr(a:string,'^\s*\d\+\s\+\zs\d\+') + norm! m' + if first != '' && second != '' + let oldline = line('.') + let oldcol = col('.') + 1 + if !search('^\s*'.first.'\s\+'.second.'\s\+obj\>') + exe oldline + exe 'norm! '.oldcol.'|' + return s:notag() + endif + endif +endfunction + +function! s:dodigits(digits) + let digits = 0 + substitute(a:digits,'^0*','','') + norm! m' + if digits <= 0 + norm! 1go + else + " Go one character before the destination and advance. This method + " lands us after a newline rather than before, if that is our target. + exe "goto ".(digits)."|norm! 1 " + endif +endfunction + +function! s:notag() + silent! call remove(b:pdf_tagstack,-1) + echohl ErrorMsg + echo "E426: tag not found" + echohl NONE +endfunction diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim index b3078005f9..3f3e570b8e 100644 --- a/runtime/ftplugin/perl.vim +++ b/runtime/ftplugin/perl.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Perl " Maintainer: Dan Sharp <dwsharp at hotmail dot com> -" Last Change: 2005 Dec 16 +" Last Change: 2007 Nov 30 " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin if exists("b:did_ftplugin") | finish | endif @@ -42,12 +42,16 @@ set isfname+=: " Set this once, globally. if !exists("perlpath") if executable("perl") + try if &shellxquote != '"' let perlpath = system('perl -e "print join(q/,/,@INC)"') else let perlpath = system("perl -e 'print join(q/,/,@INC)'") endif let perlpath = substitute(perlpath,',.$',',,','') + catch /E145:/ + let perlpath = ".,," + endtry else " If we can't call perl to get its path, just default to using the " current directory and the directory of the current file. diff --git a/runtime/ftplugin/reva.vim b/runtime/ftplugin/reva.vim new file mode 100644 index 0000000000..05c8bc3250 --- /dev/null +++ b/runtime/ftplugin/reva.vim @@ -0,0 +1,25 @@ +" Vim ftplugin file +" Language: Reva Forth +" Version: 7.1 +" Last Change: 2008/01/11 +" Maintainer: Ron Aaron <ron@ronware.org> +" URL: http://ronware.org/reva/ +" Filetypes: *.rf *.frt +" NOTE: Forth allows any non-whitespace in a name, so you need to do: +" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 +" +" This goes with the syntax/reva.vim file. + +" Only do this when not done yet for this buffer +if exists("b:did_ftplugin") + finish +endif + +" Don't load another plugin for this buffer +let b:did_ftplugin = 1 + +setlocal sts=4 sw=4 +setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\ +setlocal fo=tcrqol +setlocal matchpairs+=\::; +setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim index 694a6fd9c1..1d4347a9a7 100644 --- a/runtime/ftplugin/ruby.vim +++ b/runtime/ftplugin/ruby.vim @@ -227,4 +227,4 @@ endfunction " differs on Windows. Email gsinclair@soyabean.com.au if you need help. " -" vim: nowrap sw=2 sts=2 ts=8 ff=unix: +" vim: nowrap sw=2 sts=2 ts=8: |