blob: 70339ff6b294f16dd886e7ce352abd797c6f2bf4 [file] [log] [blame]
Bram Moolenaar9de99972010-08-09 22:33:06 +02001" Vim filetype plugin file
2" Language: Perl 6
3" Maintainer: Andy Lester <andy@petdance.com>
4" URL: http://github.com/petdance/vim-perl/tree/master
5" Last Change: 2009-04-18
6" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
7"
8" Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com>
9
10if exists("b:did_ftplugin") | finish | endif
11let b:did_ftplugin = 1
12
13" Make sure the continuation lines below do not cause problems in
14" compatibility mode.
15let s:save_cpo = &cpo
16set cpo-=C
17
18setlocal formatoptions+=crq
19setlocal comments=:#
20setlocal commentstring=#%s
21
22" Change the browse dialog on Win32 to show mainly Perl-related files
23if has("gui_win32")
24 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
25 \ "Perl Modules (*.pm)\t*.pm\n" .
26 \ "Perl Documentation Files (*.pod)\t*.pod\n" .
27 \ "All Files (*.*)\t*.*\n"
28endif
29
30" Provided by Ned Konz <ned at bike-nomad dot com>
31"---------------------------------------------
32setlocal include=\\<\\(use\\\|require\\)\\>
33setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
34setlocal define=[^A-Za-z_]
35setlocal iskeyword=@,48-57,_,192-255
36
37" The following line changes a global variable but is necessary to make
38" gf and similar commands work. Thanks to Andrew Pimlott for pointing out
39" the problem. If this causes a " problem for you, add an
40" after/ftplugin/perl6.vim file that contains
41" set isfname-=:
42set isfname+=:
43
44" Set this once, globally.
45if !exists("perl6path")
46 if executable("perl6")
47 if &shellxquote != '"'
48 let perl6path = system('perl6 -e "print join(q/,/,@*INC)"')
49 else
50 let perl6path = system("perl6 -e 'print join(q/,/,@*INC)'")
51 endif
52 let perl6path = substitute(perl6path,',.$',',,','')
53 else
54 " If we can't call perl6 to get its path, just default to using the
55 " current directory and the directory of the current file.
56 let perl6path = ".,,"
57 endif
58endif
59
60let &l:path=perl6path
61"---------------------------------------------
62
63" Undo the stuff we changed.
64let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk<" .
65 \ " | unlet! b:browsefilter"
66
67" Restore the saved compatibility options.
68let &cpo = s:save_cpo