aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/fortran.vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin/fortran.vim')
-rw-r--r--runtime/ftplugin/fortran.vim36
1 files changed, 24 insertions, 12 deletions
diff --git a/runtime/ftplugin/fortran.vim b/runtime/ftplugin/fortran.vim
index 8f5b243b82..3c325818d3 100644
--- a/runtime/ftplugin/fortran.vim
+++ b/runtime/ftplugin/fortran.vim
@@ -1,13 +1,16 @@
" Vim settings file
-" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, 77, 66)
-" Version: (v53) 2021 April 06 (updated 2022 May 22)
-" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
+" Language: Fortran 2023 (and Fortran 2018, 2008, 2003, 95, 90, 77, 66)
+" Version: (v55) 2023 December 22
+" Maintainers: Ajit J. Thakkar <ajit@unb.ca>; <https://ajit.ext.unb.ca/>
+" Joshua Hollett <j.hollett@uwinnipeg.ca>
" Usage: For instructions, do :help fortran-plugin from Vim
" Credits:
" Version 0.1 was created in September 2000 by Ajit Thakkar.
" Since then, useful suggestions and contributions have been made, in order, by:
" Stefano Zacchiroli, Hendrik Merx, Ben Fritz, David Barnett, Eisuke Kawashima,
" Doug Kearns, and Fritz Reese.
+" Last Change: 2023 Dec 22
+" 2024 Jan 14 by Vim Project (browsefilter)
" Only do these settings when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -39,7 +42,7 @@ if !exists("b:fortran_fixed_source")
" Fixed-form file extension defaults
let b:fortran_fixed_source = 1
else
- " Modern fortran still allows both fixed and free source form
+ " Modern fortran compilers still allow both fixed and free source form
" Assume fixed source form unless signs of free source form
" are detected in the first five columns of the first s:lmax lines.
" Detection becomes more accurate and time-consuming if more lines
@@ -70,14 +73,14 @@ if (b:fortran_fixed_source == 1)
" but some vendor extensions allow longer lines
if exists("fortran_extended_line_length")
setlocal tw=132
- elseif exists("fortran_cardimage_line_length")
- setlocal tw=80
else
- setlocal tw=72
+ " The use of columns 73-80 for sequence numbers is obsolete
+ " so almost all compilers allow a textwidth of 80
+ setlocal tw=80
" If you need to add "&" on continued lines so that the code is
" compatible with both free and fixed format, then you should do so
- " in column 73 and uncomment the next line
- " setlocal tw=73
+ " in column 81 and uncomment the next line
+ " setlocal tw=81
endif
else
setlocal comments=:!
@@ -109,7 +112,9 @@ if !exists("b:match_words")
let b:match_ignorecase = 1
let b:match_words =
\ '(:),' .
- \ '\<select\s*case\>:' . s:notselect. '\<case\>:\<end\s*select\>,' .
+ \ s:notend .'\<select\s\+type\>:' . s:notselect. '\<type\|class\>:\<end\s*select\>,' .
+ \ s:notend .'\<select\s\+rank\>:' . s:notselect. '\<rank\>:\<end\s*select\>,' .
+ \ s:notend .'\<select\>:' . s:notselect. '\<case\>:\<end\s*select\>,' .
\ s:notelse . '\<if\s*(.\+)\s*then\>:' .
\ s:nothash . '\<else\s*\%(if\s*(.\+)\s*then\)\=\>:' . s:nothash . '\<end\s*if\>,'.
\ 'do\s\+\(\d\+\):\%(^\s*\)\@<=\1\s,'.
@@ -118,6 +123,9 @@ if !exists("b:match_words")
\ s:notend . '\<type\s*[^(]:\<end\s*type\>,'.
\ s:notend . '\<forall\>:\<end\s*forall\>,'.
\ s:notend . '\<associate\>:\<end\s*associate\>,'.
+ \ s:notend . '\<change\s\+team\>:\<end\s*team\>,'.
+ \ s:notend . '\<critical\>:\<end\s*critical\>,'.
+ \ s:notend . '\<block\>:\<end\s*block\>,'.
\ s:notend . '\<enum\>:\<end\s*enum\>,'.
\ s:notend . '\<interface\>:\<end\s*interface\>,'.
\ s:notend . '\<subroutine\>:\<end\s*subroutine\>,'.
@@ -129,8 +137,12 @@ endif
" File filters for :browse e
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
- let b:browsefilter = "Fortran Files (*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn)\t*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn\n" .
- \ "All Files (*.*)\t*.*\n"
+ let b:browsefilter = "Fortran Files (*.f, *.for, *.f77, *.f90, *.f95, *.f03, *.f08, *.fpp, *.ftn)\t*.f;*.for;*.f77;*.f90;*.f95;*.f03;*.f08;*.fpp;*.ftn\n"
+ if has("win32")
+ let b:browsefilter .= "All Files (*.*)\t*\n"
+ else
+ let b:browsefilter .= "All Files (*)\t*\n"
+ endif
endif
let b:undo_ftplugin = "setl fo< com< tw< cms< et< inc< sua<"