summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ftplugin/perl6.vim3
-rw-r--r--runtime/syntax/perl.vim59
-rw-r--r--runtime/syntax/pod.vim1
3 files changed, 30 insertions, 33 deletions
diff --git a/runtime/ftplugin/perl6.vim b/runtime/ftplugin/perl6.vim
index 70339ff6b..49d829b76 100644
--- a/runtime/ftplugin/perl6.vim
+++ b/runtime/ftplugin/perl6.vim
@@ -2,7 +2,7 @@
" Language: Perl 6
" Maintainer: Andy Lester <andy@petdance.com>
" URL: http://github.com/petdance/vim-perl/tree/master
-" Last Change: 2009-04-18
+" Last Change: 2010-08-10
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
"
" Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com>
@@ -32,7 +32,6 @@ endif
setlocal include=\\<\\(use\\\|require\\)\\>
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
setlocal define=[^A-Za-z_]
-setlocal iskeyword=@,48-57,_,192-255
" The following line changes a global variable but is necessary to make
" gf and similar commands work. Thanks to Andrew Pimlott for pointing out
diff --git a/runtime/syntax/perl.vim b/runtime/syntax/perl.vim
index ca5e09953..5510c4b61 100644
--- a/runtime/syntax/perl.vim
+++ b/runtime/syntax/perl.vim
@@ -2,7 +2,7 @@
" Language: Perl 5
" Maintainer: Andy Lester <andy@petdance.com>
" URL: http://github.com/petdance/vim-perl/tree/master
-" Last Change: 2009-09-2
+" Last Change: 2010-08-10
" Contributors: Andy Lester <andy@petdance.com>
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
" Lukas Mai <l.mai.web.de>
@@ -28,37 +28,8 @@
" let perl_nofold_packages = 1
" let perl_nofold_subs = 1
-if version < 600
- echoerr ">=vim-6.0 is required to run perl.vim"
+if exists("b:current_syntax")
finish
-elseif exists("b:current_syntax")
- finish
-endif
-
-"
-" Folding
-
-if exists("perl_fold")
- " Note: this bit must come before the actual highlighting of the "package"
- " keyword, otherwise this will screw up Pod lines that match /^package/
- if !exists("perl_nofold_packages")
- syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
- endif
- if !exists("perl_nofold_subs")
- syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
- syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
- endif
-
- if exists("perl_fold_blocks")
- syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
- syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
- endif
-
- setlocal foldmethod=syntax
- syn sync fromstart
-else
- " fromstart above seems to set minlines even if perl_fold is not set.
- syn sync minlines=0
endif
@@ -419,6 +390,32 @@ else
syntax region perlDATA start="^__\%(DATA\|END\)__$" skip="." end="." contains=perlPOD,@perlDATA
endif
+"
+" Folding
+
+if exists("perl_fold")
+ " Note: this bit must come before the actual highlighting of the "package"
+ " keyword, otherwise this will screw up Pod lines that match /^package/
+ if !exists("perl_nofold_packages")
+ syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
+ endif
+ if !exists("perl_nofold_subs")
+ syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
+ syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
+ endif
+
+ if exists("perl_fold_blocks")
+ syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
+ syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
+ endif
+
+ setlocal foldmethod=syntax
+ syn sync fromstart
+else
+ " fromstart above seems to set minlines even if perl_fold is not set.
+ syn sync minlines=0
+endif
+
command -nargs=+ HiLink hi def link <args>
" The default highlighting.
diff --git a/runtime/syntax/pod.vim b/runtime/syntax/pod.vim
index f21e72a70..041c7c4cf 100644
--- a/runtime/syntax/pod.vim
+++ b/runtime/syntax/pod.vim
@@ -1,6 +1,7 @@
" Vim syntax file
" Language: Perl POD format
" Maintainer: Andy Lester <andy@petdance.com>
+" Previously: Scott Bigham <dsb@killerbunnies.org>
" URL: http://github.com/petdance/vim-perl
" Last Change: 2009-08-14