annotate runtime/ftplugin/perl6.vim @ 2548:0bb74f626ba7 vim73

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