annotate runtime/ftplugin/perl.vim @ 1992:ada3271481ce v7.2.289

updated for version 7.2-289
author vimboss
date Wed, 11 Nov 2009 15:23:37 +0000
parents f4f8014d516e
children 7bc41231fbc7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim filetype plugin file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Perl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Dan Sharp <dwsharp at hotmail dot com>
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1621
diff changeset
4 " Last Change: 17 Jul 2008
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 setlocal formatoptions+=crq
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1621
diff changeset
16 setlocal keywordprg=perldoc\ -f
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 setlocal comments=:#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 setlocal commentstring=#%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Change the browse dialog on Win32 to show mainly Perl-related files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if has("gui_win32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 \ "Perl Modules (*.pm)\t*.pm\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 \ "Perl Documentation Files (*.pod)\t*.pod\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " Provided by Ned Konz <ned at bike-nomad dot com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 "---------------------------------------------
603
e4c00ec07598 updated for version 7.0171
vimboss
parents: 36
diff changeset
31 setlocal include=\\<\\(use\\\|require\\)\\>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 setlocal define=[^A-Za-z_]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " The following line changes a global variable but is necessary to make
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " gf and similar commands work. The change to iskeyword was incorrect.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " Thanks to Andrew Pimlott for pointing out the problem. If this causes a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " problem for you, add an after/ftplugin/perl.vim file that contains
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " set isfname-=:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 set isfname+=:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 "setlocal iskeyword=48-57,_,A-Z,a-z,:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 " Set this once, globally.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if !exists("perlpath")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if executable("perl")
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
46 try
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 if &shellxquote != '"'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 let perlpath = system('perl -e "print join(q/,/,@INC)"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 let perlpath = system("perl -e 'print join(q/,/,@INC)'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 let perlpath = substitute(perlpath,',.$',',,','')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
53 catch /E145:/
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
54 let perlpath = ".,,"
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
55 endtry
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " If we can't call perl to get its path, just default to using the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " current directory and the directory of the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 let perlpath = ".,,"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 let &l:path=perlpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 "---------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 " Undo the stuff we changed.
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1621
diff changeset
67 let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp<" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 \ " | unlet! b:browsefilter"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 let &cpo = s:save_cpo