summaryrefslogtreecommitdiff
path: root/mnv/runtime/indent/python.mnv
diff options
context:
space:
mode:
Diffstat (limited to 'mnv/runtime/indent/python.mnv')
-rw-r--r--mnv/runtime/indent/python.mnv34
1 files changed, 34 insertions, 0 deletions
diff --git a/mnv/runtime/indent/python.mnv b/mnv/runtime/indent/python.mnv
new file mode 100644
index 0000000000..2d09401af3
--- /dev/null
+++ b/mnv/runtime/indent/python.mnv
@@ -0,0 +1,34 @@
+" MNV indent file
+" Language: Python
+" Maintainer: The MNV Project <https://github.com/Project-Tick/Project-Tick>
+" Last Change: 2023 Aug 10
+" Former Maintainer: Bram Moolenaar <Bram@mnv.org>
+" Original Author: David Bustos <bustos@caltech.edu>
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Some preliminary settings
+setlocal nolisp " Make sure lisp indenting doesn't supersede us
+setlocal autoindent " indentexpr isn't much help otherwise
+
+setlocal indentexpr=python#GetIndent(v:lnum)
+setlocal indentkeys+=<:>,=elif,=except
+
+let b:undo_indent = "setl ai< inde< indk< lisp<"
+
+" Only define the function once.
+if exists("*GetPythonIndent")
+ finish
+endif
+
+" Keep this for backward compatibility, new scripts should use
+" python#GetIndent()
+function GetPythonIndent(lnum)
+ return python#GetIndent(a:lnum)
+endfunction
+
+" mnv:sw=2