mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Update
This commit is contained in:
@@ -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*$'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<"
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -38,5 +38,5 @@ function GetTreetopIndent()
|
||||
let ind -= shiftwidth()
|
||||
end
|
||||
|
||||
retur ind
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user