7
|
1 " Vim indent file
|
164
|
2 " Language: Python
|
|
3 " Maintainer: Bram Moolenaar <Bram@vim.org>
|
7
|
4 " Original Author: David Bustos <bustos@caltech.edu>
|
25880
|
5 " Last Change: 2021 Sep 26
|
7
|
6
|
|
7 " Only load this indent file when no other was loaded.
|
|
8 if exists("b:did_indent")
|
|
9 finish
|
|
10 endif
|
|
11 let b:did_indent = 1
|
|
12
|
|
13 " Some preliminary settings
|
|
14 setlocal nolisp " Make sure lisp indenting doesn't supersede us
|
|
15 setlocal autoindent " indentexpr isn't much help otherwise
|
|
16
|
29450
|
17 setlocal indentexpr=python#GetIndent(v:lnum)
|
7
|
18 setlocal indentkeys+=<:>,=elif,=except
|
|
19
|
25880
|
20 let b:undo_indent = "setl ai< inde< indk< lisp<"
|
|
21
|
7
|
22 " Only define the function once.
|
|
23 if exists("*GetPythonIndent")
|
|
24 finish
|
|
25 endif
|
|
26
|
29450
|
27 " Keep this for backward compatibility, new scripts should use
|
|
28 " python#GetIndent()
|
|
29 function GetPythonIndent(lnum)
|
|
30 return python#GetIndent(a:lnum)
|
20379
|
31 endfunction
|
|
32
|
7
|
33 " vim:sw=2
|