robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Christian Clasonvim-patch:6e649224926b (#15911)0c2a7aa5f7

master
786 B39 linesraw
1" Vim indent file
2" Language:		readline configuration file
3" Maintainer:		Doug Kearns <dougkearns@gmail.com>
4" Previous Maintainer:	Nikolai Weibull <now@bitwi.se>
5" Last Change:		24 Sep 2021
6
7if exists("b:did_indent")
8  finish
9endif
10let b:did_indent = 1
11
12setlocal indentexpr=GetReadlineIndent()
13setlocal indentkeys=!^F,o,O,=$else,=$endif
14setlocal nosmartindent
15
16let b:undo_indent = "setl inde< indk< si<"
17
18if exists("*GetReadlineIndent")
19  finish
20endif
21
22function GetReadlineIndent()
23  let lnum = prevnonblank(v:lnum - 1)
24  if lnum == 0
25    return 0
26  endif
27
28  let ind = indent(lnum)
29
30  if getline(lnum) =~ '^\s*$\(if\|else\)\>'
31    let ind = ind + shiftwidth()
32  endif
33
34  if getline(v:lnum) =~ '^\s*$\(else\|endif\)\>'
35    let ind = ind - shiftwidth()
36  endif
37
38  return ind
39endfunction