Mercurial > vim
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 |
rev | line source |
---|---|
7 | 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 | 4 " Homepage: https://github.com/vim-perl/vim-perl |
5 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues | |
29150 | 6 " License: Vim License (see :help license) |
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 | 10 |
11 if exists("b:did_ftplugin") | finish | endif | |
12 let b:did_ftplugin = 1 | |
13 | |
14 " Make sure the continuation lines below do not cause problems in | |
15 " compatibility mode. | |
16 let s:save_cpo = &cpo | |
17 set cpo-=C | |
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 | 21 setlocal keywordprg=perldoc\ -f |
7 | 22 |
23 setlocal comments=:# | |
24 setlocal commentstring=#%s | |
25 | |
26 " Provided by Ned Konz <ned at bike-nomad dot com> | |
27 "--------------------------------------------- | |
603 | 28 setlocal include=\\<\\(use\\\|require\\)\\> |
29150 | 29 " '+' is removed to support plugins in Catalyst or DBIx::Class |
30 " where the leading plus indicates a fully-qualified module name. | |
31 setlocal includeexpr=substitute(substitute(substitute(substitute(v:fname,'+','',''),'::','/','g'),'->\*','',''),'$','.pm','') | |
7 | 32 setlocal define=[^A-Za-z_] |
12499 | 33 setlocal iskeyword+=: |
7 | 34 |
35 " The following line changes a global variable but is necessary to make | |
12499 | 36 " gf and similar commands work. Thanks to Andrew Pimlott for pointing |
29150 | 37 " out the problem. |
38 let s:old_isfname = &isfname | |
7 | 39 set isfname+=: |
29150 | 40 let s:new_isfname = &isfname |
41 | |
42 augroup perl_global_options | |
43 au! | |
44 exe "au BufEnter * if &filetype == 'perl' | let &isfname = '" . s:new_isfname . "' | endif" | |
45 exe "au BufLeave * if &filetype == 'perl' | let &isfname = '" . s:old_isfname . "' | endif" | |
46 augroup END | |
47 | |
48 " Undo the stuff we changed. | |
49 let b:undo_ftplugin = "setlocal fo< kp< com< cms< inc< inex< def< isk<" . | |
50 \ " | let &isfname = '" . s:old_isfname . "'" | |
51 | |
52 if get(g:, 'perl_fold', 0) | |
53 setlocal foldmethod=syntax | |
54 let b:undo_ftplugin .= " | setlocal fdm<" | |
55 endif | |
7 | 56 |
57 " Set this once, globally. | |
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 | 65 try |
7 | 66 if &shellxquote != '"' |
67 let perlpath = system('perl -e "print join(q/,/,@INC)"') | |
68 else | |
69 let perlpath = system("perl -e 'print join(q/,/,@INC)'") | |
70 endif | |
71 let perlpath = substitute(perlpath,',.$',',,','') | |
1621 | 72 catch /E145:/ |
73 let perlpath = ".,," | |
74 endtry | |
7 | 75 else |
76 " If we can't call perl to get its path, just default to using the | |
77 " current directory and the directory of the current file. | |
78 let perlpath = ".,," | |
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 | 81 endif |
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 | 95 |
96 let b:undo_ftplugin .= " | setlocal pa<" | |
7 | 97 "--------------------------------------------- |
98 | |
29150 | 99 " Change the browse dialog to show mainly Perl-related files |
100 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") | |
101 let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . | |
102 \ "Perl Modules (*.pm)\t*.pm\n" . | |
103 \ "Perl Documentation Files (*.pod)\t*.pod\n" . | |
104 \ "All Files (*.*)\t*.*\n" | |
105 let b:undo_ftplugin .= " | unlet! b:browsefilter" | |
106 endif | |
7 | 107 |
29150 | 108 " Proper matching for matchit plugin |
109 if exists("loaded_matchit") && !exists("b:match_words") | |
110 let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField' | |
111 let b:match_words = '\<if\>:\<elsif\>:\<else\>' | |
112 let b:undo_ftplugin .= " | unlet! b:match_words b:match_skip" | |
113 endif | |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
3410
diff
changeset
|
114 |
7 | 115 " Restore the saved compatibility options. |
116 let &cpo = s:save_cpo | |
29150 | 117 unlet s:save_cpo s:old_isfname s:new_isfname |