1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-22 17:55:10 +01:00
vim/runtime/indent/python.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
886 B
VimL
Raw Normal View History

2004-06-13 20:20:40 +00:00
" Vim indent file
" Language: Python
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
2004-06-13 20:20:40 +00:00
" 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
2022-07-25 15:42:07 +01:00
setlocal indentexpr=python#GetIndent(v:lnum)
2004-06-13 20:20:40 +00:00
setlocal indentkeys+=<:>,=elif,=except
2021-10-04 21:32:54 +01:00
let b:undo_indent = "setl ai< inde< indk< lisp<"
2004-06-13 20:20:40 +00:00
" Only define the function once.
if exists("*GetPythonIndent")
finish
endif
2020-05-12 22:49:12 +02:00
2022-07-25 15:42:07 +01:00
" Keep this for backward compatibility, new scripts should use
" python#GetIndent()
2004-06-13 20:20:40 +00:00
function GetPythonIndent(lnum)
2022-07-25 15:42:07 +01:00
return python#GetIndent(a:lnum)
2004-06-13 20:20:40 +00:00
endfunction
" vim:sw=2