Fix placement of auxiliary IM window for Core Text
[MacVim.git] / runtime / ftplugin / perl.vim
blob318e70ff976244b0431a62d868eca8dba511635f
1 " Vim filetype plugin file
2 " Language:     Perl
3 " Maintainer:   Dan Sharp <dwsharp at users dot sourceforge dot net>
4 " Last Change:  20 Jan 2009
5 " URL:          http://dwsharp.users.sourceforge.net/vim/ftplugin
7 if exists("b:did_ftplugin") | finish | endif
8 let b:did_ftplugin = 1
10 " Make sure the continuation lines below do not cause problems in
11 " compatibility mode.
12 let s:save_cpo = &cpo
13 set cpo-=C
15 setlocal formatoptions+=crq
16 setlocal keywordprg=perldoc\ -f
18 setlocal comments=:#
19 setlocal commentstring=#%s
21 " Change the browse dialog on Win32 to show mainly Perl-related files
22 if has("gui_win32")
23     let b:browsefilter = "Perl Source Files (*.pl)\t*.pl\n" .
24                        \ "Perl Modules (*.pm)\t*.pm\n" .
25                        \ "Perl Documentation Files (*.pod)\t*.pod\n" .
26                        \ "All Files (*.*)\t*.*\n"
27 endif
29 " Provided by Ned Konz <ned at bike-nomad dot com>
30 "---------------------------------------------
31 setlocal include=\\<\\(use\\\|require\\)\\>
32 setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
33 setlocal define=[^A-Za-z_]
35 " The following line changes a global variable but is necessary to make
36 " gf and similar commands work.  The change to iskeyword was incorrect.
37 " Thanks to Andrew Pimlott for pointing out the problem. If this causes a
38 " problem for you, add an after/ftplugin/perl.vim file that contains
39 "       set isfname-=:
40 set isfname+=:
41 "setlocal iskeyword=48-57,_,A-Z,a-z,:
43 " Set this once, globally.
44 if !exists("perlpath")
45     if executable("perl")
46       try
47         if &shellxquote != '"'
48             let perlpath = system('perl -e "print join(q/,/,@INC)"')
49         else
50             let perlpath = system("perl -e 'print join(q/,/,@INC)'")
51         endif
52         let perlpath = substitute(perlpath,',.$',',,','')
53       catch /E145:/
54         let perlpath = ".,,"
55       endtry
56     else
57         " If we can't call perl to get its path, just default to using the
58         " current directory and the directory of the current file.
59         let perlpath = ".,,"
60     endif
61 endif
63 let &l:path=perlpath
64 "---------------------------------------------
66 " Undo the stuff we changed.
67 let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp<" .
68             \         " | unlet! b:browsefilter"
70 " Restore the saved compatibility options.
71 let &cpo = s:save_cpo