Mercurial > vim
comparison runtime/ftplugin/fortran.vim @ 2398:0c8219a26bc9 vim73
More runtime file updates.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 24 Jul 2010 20:57:44 +0200 |
parents | 23f82b5d2814 |
children | 91e53bcb7946 |
comparison
equal
deleted
inserted
replaced
2397:d5976fe4349d | 2398:0c8219a26bc9 |
---|---|
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.45 | 3 " Version: 0.46 |
4 " Last Change: 2006 Apr. 03 | 4 " Last Change: 2010 July 24 |
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/> | 5 " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/> |
7 " Usage: Do :help fortran-plugin from Vim | 6 " Usage: Do :help fortran-plugin from Vim |
8 " Credits: Useful suggestions were made by Stefano Zacchiroli | 7 " Credits: |
8 " Useful suggestions were made by Stefano Zacchiroli and Hendrik Merx. | |
9 | 9 |
10 " Only do these settings when not done yet for this buffer | 10 " Only do these settings when not done yet for this buffer |
11 if exists("b:did_ftplugin") | 11 if exists("b:did_ftplugin") |
12 finish | 12 finish |
13 endif | 13 endif |
25 " User guarantees fixed source form | 25 " User guarantees fixed source form |
26 let b:fortran_fixed_source = 1 | 26 let b:fortran_fixed_source = 1 |
27 else | 27 else |
28 " f90 and f95 allow both fixed and free source form | 28 " f90 and f95 allow both fixed and free source form |
29 " assume fixed source form unless signs of free source form | 29 " assume fixed source form unless signs of free source form |
30 " are detected in the first five columns of the first 250 lines | 30 " are detected in the first five columns of the first s:lmax lines |
31 " Detection becomes more accurate and time-consuming if more lines | 31 " Detection becomes more accurate and time-consuming if more lines |
32 " 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 |
33 " 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 |
34 let s:lmax = 250 | 34 let s:lmax = 500 |
35 if ( s:lmax > line("$") ) | 35 if ( s:lmax > line("$") ) |
36 let s:lmax = line("$") | 36 let s:lmax = line("$") |
37 endif | 37 endif |
38 let b:fortran_fixed_source = 1 | 38 let b:fortran_fixed_source = 1 |
39 let s:ln=1 | 39 let s:ln=1 |
40 while s:ln <= s:lmax | 40 while s:ln <= s:lmax |
41 let s:test = strpart(getline(s:ln),0,5) | 41 let s:test = strpart(getline(s:ln),0,5) |
42 if s:test[0] !~ '[Cc*!#]' && s:test !~ '^ \+[!#]' && s:test =~ '[^ 0-9\t]' | 42 if s:test !~ '^[Cc*]' && s:test !~ '^ *[!#]' && s:test =~ '[^ 0-9\t]' && s:test !~ '^[ 0-9]*\t' |
43 let b:fortran_fixed_source = 0 | 43 let b:fortran_fixed_source = 0 |
44 break | 44 break |
45 endif | 45 endif |
46 let s:ln = s:ln + 1 | 46 let s:ln = s:ln + 1 |
47 endwhile | 47 endwhile |
48 unlet! s:lmax s:ln s:test | |
48 endif | 49 endif |
49 endif | 50 endif |
50 | 51 |
51 " Set comments and textwidth according to source type | 52 " Set comments and textwidth according to source type |
52 if (b:fortran_fixed_source == 1) | 53 if (b:fortran_fixed_source == 1) |