annotate runtime/ftplugin/perl6.vim @ 16053:b6ce2c4d15a8

Added tag v8.1.1031 for changeset 853d730973257657fb20abc9d4c5f7e31e5ed700
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 Mar 2019 21:30:06 +0100
parents 42bf9264e64e
children bd021eb62e73
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
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
2 " Language: Perl 6
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
4 " Homepage: http://github.com/vim-perl/vim-perl
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
5 " Bugs/requests: http://github.com/vim-perl/vim-perl/issues
5277
42bf9264e64e Update runtime files.
Bram Moolenaar <bram@vim.org>
parents: 5239
diff changeset
6 " Last Change: 2013-07-21
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
7 " Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
2531
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 "
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 " 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
10
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 if exists("b:did_ftplugin") | finish | endif
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12 let b:did_ftplugin = 1
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
13
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
14 " Make sure the continuation lines below do not cause problems in
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
15 " compatibility mode.
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
16 let s:save_cpo = &cpo
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
17 set cpo-=C
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
18
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
19 setlocal formatoptions-=t
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
20 setlocal formatoptions+=crqol
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
21 setlocal keywordprg=p6doc
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
22
2531
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 setlocal comments=:#
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 setlocal commentstring=#%s
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
26 " Change the browse dialog on Win32 to show mainly Perl-related files
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
27 if has("gui_win32")
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
28 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
29 \ "Perl Modules (*.pm)\t*.pm\n" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
30 \ "Perl Documentation Files (*.pod)\t*.pod\n" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
31 \ "All Files (*.*)\t*.*\n"
2531
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
32 endif
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
33
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
34 " Provided by Ned Konz <ned at bike-nomad dot com>
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 setlocal include=\\<\\(use\\\|require\\)\\>
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
37 setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
38 setlocal define=[^A-Za-z_]
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
39
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
40 " The following line changes a global variable but is necessary to make
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
41 " gf and similar commands work. Thanks to Andrew Pimlott for pointing out
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 " the problem. If this causes a " problem for you, add an
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 " after/ftplugin/perl6.vim file that contains
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 " set isfname-=:
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45 set isfname+=:
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
46 setlocal iskeyword=48-57,_,A-Z,a-z,:,-
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
47
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
48 " Set this once, globally.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
49 if !exists("perlpath")
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
50 if executable("perl6")
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
51 try
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
52 if &shellxquote != '"'
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
53 let perlpath = system('perl6 -e "@*INC.join(q/,/).say"')
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
54 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
55 let perlpath = system("perl6 -e '@*INC.join(q/,/).say'")
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
56 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
57 let perlpath = substitute(perlpath,',.$',',,','')
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
58 catch /E145:/
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
59 let perlpath = ".,,"
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
60 endtry
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
61 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
62 " If we can't call perl to get its path, just default to using the
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
63 " current directory and the directory of the current file.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
64 let perlpath = ".,,"
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
65 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
66 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
67
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
68 let &l:path=perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
69 "---------------------------------------------
2531
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
70
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71 " Undo the stuff we changed.
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
72 let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk<" .
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
73 \ " | unlet! b:browsefilter"
2531
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 " Restore the saved compatibility options.
c9022997af9e Runtime file updates.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76 let &cpo = s:save_cpo
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2566
diff changeset
77 unlet s:save_cpo