annotate runtime/ftplugin/perl.vim @ 27771:df3a758a62ba

Added tag v8.2.4411 for changeset 219471ed2fecb3749abc0142480ef89673d11dd0
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Feb 2022 22:45:04 +0100
parents bd021eb62e73
children d1fe80fb35e6
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
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
2 " Language: Perl
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
3 " Maintainer: vim-perl <vim-perl@googlegroups.com>
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
4 " Homepage: https://github.com/vim-perl/vim-perl
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
5 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
6 " Last Change: 2020 Apr 15
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
16 setlocal formatoptions-=t
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
17 setlocal formatoptions+=crqol
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1621
diff changeset
18 setlocal keywordprg=perldoc\ -f
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 setlocal comments=:#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 setlocal commentstring=#%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " Change the browse dialog on Win32 to show mainly Perl-related files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 if has("gui_win32")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 \ "Perl Modules (*.pm)\t*.pm\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 \ "Perl Documentation Files (*.pod)\t*.pod\n" .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 \ "All Files (*.*)\t*.*\n"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 " Provided by Ned Konz <ned at bike-nomad dot com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 "---------------------------------------------
603
e4c00ec07598 updated for version 7.0171
vimboss
parents: 36
diff changeset
33 setlocal include=\\<\\(use\\\|require\\)\\>
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
34 setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 setlocal define=[^A-Za-z_]
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
36 setlocal iskeyword+=:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " The following line changes a global variable but is necessary to make
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
39 " gf and similar commands work. Thanks to Andrew Pimlott for pointing
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
40 " out the problem. If this causes a problem for you, add an
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
41 " after/ftplugin/perl.vim file that contains
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " set isfname-=:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 set isfname+=:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " Set this once, globally.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 if !exists("perlpath")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 if executable("perl")
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
48 try
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 if &shellxquote != '"'
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 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 let perlpath = system("perl -e 'print join(q/,/,@INC)'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 let perlpath = substitute(perlpath,',.$',',,','')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
55 catch /E145:/
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
56 let perlpath = ".,,"
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
57 endtry
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 " 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
60 " current directory and the directory of the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 let perlpath = ".,,"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
65 " Append perlpath to the existing path value, if it is set. Since we don't
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
66 " use += to do it because of the commas in perlpath, we have to handle the
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
67 " global / local settings, too.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
68 if &l:path == ""
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
69 if &g:path == ""
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
70 let &l:path=perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
71 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
72 let &l:path=&g:path.",".perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
73 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
74 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
75 let &l:path=&l:path.",".perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
76 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 "---------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 " Undo the stuff we changed.
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
80 let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 \ " | unlet! b:browsefilter"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
83 " proper matching for matchit plugin
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
84 let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
85 let b:match_words = '\<if\>:\<elsif\>:\<else\>'
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
86
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 let &cpo = s:save_cpo
3410
94601b379f38 Updated runtime files. Add Dutch translations.
Bram Moolenaar <bram@vim.org>
parents: 2531
diff changeset
89 unlet s:save_cpo