summaryrefslogtreecommitdiffstats
path: root/runtime/indent
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-12-29 19:10:25 +0100
committerBram Moolenaar <Bram@vim.org>2015-12-29 19:10:25 +0100
commit256972a9849b5d575b62a6a71be5b6934b5b0e8b (patch)
treedd9f8e5b91050090c005e8b81135e14af2a19e16 /runtime/indent
parente292d80bede5cb0b9b1ca95176ad6c3fbaae2e0a (diff)
Updated runtime files.
Diffstat (limited to 'runtime/indent')
-rw-r--r--runtime/indent/fortran.vim27
-rw-r--r--runtime/indent/sh.vim4
2 files changed, 21 insertions, 10 deletions
diff --git a/runtime/indent/fortran.vim b/runtime/indent/fortran.vim
index 2c83f26b58..d492889fc7 100644
--- a/runtime/indent/fortran.vim
+++ b/runtime/indent/fortran.vim
@@ -1,9 +1,9 @@
" Vim indent file
-" Language: Fortran 2008 (and earlier versions: 2003, 95, 90, and 77)
-" Version: 0.41
-" Last Change: 2015 Jan. 15
+" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
+" Version: 0.42
+" Last Change: 2015 Nov. 30
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
-" Usage: Do :help fortran-indent from Vim
+" Usage: For instructions, do :help fortran-indent from Vim
" Credits:
" Useful suggestions were made by: Albert Oliver Serra.
@@ -27,7 +27,10 @@ if exists("b:fortran_indent_more") || exists("g:fortran_indent_more")
endif
" Determine whether this is a fixed or free format source file
-" if this hasn't been done yet
+" if this hasn't been done yet using the priority:
+" buffer-local value
+" > global value
+" > file extension as in Intel ifort, gcc (gfortran), NAG, Pathscale, and Cray compilers
if !exists("b:fortran_fixed_source")
if exists("fortran_free_source")
" User guarantees free source form
@@ -35,13 +38,19 @@ if !exists("b:fortran_fixed_source")
elseif exists("fortran_fixed_source")
" User guarantees fixed source form
let b:fortran_fixed_source = 1
+ elseif expand("%:e") ==? "f\<90\|95\|03\|08\>"
+ " Free-form file extension defaults as in Intel ifort, gcc(gfortran), NAG, Pathscale, and Cray compilers
+ let b:fortran_fixed_source = 0
+ elseif expand("%:e") ==? "f\|f77\|for"
+ " Fixed-form file extension defaults
+ let b:fortran_fixed_source = 1
else
- " f90 and f95 allow both fixed and free source form
- " assume fixed source form unless signs of free source form
+ " Modern fortran still allows 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 more time-consuming if more lines
+ " Detection becomes more accurate and time-consuming if more lines
" are checked. Increase the limit below if you keep lots of comments at
- " the very top of each file and you have a fast computer
+ " the very top of each file and you have a fast computer.
let s:lmax = 500
if ( s:lmax > line("$") )
let s:lmax = line("$")
diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim
index b2f35b23a7..5bd8c77fab 100644
--- a/runtime/indent/sh.vim
+++ b/runtime/indent/sh.vim
@@ -3,7 +3,7 @@
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
" Original Author: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2015-07-28
+" Latest Revision: 2015-12-15
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
@@ -12,6 +12,8 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
+let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent<'
+
setlocal indentexpr=GetShIndent()
setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;&
setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix