Open abitrolly opened 4 years ago
Ctrl+I
does this in some extent. Select more than one line or even whole file.
It will not produce correct indentation for whole Python file, because only the programmer knows when the code must be unindented after if
, for
, etc.
@andreikop while counting lines when opening file, it might be possbile to gather statistics on indentation and use the most popular one. This indentation detection
could actually improve user experience with Enki.
Looks like Enki already detects indentation, and I got your message wrong.
There are a couple of tools that do autoformatting for Python - https://github.com/pausan/cblack#similar-projects which probably could be reused for the task.
After writing Go and Terraform code in
vim
which automatically runsgo fmt
andterraform fmt
it is very painful to fix Flake8 errors by hand. Is it possible to implement an autoformat mode for Enki?