summaryrefslogtreecommitdiffstats
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-01 14:50:56 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-01 14:50:56 +0200
commit543b7ef7000d08d77409478315d68b607bb8bad8 (patch)
tree387cd45294ce55a130556d4e22a0b7706156b1fd /runtime/ftplugin
parent3737fc1c30a559c82c57b5ce6aedae76cbeabaef (diff)
Updated runtime files and translations.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/cucumber.vim38
-rw-r--r--runtime/ftplugin/git.vim1
-rw-r--r--runtime/ftplugin/gitcommit.vim6
-rw-r--r--runtime/ftplugin/gprof.vim32
-rw-r--r--runtime/ftplugin/haml.vim7
-rw-r--r--runtime/ftplugin/markdown.vim5
-rw-r--r--runtime/ftplugin/perl.vim34
-rw-r--r--runtime/ftplugin/perl6.vim48
-rw-r--r--runtime/ftplugin/xs.vim9
9 files changed, 140 insertions, 40 deletions
diff --git a/runtime/ftplugin/cucumber.vim b/runtime/ftplugin/cucumber.vim
index a29d46a039..2ec1a5976f 100644
--- a/runtime/ftplugin/cucumber.vim
+++ b/runtime/ftplugin/cucumber.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Cucumber
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2010 Aug 09
+" Last Change: 2013 Jun 01
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
@@ -9,6 +9,9 @@ if (exists("b:did_ftplugin"))
endif
let b:did_ftplugin = 1
+let s:keepcpo= &cpo
+set cpo&vim
+
setlocal formatoptions-=t formatoptions+=croql
setlocal comments=:# commentstring=#\ %s
setlocal omnifunc=CucumberComplete
@@ -18,11 +21,27 @@ let b:undo_ftplugin = "setl fo< com< cms< ofu<"
let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??')
if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
- nmap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
- nmap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
- nmap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
- nmap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
- let b:undo_ftplugin .= "| sil! iunmap! <C-]>| sil! iunmap! <C-W>]| sil! iunmap! <C-W><C-]>| sil! iunmap! <C-W>}"
+ nnoremap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
+ nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
+ nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
+ nnoremap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
+ nnoremap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
+ nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR>
+ nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<CR>
+ nnoremap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
+ nnoremap <silent><buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
+ nnoremap <silent><buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
+ let b:undo_ftplugin .=
+ \ "|sil! nunmap <buffer> <C-]>" .
+ \ "|sil! nunmap <buffer> [<C-D>" .
+ \ "|sil! nunmap <buffer> ]<C-D>" .
+ \ "|sil! nunmap <buffer> <C-W>]" .
+ \ "|sil! nunmap <buffer> <C-W><C-]>" .
+ \ "|sil! nunmap <buffer> <C-W>d" .
+ \ "|sil! nunmap <buffer> <C-W><C-D>" .
+ \ "|sil! nunmap <buffer> <C-W>}" .
+ \ "|sil! nunmap <buffer> [d" .
+ \ "|sil! nunmap <buffer> ]d"
endif
function! s:jump(command,count)
@@ -38,7 +57,7 @@ function! s:jump(command,count)
endfunction
function! s:allsteps()
- let step_pattern = '\C^\s*\K\k*\>\s*\zs\S.\{-\}\ze\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
+ let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)'
let steps = []
for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
let lines = readfile(file)
@@ -55,7 +74,7 @@ function! s:allsteps()
endfunction
function! s:steps(lnum)
- let c = indent(a:lnum) + 1
+ let c = match(getline(a:lnum), '\S') + 1
while synIDattr(synID(a:lnum,c,1),'name') !~# '^$\|Region$'
let c = c + 1
endwhile
@@ -129,4 +148,7 @@ function! CucumberComplete(findstart,base) abort
return sort(steps)
endfunction
+let &cpo = s:keepcpo
+unlet s:keepcpo
+
" vim:set sts=2 sw=2:
diff --git a/runtime/ftplugin/git.vim b/runtime/ftplugin/git.vim
index c9bcd43698..5fe5b2b0c3 100644
--- a/runtime/ftplugin/git.vim
+++ b/runtime/ftplugin/git.vim
@@ -1,6 +1,7 @@
" Vim filetype plugin
" Language: generic git output
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2013 May 30
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
diff --git a/runtime/ftplugin/gitcommit.vim b/runtime/ftplugin/gitcommit.vim
index 86ee5222eb..e8619004bf 100644
--- a/runtime/ftplugin/gitcommit.vim
+++ b/runtime/ftplugin/gitcommit.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: git commit file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2012 April 7
+" Last Change: 2013 May 30
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
@@ -11,9 +11,9 @@ endif
runtime! ftplugin/git.vim
let b:did_ftplugin = 1
-setlocal nomodeline
+setlocal nomodeline tabstop=8 formatoptions-=croq formatoptions+=tl
-let b:undo_ftplugin = 'setl modeline<'
+let b:undo_ftplugin = 'setl modeline< tabstop< formatoptions<'
if &textwidth == 0
" make sure that log messages play nice with git-log on standard terminals
diff --git a/runtime/ftplugin/gprof.vim b/runtime/ftplugin/gprof.vim
new file mode 100644
index 0000000000..f76dd31aea
--- /dev/null
+++ b/runtime/ftplugin/gprof.vim
@@ -0,0 +1,32 @@
+" Language: gprof
+" Maintainer: Dominique Pelle <dominique.pelle@gmail.com>
+" Last Change: 2012 May 20
+
+" When cursor is on one line of the gprof call graph,
+" calling this function jumps to this function in the call graph.
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin=1
+
+fun! <SID>GprofJumpToFunctionIndex()
+ let l:line = getline('.')
+ if l:line =~ '[\d\+\]$'
+ " We're in a line in the call graph.
+ norm $y%
+ call search('^' . escape(@", '[]'), 'sw')
+ norm zz
+ elseif l:line =~ '^\(\s\+[0-9\.]\+\)\{3}\s\+'
+ " We're in line in the flat profile.
+ norm 55|y$
+ call search('^\[\d\+\].*\d\s\+' . escape(@", '[]*.'), 'sW')
+ norm zz
+ endif
+endfun
+
+" Pressing <C-]> on a line in the gprof flat profile or in
+" the call graph, jumps to the corresponding function inside
+" the flat profile.
+map <silent> <C-]> :call <SID>GprofJumpToFunctionIndex()<CR>
+
+" vim:sw=2 fdm=indent
diff --git a/runtime/ftplugin/haml.vim b/runtime/ftplugin/haml.vim
index 05be7f8b76..654f1fca90 100644
--- a/runtime/ftplugin/haml.vim
+++ b/runtime/ftplugin/haml.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin
-" Language: Haml
-" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2012 Mar 11
+" Language: Haml
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Last Change: 2013 Jun 01
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -18,6 +18,7 @@ let s:match_words = ""
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
unlet! b:did_ftplugin
+set matchpairs-=<:>
" Override our defaults if these were set by an included ftplugin.
if exists("b:undo_ftplugin")
diff --git a/runtime/ftplugin/markdown.vim b/runtime/ftplugin/markdown.vim
index 53430d316a..5d6ebecd8c 100644
--- a/runtime/ftplugin/markdown.vim
+++ b/runtime/ftplugin/markdown.vim
@@ -1,17 +1,16 @@
" Vim filetype plugin
" Language: Markdown
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
-" Last Change: 2011 Dec 14
+" Last Change: 2013 May 30
if exists("b:did_ftplugin")
finish
endif
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
-unlet! b:did_ftplugin
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
-setlocal formatoptions+=tcqln
+setlocal formatoptions+=tcqln formatoptions-=r formatoptions-=o
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^[-*+]\\s\\+
if exists('b:undo_ftplugin')
diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim
index fbfc0e5f81..6508356401 100644
--- a/runtime/ftplugin/perl.vim
+++ b/runtime/ftplugin/perl.vim
@@ -1,8 +1,9 @@
" Vim filetype plugin file
-" Language: Perl
-" Maintainer: Andy Lester <andy@petdance.com>
-" URL: http://github.com/petdance/vim-perl
-" Last Change: 2012 Mar 11
+" Language: Perl
+" Maintainer: vim-perl <vim-perl@googlegroups.com>
+" Homepage: http://github.com/vim-perl/vim-perl
+" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
+" Last Change: 2013-05-11
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
@@ -12,7 +13,8 @@ let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo-=C
-setlocal formatoptions+=crq
+setlocal formatoptions-=t
+setlocal formatoptions+=crqol
setlocal keywordprg=perldoc\ -f
setlocal comments=:#
@@ -29,7 +31,7 @@ endif
" Provided by Ned Konz <ned at bike-nomad dot com>
"---------------------------------------------
setlocal include=\\<\\(use\\\|require\\)\\>
-setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
+setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','')
setlocal define=[^A-Za-z_]
" The following line changes a global variable but is necessary to make
@@ -38,7 +40,7 @@ setlocal define=[^A-Za-z_]
" problem for you, add an after/ftplugin/perl.vim file that contains
" set isfname-=:
set isfname+=:
-"setlocal iskeyword=48-57,_,A-Z,a-z,:
+set iskeyword+=:
" Set this once, globally.
if !exists("perlpath")
@@ -60,13 +62,27 @@ if !exists("perlpath")
endif
endif
-let &l:path=perlpath
+" Append perlpath to the existing path value, if it is set. Since we don't
+" use += to do it because of the commas in perlpath, we have to handle the
+" global / local settings, too.
+if &l:path == ""
+ if &g:path == ""
+ let &l:path=perlpath
+ else
+ let &l:path=&g:path.",".perlpath
+ endif
+else
+ let &l:path=&l:path.",".perlpath
+endif
"---------------------------------------------
" Undo the stuff we changed.
-let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp<" .
+let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
\ " | unlet! b:browsefilter"
+" proper matching for matchit plugin
+let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
+
" Restore the saved compatibility options.
let &cpo = s:save_cpo
unlet s:save_cpo
diff --git a/runtime/ftplugin/perl6.vim b/runtime/ftplugin/perl6.vim
index 77238ed001..4168e7ff43 100644
--- a/runtime/ftplugin/perl6.vim
+++ b/runtime/ftplugin/perl6.vim
@@ -1,9 +1,10 @@
" Vim filetype plugin file
-" Language: Perl 6
-" Maintainer: Andy Lester <andy@petdance.com>
-" URL: http://github.com/petdance/vim-perl/tree/master
-" Last Change: 2012 Mar 11
-" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
+" Language: Perl 6
+" Maintainer: vim-perl <vim-perl@googlegroups.com>
+" Homepage: http://github.com/vim-perl/vim-perl
+" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
+" Last Change: 2013-05-11
+" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
"
" Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com>
@@ -15,16 +16,19 @@ let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo-=C
-setlocal formatoptions+=crq
+setlocal formatoptions-=t
+setlocal formatoptions+=crqol
+setlocal keywordprg=p6doc
+
setlocal comments=:#
setlocal commentstring=#%s
" Change the browse dialog on Win32 to show mainly Perl-related files
if has("gui_win32")
let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
- \ "Perl Modules (*.pm)\t*.pm\n" .
- \ "Perl Documentation Files (*.pod)\t*.pod\n" .
- \ "All Files (*.*)\t*.*\n"
+ \ "Perl Modules (*.pm)\t*.pm\n" .
+ \ "Perl Documentation Files (*.pod)\t*.pod\n" .
+ \ "All Files (*.*)\t*.*\n"
endif
" Provided by Ned Konz <ned at bike-nomad dot com>
@@ -39,10 +43,34 @@ setlocal define=[^A-Za-z_]
" after/ftplugin/perl6.vim file that contains
" set isfname-=:
set isfname+=:
+setlocal iskeyword=48-57,_,A-Z,a-z,:,-
+
+" Set this once, globally.
+if !exists("perlpath")
+ if executable("perl6")
+ try
+ if &shellxquote != '"'
+ let perlpath = system('perl6 -e "@*INC.join(q/,/).say"')
+ else
+ let perlpath = system("perl6 -e '@*INC.join(q/,/).say'")
+ 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.
+ let perlpath = ".,,"
+ endif
+endif
+
+let &l:path=perlpath
+"---------------------------------------------
" Undo the stuff we changed.
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk<" .
- \ " | unlet! b:browsefilter"
+ \ " | unlet! b:browsefilter"
" Restore the saved compatibility options.
let &cpo = s:save_cpo
diff --git a/runtime/ftplugin/xs.vim b/runtime/ftplugin/xs.vim
index 24df05d736..6e4d99fb98 100644
--- a/runtime/ftplugin/xs.vim
+++ b/runtime/ftplugin/xs.vim
@@ -1,8 +1,9 @@
" Vim filetype plugin file
-" Language: XS (Perl extension interface language)
-" Maintainer: Andy Lester <andy@petdance.com>
-" URL: http://github.com/petdance/vim-perl
-" Last Change: 2009-08-14
+" Language: XS (Perl extension interface language)
+" Maintainer: vim-perl <vim-perl@googlegroups.com>
+" Homepage: http://github.com/vim-perl/vim-perl
+" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
+" Last Change: 2009-08-14
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")