annotate runtime/ftplugin/perl.vim @ 33649:88cad94caef9

runtime(doc): Fix typos in several documents (#13420) Commit: https://github.com/vim/vim/commit/5985879e3c36383155f84649fa42d06813a1893e Author: h_east <h.east.727@gmail.com> Date: Wed Oct 25 22:47:05 2023 +0900 runtime(doc): Fix typos in several documents (https://github.com/vim/vim/issues/13420) * Fix typos in several documents * Update runtime/doc/terminal.txt Co-authored-by: K.Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 25 Oct 2023 16:00:07 +0200
parents d84610677553
children bd3ee5abdd7a
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
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
6 " License: Vim License (see :help license)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
7 " Last Change: 2021 Nov 10
33213
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 33203
diff changeset
8 " 2023 Sep 07 by Vim Project (safety check: don't execute perl
d84610677553 runtime(perl): Update ftplugin and indent files (#13052)
Christian Brabandt <cb@256bit.org>
parents: 33203
diff changeset
9 " from current directory)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if exists("b:did_ftplugin") | finish | endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 let b:did_ftplugin = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " Make sure the continuation lines below do not cause problems in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " compatibility mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 let s:save_cpo = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 set cpo-=C
3fc0f57ecb91 updated for version 7.0001
vimboss
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
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1621
diff changeset
21 setlocal keywordprg=perldoc\ -f
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 setlocal comments=:#
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 setlocal commentstring=#%s
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " Provided by Ned Konz <ned at bike-nomad dot com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 "---------------------------------------------
603
e4c00ec07598 updated for version 7.0171
vimboss
parents: 36
diff changeset
28 setlocal include=\\<\\(use\\\|require\\)\\>
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
29 " '+' is removed to support plugins in Catalyst or DBIx::Class
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
30 " where the leading plus indicates a fully-qualified module name.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
31 setlocal includeexpr=substitute(substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','',''),'$','.pm','')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 setlocal define=[^A-Za-z_]
12499
d91cf2e26ef0 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 5277
diff changeset
33 setlocal iskeyword+=:
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " 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
36 " gf and similar commands work. Thanks to Andrew Pimlott for pointing
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
37 " out the problem.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
38 let s:old_isfname = &isfname
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 set isfname+=:
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
40 let s:new_isfname = &isfname
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
41
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
42 augroup perl_global_options
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
43 au!
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
44 exe "au BufEnter * if &filetype == 'perl' | let &isfname = '" . s:new_isfname . "' | endif"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
45 exe "au BufLeave * if &filetype == 'perl' | let &isfname = '" . s:old_isfname . "' | endif"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
46 augroup END
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
47
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
48 " Undo the stuff we changed.
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
49 let b:undo_ftplugin = "setlocal fo< kp< com< cms< inc< inex< def< isk<" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
50 \ " | let &isfname = '" . s:old_isfname . "'"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
51
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
52 if get(g:, 'perl_fold', 0)
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
53 setlocal foldmethod=syntax
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
54 let b:undo_ftplugin .= " | setlocal fdm<"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
55 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " Set this once, globally.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 if !exists("perlpath")
33196
8bc48ca90534 runtime(ftplugin): allow to exec if curdir is in PATH
Christian Brabandt <cb@256bit.org>
parents: 33096
diff changeset
59 let s:tmp_cwd = getcwd()
33203
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
60 " safety check: don't execute perl binary by default
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
61 if executable("perl") && get(g:, 'perl_exec', get(g:, 'plugin_exec', 0))
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
62 \ && (fnamemodify(exepath("perl"), ":p:h") != s:tmp_cwd
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
63 \ || (index(split($PATH, has("win32") ? ';' : ':'), s:tmp_cwd) != -1
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
64 \ && s:tmp_cwd != '.'))
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
65 try
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 if &shellxquote != '"'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 let perlpath = system('perl -e "print join(q/,/,@INC)"')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 let perlpath = system("perl -e 'print join(q/,/,@INC)'")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 let perlpath = substitute(perlpath,',.$',',,','')
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
72 catch /E145:/
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
73 let perlpath = ".,,"
82b5078be2dd updated for version 7.2a
vimboss
parents: 603
diff changeset
74 endtry
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " 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
77 " current directory and the directory of the current file.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 let perlpath = ".,,"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 endif
33203
c3c347a71e05 runtime: don't execute external commands when loading ftplugins
Christian Brabandt <cb@256bit.org>
parents: 33196
diff changeset
80 unlet! s:tmp_cwd
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 endif
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 " 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
84 " 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
85 " global / local settings, too.
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
86 if &l:path == ""
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
87 if &g:path == ""
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
88 let &l:path=perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
89 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
90 let &l:path=&g:path.",".perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
91 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
92 else
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
93 let &l:path=&l:path.",".perlpath
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
94 endif
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
95
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
96 let b:undo_ftplugin .= " | setlocal pa<"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 "---------------------------------------------
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
99 " Change the browse dialog to show mainly Perl-related files
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
100 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
101 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
102 \ "Perl Modules (*.pm)\t*.pm\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
103 \ "Perl Documentation Files (*.pod)\t*.pod\n" .
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
104 \ "All Files (*.*)\t*.*\n"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
105 let b:undo_ftplugin .= " | unlet! b:browsefilter"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
106 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
108 " Proper matching for matchit plugin
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
109 if exists("loaded_matchit") && !exists("b:match_words")
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
110 let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
111 let b:match_words = '\<if\>:\<elsif\>:\<else\>'
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
112 let b:undo_ftplugin .= " | unlet! b:match_words b:match_skip"
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
113 endif
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 3410
diff changeset
114
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " Restore the saved compatibility options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 let &cpo = s:save_cpo
29150
d1fe80fb35e6 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
117 unlet s:save_cpo s:old_isfname s:new_isfname