| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim indent file | 
					
						
							| 
									
										
										
										
											2005-02-12 14:29:27 +00:00
										 |  |  | " Language:		Python | 
					
						
							|  |  |  | " Maintainer:		Bram Moolenaar <Bram@vim.org> | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Original Author:	David Bustos <bustos@caltech.edu> | 
					
						
							| 
									
										
										
										
											2021-10-04 21:32:54 +01:00
										 |  |  | " Last Change:		2021 Sep 26 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " 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 |