https://github.com/nathom/fast-python-indent
A very fast python indent config for vim
https://github.com/nathom/fast-python-indent
Last synced: 9 months ago
JSON representation
A very fast python indent config for vim
- Host: GitHub
- URL: https://github.com/nathom/fast-python-indent
- Owner: nathom
- Created: 2021-04-16T07:36:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-25T00:12:26.000Z (over 4 years ago)
- Last Synced: 2025-02-13T04:44:51.814Z (11 months ago)
- Language: Vim script
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fast-python-indent
An indent file for vim.
The indent files included with vim, and the other ones that I have tried,
are very slow. When `profile`ing, they are consistently marked as the slowest
functions.
Here's the result of a `profile` of running `1000o` at the end of a large Python
file with default indenting, and then with `fast-python-indent`:
```vim
" Built-in indent file
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1000 9.867825 9.862754 GetPythonIndent()
" ...
" fast-python-indent
FUNCTIONS SORTED ON TOTAL TIME
count total (s) self (s) function
1 0.023404 0.000086 108_VimCloseCallback()
1 0.023303 0.000057 108_VimExitCallback()
1 0.023204 0.000164 103_ExitCallback()
1 0.022936 0.000099 102_HandleExit()
1000 0.022573 GetPythonIndent()
" ...
```
`fast-python-indent` is over 437x faster!
This file will correctly indent the vast majority of lines, but it is not
guaranteed to be PEP8 compliant.