diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2021-12-21 14:41:23 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2021-12-21 14:41:23 +0100 |
commit | 87a26c5bf169bafbee837e2323f24cfb07e35250 (patch) | |
tree | 326eb21bb10c3d3633b83263d21c85c98f92a67e /indent | |
parent | 918610d427503c5c7b380eae4a954bd8cb427db5 (diff) | |
download | vim-polyglot-87a26c5bf169bafbee837e2323f24cfb07e35250.tar.gz vim-polyglot-87a26c5bf169bafbee837e2323f24cfb07e35250.zip |
Update
Diffstat (limited to 'indent')
42 files changed, 178 insertions, 104 deletions
diff --git a/indent/ada.vim b/indent/ada.vim index 1127ca11..261d2af4 100644 --- a/indent/ada.vim +++ b/indent/ada.vim @@ -223,7 +223,7 @@ function GetAdaIndent() " Move indent in twice (next 'when' will move back) let ind = ind + 2 * shiftwidth() elseif line =~ '^\s*end\s*record\>' - " Move indent back to tallying 'type' preceeding the 'record'. + " Move indent back to tallying 'type' preceding the 'record'. " Allow indent to be equal to 'end record's. let ind = s:MainBlockIndent( ind+shiftwidth(), lnum, 'type\>', '' ) elseif line =~ '\(^\s*new\>.*\)\@<!)\s*[;,]\s*$' diff --git a/indent/ansible.vim b/indent/ansible.vim index 65a51a64..6b2c4923 100644 --- a/indent/ansible.vim +++ b/indent/ansible.vim @@ -22,6 +22,7 @@ let s:named_module_entry = '\v^\s*-\s*(name|hosts|role):\s*\S' " - name: 'do stu let s:dictionary_entry = '\v^\s*[^:-]+:\s*$' " with_items: let s:key_value = '\v^\s*[^:-]+:\s*\S' " apt: name=package let s:scalar_value = '\v:\s*[>|\|]\s*$' " shell: > +let s:blank = '\v^\s*$' " line with only spaces if exists('*GetAnsibleIndent') finish @@ -37,26 +38,29 @@ function GetAnsibleIndent(lnum) endif endif let prevlnum = prevnonblank(a:lnum - 1) - let maintain = indent(prevlnum) - let increase = maintain + &sw + let default = GetYAMLIndent(a:lnum) + let increase = indent(prevlnum) + &sw - let line = getline(prevlnum) - if line =~ s:array_entry - if line =~ s:named_module_entry + let prevline = getline(prevlnum) + let line = getline(a:lnum) + if line !~ s:blank + return default " we only special case blank lines + elseif prevline =~ s:array_entry + if prevline =~ s:named_module_entry return increase else - return maintain + return default endif - elseif line =~ s:dictionary_entry + elseif prevline =~ s:dictionary_entry return increase - elseif line =~ s:key_value - if line =~ s:scalar_value + elseif prevline =~ s:key_value + if prevline =~ s:scalar_value return increase else - return maintain + return default endif else - return maintain + return default endif endfunction diff --git a/indent/cdl.vim b/indent/cdl.vim index 4c679e83..9d39a01b 100644 --- a/indent/cdl.vim +++ b/indent/cdl.vim @@ -3,7 +3,8 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'cdl', 'indent/cdl.vim') endif " Description: Comshare Dimension Definition Language (CDL) -" Author: Raul Segura Acevedo <raulseguraaceved@netscape.net> +" Maintainer: Raul Segura Acevedo <raulseguraaceved@netscape.net> (Invalid email address) +" Doug Kearns <dougkearns@gmail.com> " Last Change: Fri Nov 30 13:35:48 2001 CST if exists("b:did_indent") @@ -20,8 +21,8 @@ if exists("*CdlGetIndent") "finish endif -" find out if an "...=..." expresion is an assignment (or a conditional) -" it scans 'line' first, and then the previos lines +" find out if an "...=..." expression is an assignment (or a conditional) +" it scans 'line' first, and then the previous lines fun! CdlAsignment(lnum, line) let f = -1 let lnum = a:lnum @@ -37,7 +38,7 @@ fun! CdlAsignment(lnum, line) endif " it's formula if there's a ';', 'elsE', 'theN', 'enDif' or 'expr' " conditional if there's a '<', '>', 'elseif', 'if', 'and', 'or', 'not', - " 'memberis', 'childrenof' and other \k\+of funcions + " 'memberis', 'childrenof' and other \k\+of functions let f = line[inicio-1] =~? '[en;]' || strpart(line, inicio-4, 4) =~? 'ndif\|expr' endw let lnum = prevnonblank(lnum-1) @@ -110,7 +111,7 @@ fun! CdlGetIndent(lnum) elseif c == '(' || c ==? 'f' " '(' or 'if' let ind = ind + shiftwidth() else " c == '=' - " if it is an asignment increase indent + " if it is an assignment increase indent if f == -1 " we don't know yet, find out let f = CdlAsignment(lnum, strpart(line, 0, inicio)) end @@ -121,11 +122,11 @@ fun! CdlGetIndent(lnum) endw " CURRENT LINE, if it starts with a closing element, decrease indent - " or if it starts with '=' (asignment), increase indent + " or if it starts with '=' (assignment), increase indent if match(thisline, '^\c\s*\(else\|then\|endif\|[);]\)') >= 0 let ind = ind - shiftwidth() elseif match(thisline, '^\s*=') >= 0 - if f == -1 " we don't know yet if is an asignment, find out + if f == -1 " we don't know yet if is an assignment, find out let f = CdlAsignment(lnum, "") end if f == 1 " formula increase it diff --git a/indent/clojure.vim b/indent/clojure.vim index 7f79c9a2..c6069324 100644 --- a/indent/clojure.vim +++ b/indent/clojure.vim @@ -60,8 +60,7 @@ if exists("*searchpairpos") endfunction function! s:ignored_region() - let name = s:syn_id_name() - return (name =~? '\vstring|regex|comment|character') && (name !~# '^clojureCommentReaderMacro\(Form\)\?$') + return s:syn_id_name() =~? '\vstring|regex|comment|character' endfunction function! s:current_char() @@ -76,14 +75,10 @@ if exists("*searchpairpos") return s:current_char() =~# '\v[\(\)\[\]\{\}]' && !s:ignored_region() endfunction - " Returns 1 if string matches a pattern in 'patterns', which may be a - " list of patterns, or a comma-delimited string of implicitly anchored - " patterns. + " Returns 1 if string matches a pattern in 'patterns', which should be + " a list of patterns. function! s:match_one(patterns, string) - let list = type(a:patterns) == type([]) - \ ? a:patterns - \ : map(split(a:patterns, ','), '"^" . v:val . "$"') - for pat in list + for pat in a:patterns if a:string =~# pat | return 1 | endif endfor endfunction diff --git a/indent/cobol.vim b/indent/cobol.vim index 7a0b7f07..37af5dcd 100644 --- a/indent/cobol.vim +++ b/indent/cobol.vim @@ -11,6 +11,7 @@ endif " Ankit Jain 22.03.2019 Changes & fixes: " Allow chars in 1st 6 columns " #C22032019 +" Ankit Jain 24.09.2021 add b:undo_indent (request by tpope) if exists("b:did_indent") finish @@ -22,6 +23,8 @@ setlocal indentexpr=GetCobolIndent(v:lnum) setlocal indentkeys& setlocal indentkeys+=0<*>,0/,0$,0=01,=~division,=~section,0=~end,0=~then,0=~else,0=~when,*<Return>,. +let b:undo_indent = "setlocal expandtab< indentexpr< indentkeys<" + " Only define the function once. if exists("*GetCobolIndent") finish diff --git a/indent/config.vim b/indent/config.vim index 986b8c4d..5b1a3aa4 100644 --- a/indent/config.vim +++ b/indent/config.vim @@ -3,11 +3,12 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'config', 'indent/config.vim') endif " Vim indent file -" Language: Autoconf configure.{ac,in} file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2006-12-20 -" TODO: how about nested [()]'s in one line -" what's wrong with '\\\@!'? +" Language: Autoconf configure.{ac,in} file +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 + +" TODO: how about nested [()]'s in one line what's wrong with '\\\@!'? " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -20,6 +21,8 @@ setlocal indentexpr=GetConfigIndent() setlocal indentkeys=!^F,o,O,=then,=do,=else,=elif,=esac,=fi,=fin,=fil,=done setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + " Only define the function once. if exists("*GetConfigIndent") finish @@ -66,8 +69,8 @@ function GetConfigIndent() let ind = s:GetOffsetOf(line, '\[') endif - " if previous line had an unmatched closing parantheses, - " indent to the matching opening parantheses + " if previous line had an unmatched closing parentheses, + " indent to the matching opening parentheses if line =~ '[^(]\+\\\@<!)$' call search(')', 'bW') let lnum = searchpair('\\\@<!(', '', ')', 'bWn') diff --git a/indent/css.vim b/indent/css.vim index b383d448..9f2bfb7a 100644 --- a/indent/css.vim +++ b/indent/css.vim @@ -3,10 +3,12 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'css', 'indent/css.vim') endif " Vim indent file -" Language: CSS -" Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2012-05-30 -" Use of shiftwidth() added by Oleg Zubchenko. +" Language: CSS +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 + +" Use of shiftwidth() added by Oleg Zubchenko. if exists("b:did_indent") finish @@ -17,7 +19,7 @@ setlocal indentexpr=GetCSSIndent() setlocal indentkeys=0{,0},!^F,o,O setlocal nosmartindent -let b:undo_indent = "setl smartindent< indentkeys< indentexpr<" +let b:undo_indent = "setl inde< indk< si<" if exists("*GetCSSIndent") finish diff --git a/indent/dosbatch.vim b/indent/dosbatch.vim index a98c3886..d91a42cd 100644 --- a/indent/dosbatch.vim +++ b/indent/dosbatch.vim @@ -6,7 +6,7 @@ endif " Language: MSDOS batch file (with NT command extensions) " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-dosbatch-indent -" Last Change: 2017 May 10 +" Last Change: 2021-10-18 " Filenames: *.bat " License: VIM License @@ -21,6 +21,8 @@ setlocal indentexpr=GetDosBatchIndent(v:lnum) setlocal indentkeys=!^F,o,O setlocal indentkeys+=0=) +let b:undo_indent = "setl ai< inde< indk< si<" + if exists("*GetDosBatchIndent") finish endif diff --git a/indent/dtd.vim b/indent/dtd.vim index 7faa9483..41363410 100644 --- a/indent/dtd.vim +++ b/indent/dtd.vim @@ -3,14 +3,17 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'dtd', 'indent/dtd.vim') endif " Vim indent file -" Language: DTD (Document Type Definition for XML) -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2011-07-08 +" Language: DTD (Document Type Definition for XML) +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 setlocal indentexpr=GetDTDIndent() setlocal indentkeys=!^F,o,O,> setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetDTDIndent") finish endif @@ -123,16 +126,16 @@ function GetDTDIndent() " Next comes the content model. If the token we’ve found isn’t a " parenthesis it must be either ANY, EMPTY or some random junk. Either " way, we’re done indenting this element, so set it to that of the first - " line so that the terminating “>” winds up having the same indention. + " line so that the terminating “>” winds up having the same indentation. if token != '(' return indent endif " Now go through the content model. We need to keep track of the nesting " of parentheses. As soon as we hit 0 we’re done. If that happens we must - " have a complete content model. Thus set indention to be the same as that + " have a complete content model. Thus set indentation to be the same as that " of the first line so that the terminating “>” winds up having the same - " indention. Otherwise, we’ll indent to the innermost parentheses not yet + " indentation. Otherwise, we’ll indent to the innermost parentheses not yet " matched. let [indent_of_innermost, end] = s:indent_to_innermost_parentheses(line, end) if indent_of_innermost != -1 diff --git a/indent/dune.vim b/indent/dune.vim index 009f7eba..429d6354 100644 --- a/indent/dune.vim +++ b/indent/dune.vim @@ -15,3 +15,5 @@ let b:did_indent = 1 " dune format-dune-file uses 1 space to indent setlocal softtabstop=1 shiftwidth=1 expandtab + +let b:undo_indent = "setl et< sts< sw<" diff --git a/indent/dylan.vim b/indent/dylan.vim index 4e83a51d..826265d7 100644 --- a/indent/dylan.vim +++ b/indent/dylan.vim @@ -4,9 +4,10 @@ endif " Vim indent file " Language: Dylan +" Maintainer: Brent A. Fulgham <bfulgham@debian.org> (Invalid email address) +" Doug Kearns <dougkearns@gmail.com> " Version: 0.01 " Last Change: 2017 Jun 13 -" Maintainer: Brent A. Fulgham <bfulgham@debian.org> " Only load this indent file when no other was loaded. if exists("b:did_indent") diff --git a/indent/erlang.vim b/indent/erlang.vim index 5a5637a7..adfd0dd9 100644 --- a/indent/erlang.vim +++ b/indent/erlang.vim @@ -36,6 +36,8 @@ endif setlocal indentexpr=ErlangIndent() setlocal indentkeys+=0=end,0=of,0=catch,0=after,0=when,0=),0=],0=},0=>> +let b:undo_indent = "setl inde< indk<" + " Only define the functions once if exists("*ErlangIndent") finish diff --git a/indent/eterm.vim b/indent/eterm.vim index 88502cf4..67738fe9 100644 --- a/indent/eterm.vim +++ b/indent/eterm.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'eterm', 'indent/eterm.vim') endif " Vim indent file -" Language: Eterm configuration file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2006-12-20 +" Language: Eterm configuration file +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 if exists("b:did_indent") finish @@ -16,6 +17,8 @@ setlocal indentexpr=GetEtermIndent() setlocal indentkeys=!^F,o,O,=end setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetEtermIndent") finish endif diff --git a/indent/framescript.vim b/indent/framescript.vim index 883f4a4d..04abe1bd 100644 --- a/indent/framescript.vim +++ b/indent/framescript.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'framescript', 'indent/framesc endif " Vim indent file -" Language: FrameScript -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2008-07-19 +" Language: FrameScript +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 if exists("b:did_indent") finish @@ -16,6 +17,8 @@ setlocal indentexpr=GetFrameScriptIndent() setlocal indentkeys=!^F,o,O,0=~Else,0=~EndIf,0=~EndLoop,0=~EndSub setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetFrameScriptIndent") finish endif diff --git a/indent/haml.vim b/indent/haml.vim index f0efff18..ae4f2d10 100644 --- a/indent/haml.vim +++ b/indent/haml.vim @@ -18,6 +18,8 @@ setlocal autoindent setlocal indentexpr=GetHamlIndent() setlocal indentkeys=o,O,*<Return>,},],0),!^F,=end,=else,=elsif,=rescue,=ensure,=when +let b:undo_indent = "setl ai< inde< indk<" + " Only define the function once. if exists("*GetHamlIndent") finish diff --git a/indent/hamster.vim b/indent/hamster.vim index 86f86bf8..0e7ced5c 100644 --- a/indent/hamster.vim +++ b/indent/hamster.vim @@ -4,9 +4,15 @@ endif " Vim indent file " Language: Hamster Script -" Version: 2.0.6.0 -" Last Change: Wed Nov 08 2006 12:02:42 PM -" Maintainer: David Fishburn <fishburn@ianywhere.com> +" Version: 2.0.6.1 +" Last Change: 2021 Oct 11 +" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com> +" Download: https://www.vim.org/scripts/script.php?script_id=1099 +" +" 2.0.6.1 (Oct 2021) +" Added b:undo_indent +" Added cpo check +" " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -18,12 +24,17 @@ setlocal indentkeys+==~if,=~else,=~endif,=~endfor,=~endwhile setlocal indentkeys+==~do,=~until,=~while,=~repeat,=~for,=~loop setlocal indentkeys+==~sub,=~endsub +let b:undo_indent = "setl indentkeys<" + " Define the appropriate indent function but only once setlocal indentexpr=HamGetFreeIndent() if exists("*HamGetFreeIndent") finish endif +let s:keepcpo = &cpo +set cpo&vim + function HamGetIndent(lnum) let ind = indent(a:lnum) let prevline=getline(a:lnum) @@ -56,4 +67,8 @@ function HamGetFreeIndent() return ind endfunction +" Restore: +let &cpo = s:keepcpo +unlet s:keepcpo + " vim:sw=2 tw=80 diff --git a/indent/javascript.vim b/indent/javascript.vim index 0a3b3bc2..c3880b45 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -23,7 +23,7 @@ setlocal indentkeys+=0],0) " "+norm! gg=G" '+%print' '+:q!' testfile.js \ " | diff -uBZ testfile.js - -let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<' +let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys< lisp<' " Only define the function once. if exists('*GetJavascriptIndent') diff --git a/indent/julia.vim b/indent/julia.vim index d118f3f4..9f7c4dd0 100644 --- a/indent/julia.vim +++ b/indent/julia.vim @@ -18,6 +18,8 @@ setlocal indentkeys-=0{ setlocal indentkeys-=0} setlocal nosmartindent +let b:undo_indent = "setl ai< inde< indk< si<" + " Only define the function once. if exists("*GetJuliaIndent") finish diff --git a/indent/kotlin.vim b/indent/kotlin.vim index 8fdb2f85..fd7e0cea 100644 --- a/indent/kotlin.vim +++ b/indent/kotlin.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'kotlin', 'indent/kotlin.vim') endif " Vim indent file -" Language: Kotlin -" Maintainer: Alexander Udalov -" Latest Revision: 26 May 2019 +" Language: Kotlin +" Maintainer: Alexander Udalov +" URL: https://github.com/udalov/kotlin-vim +" Last Change: 7 November 2021 if exists('b:did_indent') finish @@ -49,11 +50,11 @@ function! GetKotlinIndent() let cur_close_brace = cur =~ '^\s*}.*$' if prev_open_paren && !cur_close_paren || prev_open_brace && !cur_close_brace - return prev_indent + &shiftwidth + return prev_indent + shiftwidth() endif if cur_close_paren && !prev_open_paren || cur_close_brace && !prev_open_brace - return prev_indent - &shiftwidth + return prev_indent - shiftwidth() endif return prev_indent diff --git a/indent/ld.vim b/indent/ld.vim index 339c1542..6fcd2f60 100644 --- a/indent/ld.vim +++ b/indent/ld.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'ld', 'indent/ld.vim') endif " Vim indent file -" Language: ld(1) script -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2006-12-20 +" Language: ld(1) script +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 if exists("b:did_indent") finish @@ -16,6 +17,8 @@ setlocal indentexpr=GetLDIndent() setlocal indentkeys=0{,0},!^F,o,O setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetLDIndent") finish endif diff --git a/indent/lifelines.vim b/indent/lifelines.vim index 960a01b3..d569def5 100644 --- a/indent/lifelines.vim +++ b/indent/lifelines.vim @@ -15,7 +15,7 @@ endif let b:did_indent = 1 " LifeLines uses cindent without ; line terminator, C functions -" declarations, C keywords, C++ formating +" declarations, C keywords, C++ formatting setlocal cindent setlocal cinwords="" setlocal cinoptions+=+0 diff --git a/indent/mail.vim b/indent/mail.vim index 633a2da5..e5fb96bb 100644 --- a/indent/mail.vim +++ b/indent/mail.vim @@ -5,7 +5,7 @@ endif " Vim indent file " Language: Mail " Maintainer: Bram Moolenaar -" Last Change: 2009 Jun 03 +" Last Change: 2021 Sep 26 if exists("b:did_indent") finish @@ -15,3 +15,5 @@ let b:did_indent = 1 " What works best is auto-indenting, disable other indenting. " For formatting see the ftplugin. setlocal autoindent nosmartindent nocindent indentexpr= + +let b:undo_indent = "setl ai< cin< inde< si<" diff --git a/indent/make.vim b/indent/make.vim index 59e698ab..728dd944 100644 --- a/indent/make.vim +++ b/indent/make.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'make', 'indent/make.vim') endif " Vim indent file -" Language: Makefile -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2007-05-07 +" Language: Makefile +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 if exists("b:did_indent") finish @@ -16,6 +17,8 @@ setlocal indentexpr=GetMakeIndent() setlocal indentkeys=!^F,o,O,<:>,=else,=endif setlocal nosmartindent +let b:undo_indent = "setl ai< inde< indk<" + if exists("*GetMakeIndent") finish endif diff --git a/indent/meson.vim b/indent/meson.vim index 65d039e9..eb726902 100644 --- a/indent/meson.vim +++ b/indent/meson.vim @@ -24,6 +24,8 @@ setlocal autoindent " indentexpr isn't much help otherwise setlocal indentexpr=GetMesonIndent(v:lnum) setlocal indentkeys+==elif,=else,=endforeach,=endif,0) +let b:undo_indent = "setl ai< inde< indk< lisp<" + " Only define the function once. if exists("*GetMesonIndent") finish diff --git a/indent/nginx.vim b/indent/nginx.vim index e9335e7a..dedcd970 100644 --- a/indent/nginx.vim +++ b/indent/nginx.vim @@ -13,3 +13,5 @@ setlocal indentexpr= setlocal cindent " Just make sure that the comments are not reset as defs would be. setlocal cinkeys-=0# + +let b:undo_indent = "setl cin< cink< inde<" diff --git a/indent/nsis.vim b/indent/nsis.vim index d6e65634..a4c09e39 100644 --- a/indent/nsis.vim +++ b/indent/nsis.vim @@ -6,7 +6,7 @@ endif " Language: NSIS script " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-nsis -" Last Change: 2018-01-21 +" Last Change: 2021-10-18 " Filenames: *.nsi " License: VIM License @@ -21,6 +21,8 @@ setlocal indentexpr=GetNsisIndent(v:lnum) setlocal indentkeys=!^F,o,O setlocal indentkeys+==~${Else,=~${EndIf,=~${EndUnless,=~${AndIf,=~${AndUnless,=~${OrIf,=~${OrUnless,=~${Case,=~${Default,=~${EndSelect,=~${EndSwith,=~${Loop,=~${Next,=~${MementoSectionEnd,=~FunctionEnd,=~SectionEnd,=~SectionGroupEnd,=~PageExEnd,0=~!macroend,0=~!if,0=~!else,0=~!endif +let b:undo_indent = "setl ai< inde< indk< si<" + if exists("*GetNsisIndent") finish endif diff --git a/indent/ocaml.vim b/indent/ocaml.vim index 82e5825e..e2d09842 100644 --- a/indent/ocaml.vim +++ b/indent/ocaml.vim @@ -28,6 +28,8 @@ setlocal indentkeys+=0=and,0=class,0=constraint,0=done,0=else,0=end,0=exception, setlocal nolisp setlocal nosmartindent +let b:undo_indent = "setl et< inde< indk< lisp< si<" + " At least Marc Weber and Markus Mottl do not like this: " setlocal textwidth=80 @@ -37,6 +39,7 @@ if !exists("no_ocaml_comments") setlocal comments=sr:(*\ ,mb:\ ,ex:*) setlocal comments^=sr:(**,mb:\ \ ,ex:*) setlocal fo=cqort + let b:undo_indent .= " | setl com< fo<" endif endif diff --git a/indent/occam.vim b/indent/occam.vim index c9949c3f..96114354 100644 --- a/indent/occam.vim +++ b/indent/occam.vim @@ -4,7 +4,8 @@ endif " Vim indent file " Language: occam -" Maintainer: Mario Schweigler <ms44@kent.ac.uk> +" Maintainer: Mario Schweigler <ms44@kent.ac.uk> (Invalid email address) +" Doug Kearns <dougkearns@gmail.com> " Last Change: 23 April 2003 " Only load this indent file when no other was loaded. diff --git a/indent/pascal.vim b/indent/pascal.vim index d4a6a5a7..a9b95076 100644 --- a/indent/pascal.vim +++ b/indent/pascal.vim @@ -6,11 +6,9 @@ endif " Language: Pascal " Maintainer: Neil Carter <n.carter@swansea.ac.uk> " Created: 2004 Jul 13 -" Last Change: 2021 Jul 01 +" Last Change: 2021 Sep 22 " -" This is version 2.0, a complete rewrite. -" -" For further documentation, see http://psy.swansea.ac.uk/staff/carter/vim/ +" For further documentation, see https://psy.swansea.ac.uk/staff/carter/vim/ if exists("b:did_indent") @@ -24,13 +22,14 @@ setlocal indentkeys+==end;,==const,==type,==var,==begin,==repeat,==until,==for setlocal indentkeys+==program,==function,==procedure,==object,==private setlocal indentkeys+==record,==if,==else,==case -let b:undo_indent = "setl indentkeys< indentexpr<" +let b:undo_indent = 'setlocal indentexpr< indentkeys<' if exists("*GetPascalIndent") finish endif +" ________________________________________________________________ function! s:GetPrevNonCommentLineNum( line_num ) " Skip lines starting with a comment @@ -48,6 +47,7 @@ function! s:GetPrevNonCommentLineNum( line_num ) endfunction +" ________________________________________________________________ function! s:PurifyCode( line_num ) " Strip any trailing comments and whitespace let pureline = 'TODO' @@ -55,6 +55,7 @@ function! s:PurifyCode( line_num ) endfunction +" ________________________________________________________________ function! GetPascalIndent( line_num ) " Line 0 always goes at column 0 @@ -188,7 +189,7 @@ function! GetPascalIndent( line_num ) endif -" ____________________________________________________________________ +" ________________________________________________________________ " Object/Borland Pascal/Delphi Extensions " " Note that extended-pascal is handled here, unless it is simpler to @@ -226,8 +227,6 @@ function! GetPascalIndent( line_num ) endif -" ____________________________________________________________________ - " If nothing changed, return same indent. return indnt endfunction diff --git a/indent/postscr.vim b/indent/postscr.vim index e3ba7942..5388ce20 100644 --- a/indent/postscr.vim +++ b/indent/postscr.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'postscr', 'indent/postscr.vim endif " PostScript indent file -" Language: PostScript -" Maintainer: Mike Williams <mrw@netcomuk.co.uk> -" Last Change: 2nd July 2001 +" Language: PostScript +" Maintainer: Mike Williams <mrw@netcomuk.co.uk> (Invalid email address) +" Doug Kearns <dougkearns@gmail.com> +" Last Change: 2nd July 2001 " " Only load this indent file when no other was loaded. diff --git a/indent/pov.vim b/indent/pov.vim index ae2d15e8..4c19f164 100644 --- a/indent/pov.vim +++ b/indent/pov.vim @@ -48,7 +48,7 @@ function GetPoVRayIndent() return -1 endif - " Search backwards for the frist non-empty, non-comment line. + " Search backwards for the first non-empty, non-comment line. let plnum = prevnonblank(v:lnum - 1) let plind = indent(plnum) while plnum > 0 && synIDattr(synID(plnum, plind+1, 0), "name") =~? "comment" diff --git a/indent/prolog.vim b/indent/prolog.vim index d23510a7..0aef18e8 100644 --- a/indent/prolog.vim +++ b/indent/prolog.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'prolog', 'indent/prolog.vim') endif " vim: set sw=4 sts=4: -" Maintainer : Gergely Kontra <kgergely@mcl.hu> -" Revised on : 2002.02.18. 23:34:05 -" Language : Prolog +" Language: Prolog +" Maintainer: Gergely Kontra <kgergely@mcl.hu> (Invalid email address) +" Doug Kearns <dougkearns@gmail.com> +" Revised on: 2002.02.18. 23:34:05 " Last change by: Takuya Fujiwara, 2018 Sep 23 " TODO: diff --git a/indent/readline.vim b/indent/readline.vim index 100878fa..21cb0875 100644 --- a/indent/readline.vim +++ b/indent/readline.vim @@ -3,9 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'readline', 'indent/readline.v endif " Vim indent file -" Language: readline configuration file -" Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2006-12-20 +" Language: readline configuration file +" Maintainer: Doug Kearns <dougkearns@gmail.com> +" Previous Maintainer: Nikolai Weibull <now@bitwi.se> +" Last Change: 24 Sep 2021 if exists("b:did_indent") finish @@ -16,6 +17,8 @@ setlocal indentexpr=GetReadlineIndent() setlocal indentkeys=!^F,o,O,=$else,=$endif setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetReadlineIndent") finish endif diff --git a/indent/rust.vim b/indent/rust.vim index 8be1cc03..87f3d6ad 100644 --- a/indent/rust.vim +++ b/indent/rust.vim @@ -28,6 +28,8 @@ setlocal indentkeys=0{,0},!^F,o,O,0[,0],0(,0) setlocal indentexpr=GetRustIndent(v:lnum) +let b:undo_indent = "setlocal cindent< cinoptions< cinkeys< cinwords< lisp< autoindent< indentkeys< indentexpr<" + " Only define the function once. if exists("*GetRustIndent") finish diff --git a/indent/sdl.vim b/indent/sdl.vim index 19c9d264..7046c524 100644 --- a/indent/sdl.vim +++ b/indent/sdl.vim @@ -5,7 +5,7 @@ endif " Vim indent file " Language: SDL " Maintainer: Michael Piefel <entwurf@piefel.de> -" Last Change: 10 December 2011 +" Last Change: 2021 Oct 03 " Shamelessly stolen from the Vim-Script indent file @@ -18,6 +18,8 @@ let b:did_indent = 1 setlocal indentexpr=GetSDLIndent() setlocal indentkeys+==~end,=~state,*<Return> +let b:undo_indent = "setl inde< indk<" + " Only define the function once. if exists("*GetSDLIndent") " finish diff --git a/indent/svelte.vim b/indent/svelte.vim index 047d1479..147df65b 100644 --- a/indent/svelte.vim +++ b/indent/svelte.vim @@ -183,7 +183,7 @@ function! GetSvelteIndent() call s:Log('... or current line is pug template tag') let ind = 0 elseif s:has_init_indent - if s:SynSvelteScriptOrStyle(cursyn) && ind < 1 + if s:SynSvelteScriptOrStyle(cursyn) && ind == 0 call s:Log('add initial indent') let ind = &sw endif diff --git a/indent/systemverilog.vim b/indent/systemverilog.vim index ed1d97a5..e39a670f 100644 --- a/indent/systemverilog.vim +++ b/indent/systemverilog.vim @@ -68,7 +68,7 @@ function SystemVerilogIndent() let vverb = 0 endif - " Indent accoding to last line + " Indent according to last line " End of multiple-line comment if last_line =~ '\*/\s*$' && last_line !~ '/\*.\{-}\*/' let ind = ind - offset_comment1 @@ -224,7 +224,7 @@ function SystemVerilogIndent() endif - " Return the indention + " Return the indentation return ind endfunction diff --git a/indent/tcl.vim b/indent/tcl.vim index 47fdb84f..17e6d896 100644 --- a/indent/tcl.vim +++ b/indent/tcl.vim @@ -3,10 +3,10 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'tcl', 'indent/tcl.vim') endif " Vim indent file -" Language: Tcl -" Latest Update: Chris Heithoff <chrisheithoff@gmail.com> +" Language: Tcl +" Maintainer: Chris Heithoff <chrisheithoff@gmail.com> " Previous Maintainer: Nikolai Weibull <now@bitwi.se> -" Latest Revision: 2018-12-05 +" Last Change: 24 Sep 2021 if exists("b:did_indent") finish @@ -17,6 +17,8 @@ setlocal indentexpr=GetTclIndent() setlocal indentkeys=0{,0},!^F,o,O,0] setlocal nosmartindent +let b:undo_indent = "setl inde< indk< si<" + if exists("*GetTclIndent") finish endif diff --git a/indent/teraterm.vim b/indent/teraterm.vim index c1239038..efd35c8c 100644 --- a/indent/teraterm.vim +++ b/indent/teraterm.vim @@ -7,7 +7,7 @@ endif " Based on Tera Term Version 4.100 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2018-08-31 +" Last Change: 2021-10-18 " Filenames: *.ttl " License: VIM License @@ -22,6 +22,8 @@ setlocal indentexpr=GetTeraTermIndent(v:lnum) setlocal indentkeys=!^F,o,O,e setlocal indentkeys+==elseif,=endif,=loop,=next,=enduntil,=endwhile +let b:undo_indent = "setl ai< inde< indk< si<" + if exists("*GetTeraTermIndent") finish endif diff --git a/indent/treetop.vim b/indent/treetop.vim index 269be1b5..b3d0c9fe 100644 --- a/indent/treetop.vim +++ b/indent/treetop.vim @@ -38,5 +38,5 @@ function GetTreetopIndent() let ind -= shiftwidth() end - retur ind + return ind endfunction diff --git a/indent/verilog.vim b/indent/verilog.vim index 77065208..2e5cec01 100644 --- a/indent/verilog.vim +++ b/indent/verilog.vim @@ -80,7 +80,7 @@ function GetVerilogIndent() let vverb = 0 endif - " Indent accoding to last line + " Indent according to last line " End of multiple-line comment if last_line =~ '\*/\s*$' && last_line !~ '/\*.\{-}\*/' let ind = ind - offset_comment1 @@ -223,7 +223,7 @@ function GetVerilogIndent() endif - " Return the indention + " Return the indentation return ind endfunction diff --git a/indent/zimbu.vim b/indent/zimbu.vim index 51416adc..0a8b9041 100644 --- a/indent/zimbu.vim +++ b/indent/zimbu.vim @@ -5,7 +5,7 @@ endif " Vim indent file " Language: Zimbu " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2016 Jan 25 +" Last Change: 2021 Sep 26 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -20,7 +20,7 @@ setlocal indentkeys=0{,0},!^F,o,O,0=ELSE,0=ELSEIF,0=CASE,0=DEFAULT,0=FINALLY " We impose recommended defaults: no Tabs, 'shiftwidth' = 2 setlocal sw=2 et -let b:undo_indent = "setl et< sw< ai< indentkeys< indentexpr=" +let b:undo_indent = "setl ai< cin< et< indentkeys< indentexpr< lisp< sw<" " Only define the function once. if exists("*GetZimbuIndent") |