|
1 | | -*syntax.txt* For Vim version 7.4. Last change: 2015 Nov 05 |
| 1 | +*syntax.txt* For Vim version 7.4. Last change: 2015 Dec 19 |
2 | 2 |
|
3 | 3 |
|
4 | 4 | VIM REFERENCE MANUAL by Bram Moolenaar |
@@ -1438,34 +1438,27 @@ form, then > |
1438 | 1438 | :let fortran_fixed_source=1 |
1439 | 1439 | in your .vimrc prior to the :syntax on command. |
1440 | 1440 |
|
1441 | | -If the form of the source code depends upon the file extension, then it is |
1442 | | -most convenient to set fortran_free_source in a ftplugin file. For more |
1443 | | -information on ftplugin files, see |ftplugin|. For example, if all your |
1444 | | -fortran files with an .f90 extension are written in free source form and the |
1445 | | -rest in fixed source form, add the following code to your ftplugin file > |
1446 | | - let s:extfname = expand("%:e") |
1447 | | - if s:extfname ==? "f90" |
1448 | | - let fortran_free_source=1 |
1449 | | - unlet! fortran_fixed_source |
1450 | | - else |
1451 | | - let fortran_fixed_source=1 |
1452 | | - unlet! fortran_free_source |
1453 | | - endif |
1454 | | -Note that this will work only if the "filetype plugin indent on" command |
1455 | | -precedes the "syntax on" command in your .vimrc file. |
| 1441 | +If the form of the source code depends, in a non-standard way, upon the file |
| 1442 | +extension, then it is most convenient to set fortran_free_source in a ftplugin |
| 1443 | +file. For more information on ftplugin files, see |ftplugin|. Note that this |
| 1444 | +will work only if the "filetype plugin indent on" command precedes the "syntax |
| 1445 | +on" command in your .vimrc file. |
1456 | 1446 |
|
1457 | 1447 | When you edit an existing fortran file, the syntax script will assume free |
1458 | 1448 | source form if the fortran_free_source variable has been set, and assumes |
1459 | 1449 | fixed source form if the fortran_fixed_source variable has been set. If |
1460 | 1450 | neither of these variables have been set, the syntax script attempts to |
1461 | | -determine which source form has been used by examining the first five columns |
1462 | | -of the first 250 lines of your file. If no signs of free source form are |
1463 | | -detected, then the file is assumed to be in fixed source form. The algorithm |
1464 | | -should work in the vast majority of cases. In some cases, such as a file that |
1465 | | -begins with 250 or more full-line comments, the script may incorrectly decide |
1466 | | -that the fortran code is in fixed form. If that happens, just add a |
1467 | | -non-comment statement beginning anywhere in the first five columns of the |
1468 | | -first twenty five lines, save (:w) and then reload (:e!) the file. |
| 1451 | +determine which source form has been used by examining the file extension |
| 1452 | +using conventions common to the ifort, gfortran, Cray, NAG, and PathScale |
| 1453 | +compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for |
| 1454 | +free-source). If none of this works, then the script examines the first five |
| 1455 | +columns of the first 500 lines of your file. If no signs of free source form |
| 1456 | +are detected, then the file is assumed to be in fixed source form. The |
| 1457 | +algorithm should work in the vast majority of cases. In some cases, such as a |
| 1458 | +file that begins with 500 or more full-line comments, the script may |
| 1459 | +incorrectly decide that the fortran code is in fixed form. If that happens, |
| 1460 | +just add a non-comment statement beginning anywhere in the first five columns |
| 1461 | +of the first twenty five lines, save (:w) and then reload (:e!) the file. |
1469 | 1462 |
|
1470 | 1463 | Tabs in fortran files ~ |
1471 | 1464 | Tabs are not recognized by the Fortran standards. Tabs are not a good idea in |
|
0 commit comments