Mercurial > vim
comparison runtime/ftplugin/fortran.vim @ 819:23f82b5d2814 v7.0c10
updated for version 7.0c10
author | vimboss |
---|---|
date | Wed, 05 Apr 2006 20:41:53 +0000 |
parents | 3fc0f57ecb91 |
children | 0c8219a26bc9 |
comparison
equal
deleted
inserted
replaced
818:1f929f3ca806 | 819:23f82b5d2814 |
---|---|
1 " Vim settings file | 1 " Vim settings file |
2 " Language: Fortran90 (and Fortran95, Fortran77, F and elf90) | 2 " Language: Fortran90 (and Fortran95, Fortran77, F and elf90) |
3 " Version: 0.44 | 3 " Version: 0.45 |
4 " Last Change: 2003 May 18 | 4 " Last Change: 2006 Apr. 03 |
5 " URL: http://www.unb.ca/chem/ajit/ftplugin/fortran.vim | 5 " URL: http://www.unb.ca/chem/ajit/ftplugin/fortran.vim |
6 " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/> | 6 " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/> |
7 " Usage: Do :help fortran-plugin from Vim | 7 " Usage: Do :help fortran-plugin from Vim |
8 " Credits: Useful suggestions were made by Stefano Zacchiroli | |
8 | 9 |
9 " Only do these settings when not done yet for this buffer | 10 " Only do these settings when not done yet for this buffer |
10 if exists("b:did_ftplugin") | 11 if exists("b:did_ftplugin") |
11 finish | 12 finish |
12 endif | 13 endif |
24 " User guarantees fixed source form | 25 " User guarantees fixed source form |
25 let b:fortran_fixed_source = 1 | 26 let b:fortran_fixed_source = 1 |
26 else | 27 else |
27 " f90 and f95 allow both fixed and free source form | 28 " f90 and f95 allow both fixed and free source form |
28 " assume fixed source form unless signs of free source form | 29 " assume fixed source form unless signs of free source form |
29 " are detected in the first five columns of the first 25 lines | 30 " are detected in the first five columns of the first 250 lines |
30 " Detection becomes more accurate and time-consuming if more lines | 31 " Detection becomes more accurate and time-consuming if more lines |
31 " are checked. Increase the limit below if you keep lots of comments at | 32 " are checked. Increase the limit below if you keep lots of comments at |
32 " the very top of each file and you have a fast computer | 33 " the very top of each file and you have a fast computer |
33 let s:lmax = 25 | 34 let s:lmax = 250 |
34 if ( s:lmax > line("$") ) | 35 if ( s:lmax > line("$") ) |
35 let s:lmax = line("$") | 36 let s:lmax = line("$") |
36 endif | 37 endif |
37 let b:fortran_fixed_source = 1 | 38 let b:fortran_fixed_source = 1 |
38 let s:ln=1 | 39 let s:ln=1 |
71 endif | 72 endif |
72 | 73 |
73 " Set 'formatoptions' to break comment and text lines but allow long lines | 74 " Set 'formatoptions' to break comment and text lines but allow long lines |
74 setlocal fo+=tcql | 75 setlocal fo+=tcql |
75 | 76 |
76 setlocal include=^#\\=\\s*include\\s\\+ | 77 setlocal include=^\\c#\\=\\s*include\\s\\+ |
78 setlocal suffixesadd+=.f95,.f90,.for,.f,.F,.f77,.ftn,.fpp | |
77 | 79 |
78 let s:cposet=&cpoptions | 80 let s:cposet=&cpoptions |
79 set cpoptions-=C | 81 set cpoptions-=C |
80 | 82 |
81 " Define patterns for the matchit plugin | 83 " Define patterns for the matchit plugin |
82 if !exists("b:match_words") | 84 if !exists("b:match_words") |
83 let s:notend = '\%(\<end\s\+\)\@<!' | 85 let s:notend = '\%(\<end\s\+\)\@<!' |
84 let s:notselect = '\%(\<select\s\+\)\@<!' | 86 let s:notselect = '\%(\<select\s\+\)\@<!' |
85 let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!' | 87 let s:notelse = '\%(\<end\s\+\|\<else\s\+\)\@<!' |
88 let s:notprocedure = '\%(\s\+procedure\>\)\@!' | |
86 let b:match_ignorecase = 1 | 89 let b:match_ignorecase = 1 |
87 let b:match_words = | 90 let b:match_words = |
88 \ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' . | 91 \ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' . |
89 \ s:notelse . '\<if\s*(.\+)\s*then\>:' . | 92 \ s:notelse . '\<if\s*(.\+)\s*then\>:' . |
90 \ '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:\<end\s*if\>,'. | 93 \ '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:\<end\s*if\>,'. |
93 \ s:notelse . '\<where\>:\<elsewhere\>:\<end\s*where\>,'. | 96 \ s:notelse . '\<where\>:\<elsewhere\>:\<end\s*where\>,'. |
94 \ s:notend . '\<type\s*[^(]:\<end\s*type\>,'. | 97 \ s:notend . '\<type\s*[^(]:\<end\s*type\>,'. |
95 \ s:notend . '\<interface\>:\<end\s*interface\>,'. | 98 \ s:notend . '\<interface\>:\<end\s*interface\>,'. |
96 \ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'. | 99 \ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'. |
97 \ s:notend . '\<function\>:\<end\s*function\>,'. | 100 \ s:notend . '\<function\>:\<end\s*function\>,'. |
98 \ s:notend . '\<module\>:\<end\s*module\>,'. | 101 \ s:notend . '\<module\>' . s:notprocedure . ':\<end\s*module\>,'. |
99 \ s:notend . '\<program\>:\<end\s*program\>' | 102 \ s:notend . '\<program\>:\<end\s*program\>' |
100 endif | 103 endif |
101 | 104 |
102 " File filters for :browse e | 105 " File filters for :browse e |
103 if has("gui_win32") && !exists("b:browsefilter") | 106 if has("gui_win32") && !exists("b:browsefilter") |