annotate runtime/ftplugin/perl.vim @ 478:87ac4be38952 v7.0128

updated for version 7.0128
author vimboss
date Thu, 11 Aug 2005 20:11:38 +0000
parents 125e80798a85
children e4c00ec07598
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>
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
4 " Last Change: 2004 Dec 06
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
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 setlocal comments=:#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 setlocal commentstring=#%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 " Change the browse dialog on Win32 to show mainly Perl-related files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 if has("gui_win32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 \ "Perl Modules (*.pm)\t*.pm\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 \ "Perl Documentation Files (*.pod)\t*.pod\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 " Provided by Ned Konz <ned at bike-nomad dot com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 "---------------------------------------------
36
125e80798a85 updated for version 7.0021
vimboss
parents: 7
diff changeset
30 setlocal include=\\<\\(use\\|require\\)\\>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 setlocal define=[^A-Za-z_]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 " The following line changes a global variable but is necessary to make
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " gf and similar commands work. The change to iskeyword was incorrect.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Thanks to Andrew Pimlott for pointing out the problem. If this causes a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " problem for you, add an after/ftplugin/perl.vim file that contains
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " set isfname-=:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 set isfname+=:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 "setlocal iskeyword=48-57,_,A-Z,a-z,:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Set this once, globally.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 if !exists("perlpath")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 if executable("perl")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 if &shellxquote != '"'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 let perlpath = system('perl -e "print join(q/,/,@INC)"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 else
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 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 let perlpath = substitute(perlpath,',.$',',,','')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " 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
53 " current directory and the directory of the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 let perlpath = ".,,"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 let &l:path=perlpath
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 "---------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 " Undo the stuff we changed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf<" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 \ " | unlet! b:browsefilter"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 let &cpo = s:save_cpo