Bram Moolenaar | 9de9997 | 2010-08-09 22:33:06 +0200 | [diff] [blame] | 1 | " Vim filetype plugin file |
| 2 | " Language: Perl 6 |
| 3 | " Maintainer: Andy Lester <andy@petdance.com> |
| 4 | " URL: http://github.com/petdance/vim-perl/tree/master |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 5 | " Last Change: 2012 Mar 11 |
Bram Moolenaar | 9de9997 | 2010-08-09 22:33:06 +0200 | [diff] [blame] | 6 | " Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com> |
| 7 | " |
| 8 | " Based on ftplugin/perl.vim by Dan Sharp <dwsharp at hotmail dot com> |
| 9 | |
| 10 | if exists("b:did_ftplugin") | finish | endif |
| 11 | let b:did_ftplugin = 1 |
| 12 | |
| 13 | " Make sure the continuation lines below do not cause problems in |
| 14 | " compatibility mode. |
| 15 | let s:save_cpo = &cpo |
| 16 | set cpo-=C |
| 17 | |
| 18 | setlocal formatoptions+=crq |
| 19 | setlocal comments=:# |
| 20 | setlocal commentstring=#%s |
| 21 | |
| 22 | " Change the browse dialog on Win32 to show mainly Perl-related files |
| 23 | if has("gui_win32") |
| 24 | let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" . |
| 25 | \ "Perl Modules (*.pm)\t*.pm\n" . |
| 26 | \ "Perl Documentation Files (*.pod)\t*.pod\n" . |
| 27 | \ "All Files (*.*)\t*.*\n" |
| 28 | endif |
| 29 | |
| 30 | " Provided by Ned Konz <ned at bike-nomad dot com> |
| 31 | "--------------------------------------------- |
| 32 | setlocal include=\\<\\(use\\\|require\\)\\> |
| 33 | setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','') |
| 34 | setlocal define=[^A-Za-z_] |
Bram Moolenaar | 9de9997 | 2010-08-09 22:33:06 +0200 | [diff] [blame] | 35 | |
| 36 | " The following line changes a global variable but is necessary to make |
| 37 | " gf and similar commands work. Thanks to Andrew Pimlott for pointing out |
| 38 | " the problem. If this causes a " problem for you, add an |
| 39 | " after/ftplugin/perl6.vim file that contains |
| 40 | " set isfname-=: |
| 41 | set isfname+=: |
| 42 | |
Bram Moolenaar | 9de9997 | 2010-08-09 22:33:06 +0200 | [diff] [blame] | 43 | " Undo the stuff we changed. |
| 44 | let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk<" . |
| 45 | \ " | unlet! b:browsefilter" |
| 46 | |
| 47 | " Restore the saved compatibility options. |
| 48 | let &cpo = s:save_cpo |
Bram Moolenaar | 84f7235 | 2012-03-11 15:57:40 +0100 | [diff] [blame] | 49 | unlet s:save_cpo |